How do you make a war file auto deploy?
The server component is glassfish and the database is created in MySQL. Do I need to create an executable file that will extract the war file? and how to do it so?
It should be sufficient to copy/move your WAR file to the following folder:
$GLASSFISH_HOME/glassfish/domains/domain1/autodeploy
(You may change the domain name if you are using a different one.)
See also:
How to to autodeploy war file with GlassFish
WAR doesn't get redeployed in Glassfish from autodeploy
Oracle GlassFish Server 3.0.1 Quick Start Guide - Deploying and Undeploying Applications
Related
I'm using IJ Ultimate 2020.3 and trying to set up a Jetty Server run configuration.
AFAIK, in order to start Jetty with a war artifact it is needed to be located in $JETTY_HOME/webapps directory.
But, it looks like the Jetty plugin of my IJ refuses to copy the war (exploded, or any other) artifact to that directory, which lead the Jetty server to fail.
I was able to start the Jetty server (from IJ) only after manually copying the war file into the webapps directory, so looks like the only problem is the 'copy' step.
Any ideas?
IntelliJ IDEA doesn't copy the artifact into webapps, instead it instructs Jetty to load the artifact directly from the location that you have configured as the artifact output directory.
Artifact used for deployment:
Artifact output directory:
Startup logs showing that artifact is loaded directory from its output directory and not from webapps:
Thanks #CrazyCoder, this is a progress for me.
problem is that my output console suggests that it does not search for the artifact in the location it is set:
I am working on TIFF to JPEG conversion program. I am using the TIFF implementation from jai-imageio-core.1.3.1.jar, which is available in the classpath.
Everything works fine in my local environment in eclipse (running on tomcat server). However, when I deploy the same in Weblogic, I am getting the following error. Weblogic server is unable to recognize the TIFF implementation classes. I am unable to find the missing link. Please help.
java.lang.NoClassDefFoundError: com/github/jaiimageio/impl/plugins/tiff/TIFFImageReader
at com.github.jaiimageio.impl.plugins.tiff.TIFFImageReaderSpi.createReaderInstance(TIFFImageReaderSpi.java:118)
at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513)
at javax.imageio.ImageIO.read(ImageIO.java:1443)
at javax.imageio.ImageIO.read(ImageIO.java:1308)
I will answer my own question. The issue is resolved. The problem was with the the jai-imageio-core.1.3.1.jar file present in multiple places. It was present in my application war file in WEB-INF/lib folder. however, the same jar file was also present outside the war in the weblogic adm root directory. (my bad)
I guess weblogic clearly expects the jar file only in 1 place (especially java SPI implementation jar)
It is also a good idea to search all directories under weblogic to make sure there are no additional jar files of the same name.
I had only one jai-imageio-core.1.3.1.jar file (in WAR file) and caught this error. Weblogic managed server restart helped me.
I created a helloworld eclipse RAP project and run it eclipse itself.It is working fine.
After that I exported the RAP project to war file by using the eclipse war product configuration.
It created the war file.I deployed the war file in tomcat. After that when I try to access
the war deployed helloworld application, I am getting status 404 error.
http://127.0.0.1:8080/helloworld
I searched in internet and checked for troubleshooting and they mentioned to check in web.xml
all the entries are available or not. I confirmed it is available. Also I checked application structure.
It is fine as it is suggested. Could any one help me how to access the deployed application in tomcat?
Or is there any other server I can use in order to make it work quickly?
I suppose that the war file is named helloworld.war and http://127.0.0.1:8080/helloworld is the URL of your application.
If your entrypoint is not registered at the root path, you have to add the entrypoint name to the URL, e.g. http://127.0.0.1:8080/helloworld/entrypoint.
Alternatively, you can register the application at the root path in your ApplicationConfiguration:
application.addEntryPoint("/", YourEntryPoint.class, properties);
Then you should be able to access it at http://127.0.0.1:8080/helloworld.
Update:
If you use extension points, configure the path in your entrypoint extension, for example:
<extension
point="org.eclipse.rap.ui.entrypoint">
<entrypoint
class="example.MyEntrypoint"
path="/" />
</extension>
My setup includes a weblogic 12c server which hosts several applications. The application which i am writing has log4j configuration property with appenders that are specific to this application. I have packaged the property in app EAR and deployed it to weblogic.
I want the log4j setup in weblogic to pull configuration from this property file. Will i still need a global configuration file put in inside the domain root folder? . The thing that confuses me is, why do i need to have log4j configuration in domain root if i already have it inside the application ( while i load using PropertyConfigurator) .
I did copy the log4j and wllog jars to domain/lib but i am not happy with copying anything to server directories since i want this to be driven by the deployed EAR.
I am new to Weblogic so might be something obvious. Tried several links on the web but none of them answers my question. I have been referring to this thread for the setup. https://community.oracle.com/thread/1063248
Make sure log4j jar is in APP-INF/lib
Make sure your log4j config file is in the root classpath for the ear (APP-INF/classes)
If you don't have one already, add a weblogic-application.xml (see http://docs.oracle.com/cd/E24329_01/web.1211/e24368/app_xml.htm#WLPRG389) to your META-INF directory at the EAR level, and in there include a prefer-application-packages element with package-name of org.apache.log4j
I finally have my application in IntelliJ and deploying to JBoss. I'd like to get hot deploy working but it looks like I need to understand how IntelliJ and JBoss interact.
When I build my project in IntelliJ and then start JBoss, the ear file does not appear in the deploy directory so I assume that there is some magic that IntelliJ does so that JBoss reads from a different folder. What is happening during this step?
Thanks :)
I know this is an old and apparently answered question, but unfortunately the links provided in the accepted answer didn't give me the simple details I was looking for. For anyone also trying to understand how IntelliJ IDEA deploys your exploded war to JBoss without copying files to the deployments folder, here's what I've found while deploying locally from IDEA 14 (EAP) to JBoss 7.1.1.Final:
After you've created an "exploded war" artifact for your project (or it has automatically been created for you), IDEA will build your provided sources and place the output in the directory set in the artifact options (you can change this setting to place the output inside the deployments folder inside your jboss installation).
IDEA will update your JBoss configuration file (/standalone/configuration/standalone.xml) and add a "deployment" node inside the deployments section. This entry simply defines a name, a runtime name and the exploded war root folder for your project, which will point to the output directory of your artifact set in IDEA.
When JBoss is started (either manually or from your run/debug configuration in IDEA), it will automatically deploy your artifact. Be warned that if your files are in the output directory of your project and you clean it, JBoss will still try to find the directory, thus encountering errors in your next attempt to start it: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content, Failed to process phase STRUCTURE of deployment and java.io.FileNotFoundException to name a few.
Please refer to the documentation.
Basically, you need an exploded Artifact configuration with the directory name ending with .ear.
Build | Make performs hot deployment as well as Update action (which is configurable and can update only resources, resources and classes, optionally redeploy or restart the server).
Instead of copying your application to JBoss, IDEA runs it with appropriate parameters so that it uses Artifact directory instead. Configuration is very flexible and you can just change the artifact directory location to reside under JBoss directory.