war

Running code in the context of a java WAR from the command line

How would I go about writing some code to allow access to a Java class in my webapp from the command line. E.g. I have a java class with command line interface, that can runs code in the context of the webapp, with access to the DB etc. I want to log on the machine hosting my WARred app in tomcat and be able to interact with it Where ...

Why do Jars get Excluded from Enunciate's Deployment?

I'm using Enunciate to build a prototype REST api and need to include a jar containing custom code as a library. My Ant Script looks like this: <!--include all jars--> <path id="en.classpath"> <fileset dir="${lib}"> <include name="**/*.jar" /> </fileset> </path> <!--define the task--> <taskdef name="enunciate" classn...

jEE war files

is it possible to include/embed one JEE application(war file) inside another? i have an application which is a portal application and i want to allow other users add there applications to it. In order to do this i need some way to be able access there applications in mine. Is this possibe? ...

Can I list the resources in a given package?

Lets assume my classes are loaded from a compressed .war file or loaded elsewhere, how can I discover all the resources in a given package? Enumerating files will not really work, since this is a war file. Most likely this will involve using the current classloader? Is there a library out there that does something like that? Googling...

Access session of another web application

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. ...

How can I automate (script) creating a war file in eclipse?

It's 5 button clicks to get eclipse to create a deployable war file for my eclipse project, I figure there's probably some eclipse command line option to do the same thing, so I can just write it into a script, but I'm not seeing it. ...

In iplanet 6, where is the webapp directory defined?

I'm trying to deploy my first war file on an existing iplanet 6 install, and the only place in the config directory that specifies what looks like the web app directory is in server.xml: ... But when I put my war file in /WWW/ns-home/docs/olc nothing happens. Is there somewhere else I should be looking? ...

Is it possible to have a servlet forward to a jsp outside of its context root?

We currently have an appserver setup where EVERYTHING is off of one big context root, and we copy class files and restart app servers to deploy. Not ideal. I'm trying to set up an ant script to do the build and deploy using wdeploy, and everything works, except I need my servlet to forward to jsps outside of the context root of my war fi...

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

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 ha...

Specify authentication in container rather than web.xml

We distribute our web-application to our customers as a .war file. That way, the user can just deploy the war to their container and they're good to go. The problem is that some of our customers would like authentication, and use the username as a parameter to certain operations within the application. I know how to configure this using...

How do you manage embedded configuration files and libraries in java webapps?

I'm currently working on a j2ee project that's been in beta for a while now. Right now we're just hammering out some of the issues with the deployment process. Specifically, there are a number of files embedded in the war (some xml-files and .properties) that need different versions deploying depending on whether you are in a dev, testin...

Deploying java applications to Tomcat using CruiseControl.net

I have CruiseControl.net setup on a machine which is currenly being used for Microsoft Projects. I needed to add a java project to the same build server. The java war files generated need to be copied to another server under Tomcat. However, I face a lot of problems when it tries to copy to that network location, due to file access den...

How can I set the content-disposition header for a zip-file referred to in welcome-file-list?

I want to create a WAR that would only contain a single zip file that is included in the of the web app, deploy that war to JBoss and be able to download the zipfile by accessing the root of the WAR. So, currently I have a war, which has the zipfile in it, and this web.xml: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web ...

Maven in multimodule web project: how to put sibling modules output to WEB-INF/classes and not into WEB-INF/lib as JARs?

I have a multi-module Maven project. By default when I build a web module, all sibling modules of type JAR it depends on are copied to WEB-INF/lib folder. I want output of sibling modules to be placed in WEB-INF/classes folder without packaging to JAR. More general question may be: how to keep sibling modules' configuration files out of...

JBoss5: Cannot deploy due to java.util.zip.ZipException: error in opening zip file

I have a web client and a EJB project, which I created with Eclipse 3.4. When I want to deploy it on Jboss 5.0.1, I receive the error below. I searched a lot but I wasn't able to find a solution to this. 18:21:21,899 INFO [ServerImpl] Starting JBoss (Microcontainer)... 18:21:21,900 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.1....

Can I make a change in propietary war file?

Hi I have a proprietary application and its war file is available to us. I need to basically add a jsp page to the current application. I was thinking i will write the independent jsp, java files build a war and add it to the proprietary war file. Or i will write the jsp, java files and add it to the same war. Can i make a new war...

How to repack an Java Web Archive (WAR) ?

I have a .war file of an application. It works, but I need to update some inner jars (only minor version changes) While I can operate on .war archives using the midnight commander, the files can't be executed anymore: java.lang.SecurityException: SHA1 digest error. I tried repacking it using the jar command, but I get it wrong: The arc...

How to configure multiple log4j for different wars in a single EAR?

I have a EAR with structures like: APP.ear - APP1.war - WEB-INF/classes/log4j.properties - APP2.war - WEB-INF/classes/log4j.properties - app1-ejb.jar - app2-ejb.jar - log4j.jar - spring.jar - commons-lang.jar (...and other jar) I want each WAR to have their own application log. But it seems the above configuration does not wo...

How do I access the root of a WAR?

I need to determine if an image exists in a JSP tag so I can display a default if it doesn't exist. What is the best way to access the War root so that I can check to see if the image exists? Or is there a better solution? ...

GWT 1.6 project war layout- mixing source code & compiler-generated artifacts?

Having just wrapped up a GWT-1.5 based project, I'm taking a look at what we'll have to do to migrate to 1.6. I'm very surprised to see that GWT seems to want to write its compiled output to the war directory, where you would normally have items under source control. What's the reason behind this? Did Google really think this was a go...