war

maven-tomcat7-plugin produces corrupted executable JAR

南笙酒味 提交于 2019-12-01 01:25:21
问题 I have problem using Maven Tomcat7 plugin to produce JAR archives with embedded Tomcat7 instance. Here is my pom.xml snippet: <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <path>/${project.artifactId}</path> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>exec-war</goal> </goals> </execution> </executions> </plugin> My project uses war packaging. The JAR file containing

Why is maven-war-plugin failing for web.xml missing if I configured it not to fail on missing web.xml?

▼魔方 西西 提交于 2019-12-01 00:10:50
问题 Here's a challenge: why is this build failing? I have configured Maven's maven-war-plugin not to fail on an abscent web.xml file, it seems: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <executions> <execution> <id>prepare-war</id> <phase>prepare-package</phase> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <archiveClasses>false</archiveClasses> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix /> <

Access session of another web application

折月煮酒 提交于 2019-11-30 20:05:12
Is it possible to configure two separate web apps (WAR) in a J2EE application (EAR) to access a shared session context? Further info: I ended up creating a shared class from the EAR which stored the required information in static members. This did the trick, even if it seemed like a dirty hack. Not directly. Most containers put each WAR in a separate classloader with the EAR classloader as their parent. Each app's sessions are separate. You can put something provided by the parent EAR in each session. If you need them to share something, make it a EAR function. As far as i've read and seen, it

JBAS015893: Encountered invalid class name

三世轮回 提交于 2019-11-30 17:05:49
I'm currently cleaning up my Project and related Errors / Warnings a bit. Everytime i deploy my Maven Project to the JBoss AS 7.1.1.Final I get a lot of Warnings. I found a lot of posts / comments stating to just ignore or hide those warnings. Okay, warnings are just warnings, but however it should be possible to resolve the reason for the warnings, instead of just hiding or ignoring those warnings (Because I think: What is a warning NOW, can become an error at some other point) 09:51:55,145 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "oce2

JBAS015893: Encountered invalid class name

六眼飞鱼酱① 提交于 2019-11-30 16:27:03
问题 I'm currently cleaning up my Project and related Errors / Warnings a bit. Everytime i deploy my Maven Project to the JBoss AS 7.1.1.Final I get a lot of Warnings. I found a lot of posts / comments stating to just ignore or hide those warnings. Okay, warnings are just warnings, but however it should be possible to resolve the reason for the warnings, instead of just hiding or ignoring those warnings (Because I think: What is a warning NOW, can become an error at some other point) 09:51:55,145

How can I specify “Context path” on Tomcat 8 inside META-INF/context.xml in java war file?

牧云@^-^@ 提交于 2019-11-30 15:28:36
问题 How can I deploy mywebapp-1.0.0.war to $TOMCAT_HOME/webapps directory with context path /mywebapp using context.xml inside the war file on Tomcat 8? I'm getting back to work with Tomcat after long time since version 5. I'm used to create META-INF/context.xml inside my war file: <?xml version="1.0" encoding="UTF-8"?> <Context path="/mywebapp"> ... </Context> Maven creates a war file with this name: mywebapp-1.0.0.war But when I deploy the war file to $TOMCAT_HOME/webapps directory the context

Best practices to store and access resource files in java web application

不想你离开。 提交于 2019-11-30 15:18:32
问题 I have a bunch of text, xml and other files (i.e. resources) that I need to access using servlets in java web app. For example, there is an xml file, a part of which is returned with a servlet by a user query. I am using Tomcat. What is the best practice to store these files and access them from java code? 1) What are the default folders where should I put them, do I need to put them into Web archive or into one of the Jars? 2) How to access the files from java code? How can I set the path to

How can I specify “Context path” on Tomcat 8 inside META-INF/context.xml in java war file?

て烟熏妆下的殇ゞ 提交于 2019-11-30 15:18:31
How can I deploy mywebapp-1.0.0.war to $TOMCAT_HOME/webapps directory with context path /mywebapp using context.xml inside the war file on Tomcat 8? I'm getting back to work with Tomcat after long time since version 5. I'm used to create META-INF/context.xml inside my war file: <?xml version="1.0" encoding="UTF-8"?> <Context path="/mywebapp"> ... </Context> Maven creates a war file with this name: mywebapp-1.0.0.war But when I deploy the war file to $TOMCAT_HOME/webapps directory the context path will be http://localhost:8080/mywebapp-1.0.0 instead of http://localhost:8080/mywebapp/ . Also I

Weblogic application context root is war file name instead of name specified in weblogic.xml

亡梦爱人 提交于 2019-11-30 15:15:20
问题 I have an application which I have deployed using Maven to Weblogic 10.3.6 . I have specified context root in weblogic.xml as <context-root>/myapps</context-root> The problem I am having is it is taking the war file name as context root instead of the name I have specified in weblogic.xml How can I change the context root instead of the name taking war file name as context root? Weblogic.xml <?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic

Best practices to store and access resource files in java web application

谁说我不能喝 提交于 2019-11-30 14:13:13
I have a bunch of text, xml and other files (i.e. resources) that I need to access using servlets in java web app. For example, there is an xml file, a part of which is returned with a servlet by a user query. I am using Tomcat. What is the best practice to store these files and access them from java code? 1) What are the default folders where should I put them, do I need to put them into Web archive or into one of the Jars? 2) How to access the files from java code? How can I set the path to them so it will work in any environment? P.S. I've read a number of posts related to this topic, most