where to place the external java jar when deploy birt report? - birt

I use some java code to retrieve data from database, and export the java code as runnable jar, placed the jar in eclipse\plugins\org.eclipse.birt.report.viewer_3.7.1.v20110905\birt\scriptlib, then in the birt report I can use the jar to get the data. In eclipse all goes smoothly, I can see the correct data in preview.
but when I upload the myreport.rptdesign to the server, I don't know where to place the jar then the report can refer to it. In our team, they use grails to deploy birt report, all I need to do is upload the rptdesign file to a specified server directory, when there's no java jar to refer, that's enough. but when I need to refer to a java jar, I do not know how to deploy.
Please help and thanks a lot.
=========================================================
here is answer of my question. Just put the jar in directory lib of grails. It works!

Did you try to put the jar file in the server/lib directory? What kind of application server are you currently using?

Related

Spring Boot fastest way to deploy instead of build Jar?

I am new to Spring Boot from php world. In Php development, it is simple to make changes on the file, upload and run.
But on Spring boot, my development relies on remote ubuntu server, every time I make change in *.java, I have to build the Fat Jar, upload the Jar, kill the current java process on ubuntu, and run the java -jar my.jar again, which spend much time on the upload because the Jar is about 60 mb.
Is there any way I can work like php, just upload the changed file, so the spring boot just compile the class and run?
Does change to build *.war help to faster deployment?
There are a few option to mitigate the roundtrip of building the jar file and upload it.
Hot-swap: For minor changes, you can hot-swap changes automatially when you have a remote-debugger attached. I use Intellij as Ide, which provide this out of the box after a file is recompiled, see more at this link how to enable it.
Reloading tool: use a tool that are designed to reload Java classes, such as JRebel which extends the classloader and updates a class if a change has been detected. However, they are often only available in a paid version.
Spring Boot dev-tools: this tool also monitors changes and restart the application with the new changes (so no need to rebuild the jar file). It is possible to use on a remote application. See this link for more info.
Using a war file is different concept since a war file is executed inside an application container (e.g a Wildfly server). You can dynamically upload a war file to a running application server, which will only restart the war file. But I'm not sure if this will lead to faster deployment, however it is a different approach how the application is run.

Artifactory maven-metadata.xml and bundles with Java API

I'm attempting to upload & deploy a jar that we receive from a vendor into Artifactory using the Java API (artifactory-java-client-services v1.1.0). My uploads don't generate maven-metadata.xml and I can't find an option to auto-generate a pom.xml. I also can't find how I would indicate that I'm uploading a bundle rather than a single file.
Currently I'm using a simple snippet of code to upload a test jar and a simple pom:
Path jarPath = Paths.get(tmpDir.toString(), "test1.jar");
RepositoryHandle repositoryHandle =
ArtifactoryClient.create(url, username, password).repository(repositoryName);
UploadableArtifact jarArtifact =
repositoryHandle.upload("com/company/play/1.0.0/test.jar", jarPath.toFile());
File responseFile = jarArtifact.upload();
I use the same process to upload the pom.xml.
So:
Is there a way to request the maven-metadata.xml be recalculated as in the REST call shown here?
Is there any way to indicate that Artifactory needs to auto-generate a simple pom.xml on upload with the Java API?
Is there any way to indicate that the upload is a bundle?
Thanks in advance!
maven-metadata.xml is generated automatically upon deployment. Note that it might take some time – indexing and metadata generation is an async task.
pom.xml generation is not triggered from REST API or Java API ATM. Didn't you mention that you upload the pom.xml?
Not sure what you mean by "bundle". OSGi bundle? Or an archive that you expect Artifactory to unzip and deploy? In case of OSGi bundle there is nothing needed to be done, in case of the archive, again, it's not supported ATM.

Updating KIE Execution Server container with updated rules file

This is where I am at:
I am using Drools 6.2 and calling drools engine remotely via KIE Execution Server running on jboss.
I used workbench to create my initial drl file and fact objects and then used Build & Deploy option of workbench to create and deploy the jar file. I then created the container using the jar file and got the end point that I am using to access the rule engine from my client application. At this point every thing is working fine and I am able to fire the rules remotely.
My requirement is to modify the rules file (.drl) outside the workbench, let's say in notepad and update the container with this new drl file. Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository? I can then run the KIE scanner to look for the latest version of my jar file and automatically update my container. Or is there another recommended way to update the running container with an updated .drl file?
My client application is not in Java so I am not looking for an integrated solution where I can write java code to create the knowledge base and use kie builder to build the drl file.
Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository?
2 options that I can think of, one "easy" and one not so much:
Option 1
Use Maven and the maven drools plugin (you don't have to write Java code, just create your maven project and run mvn package to get a jar. See here: https://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html#KIEModuleIntroductionBuildingIntroductionSection
Option 2
A JAR file is simply a zip file with a specified structure. That means that you should be able to update your whatever.drl file, put it in the directory structure that the KIE server expects and deploy it.
For instance, create a directory structure like:
META-INF/kmodule.xml
com/site/project/drools/rules/myrule/SomeRule.drl
Zip those files into somefile.jar and deploy it.

Can i use .rar file in class path for a standalone Java program to pick up?

I have a standalone Java program which sends a message to MQ and receives a message. I need to use the wmq.jmsra.rar which has 10+ jar files in it. It works fine, if I unzip the rar and use jars in the classpath. I was wondering whether there is a way i can use this .rar file directly instead of unzipping it and adding each jar into classpath or adding the folder to classpath.
My question is related to this, but different... Is it correct or incorrect for a Java JAR to contain its own dependencies?
Thanks
Jugunu
The Resource Adapter (wmq.jmsra.rar) should be used when configuring a JavaEE application server. Details on getting that are at http://www-01.ibm.com/support/docview.wss?uid=swg21633761
Please don't unzip this to get at the component parts; instead use the MQ Classes for JMS 'allclient' jar or the OSGi bundles. Information on how to get those are available at http://www-01.ibm.com/support/docview.wss?uid=swg21683398
Those technotes give information for the latest releases. The 'allclient' is a v8 statement only - however installation of the client support packs (eg MQC75) will give you access to the JMS client.

Library to create and upload jar dynamically to maven repository

I have service based environment in which I have to create a jar and upload it dynamically to maven repository and return the dependency tree for it. Is there any library which will create a jar file and upload that jar file to maven repository and will return me dependecny of uploaded jar. Right now Im creating it with maven goals in eclipse but I don't want that.
Thanks,
If you don't want to use the command line or IDE, have you looked at the Maven API? There's also an 'undocumented' Maven embedder project.
Below are some links that may help you get started, pick the approach that is easier for you, while meeting your requirements:
https://github.com/jenkinsci/lib-jenkins-maven-embedder/blob/master/src/main/java/hudson/maven/MavenEmbedder.java
http://maven.apache.org/ref/3.0.2/maven-embedder/apidocs/org/apache/maven/cli/MavenCli.html
http://q4e.googlecode.com/svn-history/r819/trunk/plugins/maven/core/src/org/devzuz/q/maven/embedder/internal/EclipseMaven.java
http://developers-blog.org/blog/def../2009/09/18/How-to-resolve-an-artifact-with-maven-embedder

Resources