war

How to unpackage and repackage a WAR file

风流意气都作罢 提交于 2019-11-26 22:20:52
问题 I have a WAR file. I would like to open it, edit an XML file, remove some jars and then re-package it. I used WINRAR to open the WAR file and I removed some Jars and did an 'Add to Archive' in WinRar and created a WAR. When I deployed the WAR in jboss folder, I got an exception. 16:05:14,316 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."myapplication.war". STRUCTURE: org.jboss.msc.service.StartException in service jboss

IntelliJ and Tomcat…changed files are not automatically recognized by Tomcat

梦想的初衷 提交于 2019-11-26 21:18:00
I am running Intellij Ultimate with Tomcat and deploying a war. Everything deploys fine to the webapp directory of tomcat. When I change a file like an xhtml file, is there a way for tomcat to automatically pick up that change? As of right now I need to copy the file from intellij and copy it to the directory of where it lives in the tomcat webapp directory. I know there are certain files that will need a recompile, but xhtml's are not one of them. Javaru This cannot be done if you deploy a war with IntelliJ IDEA. However, it can be if you deploy an exploded war . In IDEA: open your Tomcat Run

How do I automatically export a WAR after Java build in Eclipse?

天涯浪子 提交于 2019-11-26 20:58:22
问题 I have a J2EE project in Eclipse 3.2 and at the end of every build I want to automatically create and deploy a WAR file. At the moment I have to do this by hand which is 5 or 6 mouse-cliks and it would be nice to automate it. I know I can do this with a custom build script using ANT but I am hoping for an Eclipse native solution. I have the J2EE standard tools (JST) and Web Standard Tools (WST) plug-ins installed in my Eclipse environment. 回答1: If you can implement it as an Ant script, then

what is the right path to refer a jar file in jpa persistence.xml in a web app?

爱⌒轻易说出口 提交于 2019-11-26 20:35:53
persistence.xml looks like this: <persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <non-jta-data-source>jdbc/test</non-jta-data-source> <jar-file>../../lib/app-services-1.0.jar</jar-file> <exclude-unlisted-classes>false</exclude-unlisted-classes> </persistence-unit> It is a web project, so the deployment unit is a war file. The jar file I tried to refer is in WEB-INF/lib/ folder , persistence.xml is in WEB-INF/classes/META-INF folder. When being deployed, it simply tells me "WARNING: Unable to find file (ignored):

Skinny WAR, libraries in EAR: “struts-tags not found” error

大城市里の小女人 提交于 2019-11-26 17:11:54
问题 In a Java EE project, I moved all the libraries from the WAR/WEB-INF/lib to the EAR/lib . Opening a JSP, now I get this error: Struts has detected an unhandled exception: Messages: File "/struts-tags" not found File: org/apache/jasper/compiler/DefaultErrorHandler.java Line number: 51 Stacktraces org.apache.jasper.JasperException: File "/struts-tags" not found ........... ........... How to resolve this problem ? 回答1: Moving the libraries from the WAR to the EAR may be very useful, e.g. if you

How do I run a class in a WAR from the command line?

旧城冷巷雨未停 提交于 2019-11-26 15:20:33
I have a Java class which has a main and I used to run as a standalone app from the command line e.g. java -jar myjar.jar params I needed to repackage the code to run under apache and all my code, including the entry point class from the old jar, has ended up in a WAR file for easy deplyment into the web server. However, I still want to be able to run it from the command line and the code has not changed and is all in there, I just can't figure out how to get it to run. Here's what I tried... I presumed the WAR was just like a jar, so java -jar mywar.war params That failed saying there was no

Maven WAR dependency

点点圈 提交于 2019-11-26 14:15:19
I am writing a project for acceptance testing and for various reasons this is dependent on another project which is packaged as a WAR. I have managed to unpack the WAR using the maven-dependency-plugin, but I cannot get my project to include the unpacked WEB-INF/lib/*.jar and WEB-INF/classes/* to be included on the classpath so the build fails. Is there a way to include these files into the classpath, or is there a better way of depending on a WAR? Many thanks. There's another option since maven-war-plugin 2.1-alpha-2. In your WAR project: <plugin> <artifactId>maven-war-plugin</artifactId>

Difference between jar and war in Java

余生颓废 提交于 2019-11-26 11:30:27
What is the difference between a .jar and a .war file? Is it only the file extension or is there something more? aioobe From Java Tips: Difference between ear jar and war files : These files are simply zipped files using the java jar tool. These files are created for different purposes. Here is the description of these files: .jar files: The .jar files contain libraries, resources and accessories files like property files. .war files: The war file contains the web application that can be deployed on any servlet/jsp container. The .war file contains jsp, html, javascript and other files

IntelliJ and Tomcat…changed files are not automatically recognized by Tomcat

折月煮酒 提交于 2019-11-26 07:54:10
问题 I am running Intellij Ultimate with Tomcat and deploying a war. Everything deploys fine to the webapp directory of tomcat. When I change a file like an xhtml file, is there a way for tomcat to automatically pick up that change? As of right now I need to copy the file from intellij and copy it to the directory of where it lives in the tomcat webapp directory. I know there are certain files that will need a recompile, but xhtml\'s are not one of them. 回答1: This cannot be done if you deploy a

How to create war files

可紊 提交于 2019-11-26 05:59:33
What are the best practices of creating war files (using eclipse) to run on tomcat? tutorials, links, examples are highly appreciated. David Citron You can use Ant to set up, compile, WAR , and deploy your solution. <target name="default" depends="setup,compile,buildwar,deploy"></target> You can then execute one click in Eclipse to run that Ant target. Here are examples of each of the steps: Preconditions We'll assume that you have your code organized like: ${basedir}/src : Java files, properties, XML config files ${basedir}/web : Your JSP files ${basedir}/web/lib : Any JARs required at