war

How do I access a text file from within my war

江枫思渺然 提交于 2019-11-28 10:23:47
How do I know what file reference to use to get a file from my WAR. The structure of the WAR is: WAR src - model - web build WebContent META-INF WEB-INF LIB The JSPs are under WebContent, I have put the config.txt file under the WebContent folder and tried to get to it with BufferedReader in = new BufferedReader(new FileReader("WebContent/config.txt")); But this doesn't work. Does anyone know what reference I need to pass or how I can figure it out. Check out ServletContext.getResourceAsStream() . Here is an example . I think just remove WebContent from the path while reading the file and it

How to use JPA2 on JBoss 5.x ? (or How to eliminate class loading isolation issue?)

泄露秘密 提交于 2019-11-28 10:11:47
I would like JBoss to use only the dependencies located in my war file. Each time I deploy this war file, JBoss still uses its own jars. Here is the jboss-web.xml I use : <?xml version="1.0" encoding="UTF-8"?> <jboss-web> <class-loading java2ClassLoadingCompliance="false"> <loader-repository> my.package:loader=my-app.war <loader-repository-config> java2ParentDelegation=false </loader-repository-config> </loader-repository> </class-loading> </jboss-web> and the jboss-classloading.xml : <?xml version="1.0" encoding="UTF-8"?> <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY"

The servlets named [create_subscription] and [servlet.create] are both mapped to the url-pattern [/create] which is not permitted [duplicate]

久未见 提交于 2019-11-28 08:41:34
问题 This question already has an answer here: java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted 6 answers I am using Tomcat 7 and Eclipse in JDK 7 to create this simple servlet application. But when I copied the war file into tomcat, I cannot start it and get this error: The servlets named [create_subscription] and [servlet.create] are both mapped to the url-pattern [/create] which is not permitted the web.xml is: <

UnsupportedClassVersionError unsupported major.minor version 51.0 unable to load class [duplicate]

最后都变了- 提交于 2019-11-28 08:03:35
Possible Duplicate: Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupporte d major.minor version 51.0) i have developed an web application in java using jdk 1.7.0 ,Eclipse IDE (Indigo) and is running that application on the tomcat(apache-tomcat-7.0.23) configured in eclipse ide. When i tried to run my application through IDE it runs fine but when i created its war and placed it in apache deployment folder(webapps) and run it from outside the IDE the start page gets successfully loaded but when i tried to do any operation over it it gives me an error

Setting default application in tomcat 7

二次信任 提交于 2019-11-28 07:39:39
I've gone through the threads that describe how to configure a given WAR (say abc.war) as default web-app in tomcat. Either Rename the abc.war to ROOT.war or Create a context ROOT.xml in ${tomcat.home}/conf/Catalina/localhost with path="" and docBase set to relative/absolute path to the war (keeping the abc.war outside of webapps to avoid double deployment). Both the solutions result in ROOT.war in webapps (appBase) directory. However I want to retain the WAR name (abc.war) in webapps and not have a separate ROOT.war to achieve this. One solution that worked in my case was adding a context

How to create a WAR file using the commandline?

让人想犯罪 __ 提交于 2019-11-28 07:08:10
问题 I installed JBoss Developer Studio and it's possible to create a WAR file by "right mouse project > Export > WAR file" but I want to export my project to a WAR file using the commandline. I have maven installed which is one of the requirements of the Studio and I read that I can generate a WAR file using maven but I require a file called pom.xml. When I searched through my workspace and project, pom.xml was missing. I may need to manually create pom.xml but I'm unsure how to. My directory

Jetty - how to programatically enforce security-constraint in web.xml

南笙酒味 提交于 2019-11-28 06:20:13
问题 In our web.xml we had the following security-constraint <security-constraint> <web-resource-collection> <web-resource-name>Everything on the app</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> This works great except we need to programatically turn this constraint on and off, so writing a filter to do something similar is essentially needed

Java EE Containers vs Web Containers

北战南征 提交于 2019-11-28 03:27:46
I'm relatively new to Java EE/EJB, and I've been reading alot regarding Java EE containers. I've had experience working with a web container (WAR file in jboss). I am also aware that Jboss can also be used as a Java EE container. My question is, what is the difference between a Java EE container against a web container? I know Java EE is also able to contain a .war file. Are they different and what are their differences? Are there any preferences vendor specific-wise which is better? Miljen Mikic First of all, "J2EE" is an obsolete abbreviation, it is now simply called "Java Enterprise Edition

How to start jenkins on different port rather than 8080 using command prompt in Windows?

荒凉一梦 提交于 2019-11-28 03:05:07
I have jenkins.war and I started it from command prompt in Windows as: java -jar jenkins.war It was started well and easily browsed as http://localhost:8080 I want to start on 9090 port. How can I do that? Use the following command at command prompt: java -jar jenkins.war --httpPort=9090 If you want to use https use the following command: java -jar jenkins.war --httpsPort=9090 Details are here Prasad Open the jenkins.xml in the jenkins home folder (usually C:\Program Files (x86)\Jenkins ) and change the port number: httpPort=xxxx to httpPort=yyyy then restart the service. it should change the

Is it possible to use multiple ehcache.xml (in different projects, same war)?

↘锁芯ラ 提交于 2019-11-28 02:34:58
问题 I have a services project and a web project. I need to have eh-cache in both projects. The idea is that if the service project is updated, it's cache-related changes (like keys and invalidation rules) will also be available, while no changes are made to the web project. Being so independent, the service project can also be used with another projects without them even knowing of eh-cache. At this point, my web project also uses eh-cache for its own purposes. I am not much experienced with eh