JSP precompilation and my .java files compilation issues /  building WAR file using ANT

Hello.
I am new to working with WAR files and the whole process of it. A little
background on what we are using. We are using, WLS 6.1 SP3. I am using the
ant.bat that is supplied in the bin directory of the WLS install.
I am trying to work with ANT and getting it to build the file. I am making
progress, but at a point where I am having trouble getting my java code
files to compile using ant. I am having one issue and looking to do one
other item.
1) I would like to precompile the JSPs if possible prior to putting into the
WAR file. Not sure if this is done or not, but there was a utility when I
was working with ibm's app server that gave us the ability to do a batch
complile. Was thinking that maybe a similair concept is possibly here.
2) Having issue getting ant to compile code properly. In the compile
section of the build.xml file for ant, I tell it where the source files are,
and the destionation folder for the compiled class files. I then try to set
the classpath so that it finds the .jar files that are necessary for my
source files to complile. But, it won't find them. And not sure how come.
I may be going about this all wrong, but dont know. Here is the compile
section of the build.xml I am using:
<target name="compile" depends="prepare">
<javac srcdir="classes" destdir="${deploy.home}/WEB-INF/classes"
classpath="$(lib.home)"
debug="on" optimize="on" deprecation="off"/>
</target>
One note, I've tried many different items in the classpath line, which
don't work. if I do *.jar it fails at complie time, invalid argument. As
well as if I use *.* and so on. if I list the explicit file names, it still
doesn't seem to find them.
I was wondering if anyone could help, if you need anymore information let me
know, I can send the entire build.xml if necessary. I may be missing
items, seeing that this is my first try at using ANT.
Any help is appreciated and thanks in advance. Hopefully not sounding too
off the wall. Hopefully get some clarification and understanding.
Thank you.
Kevin.

Kevin Price wrote:
Hello.
I am new to working with WAR files and the whole process of it. A little
background on what we are using. We are using, WLS 6.1 SP3. I am using the
ant.bat that is supplied in the bin directory of the WLS install.
I am trying to work with ANT and getting it to build the file. I am making
progress, but at a point where I am having trouble getting my java code
files to compile using ant. I am having one issue and looking to do one
other item.
1) I would like to precompile the JSPs if possible prior to putting into the
WAR file. Not sure if this is done or not, but there was a utility when I
was working with ibm's app server that gave us the ability to do a batch
complile. Was thinking that maybe a similair concept is possibly here.you can use weblogic.jspc
http://e-docs.bea.com/wls/docs70/jsp/reference.html#57794
or just set the precompile flag in weblogic.xml
You can configure WebLogic Server to precompile your JSPs when a Web
Application is deployed or re-deployed or when WebLogic Server starts up
by setting the precompile parameter to true in the <jsp-descriptor>
element of the weblogic.xml deployment descriptor.
>
2) Having issue getting ant to compile code properly. In the compile
section of the build.xml file for ant, I tell it where the source files are,
and the destionation folder for the compiled class files. I then try to set
the classpath so that it finds the .jar files that are necessary for my
source files to complile. But, it won't find them. And not sure how come.
I may be going about this all wrong, but dont know. Here is the compile
section of the build.xml I am using:
<target name="compile" depends="prepare">
<javac srcdir="classes" destdir="${deploy.home}/WEB-INF/classes"
classpath="$(lib.home)"
debug="on" optimize="on" deprecation="off"/>
</target>
maybe because you are not using curly braces there on lib.home??
if you do it the way above, you would have to list all your jars
classpath="$(lib.home)\lib1.jar:$(lib.home)\lib2.jar"
or you can nest
<javac srcdir="classes" destdir="${deploy.home}/WEB-INF/classes"
debug="on" optimize="on" deprecation="off">
     <classpath>
          <fileset dir="${lib.home}" includes="*.jar" />
     </classpath>
</javac>
One note, I've tried many different items in the classpath line, which
don't work. if I do *.jar it fails at complie time, invalid argument. As
well as if I use *.* and so on. if I list the explicit file names, it still
doesn't seem to find them.
I was wondering if anyone could help, if you need anymore information let me
know, I can send the entire build.xml if necessary. I may be missing
items, seeing that this is my first try at using ANT.
Any help is appreciated and thanks in advance. Hopefully not sounding too
off the wall. Hopefully get some clarification and understanding.
Thank you.
Kevin.

Similar Messages

  • Classpath issue with .war files on iPlanet 6.0

    Hi there,
    I'm using iPlanet 6.0 Web Server (SP1, I think), and I have an issue.
    We deploy a .war file as per normal. We go to the URL, and get a 500 error. Checking the error file gives us the following error (the application name has been blanked out with #####, and the server's domain name with <server>, but the actual package names remain -- they are libraries from ESRI):
    [08/Jul/2003:13:27:20] info ( 2705): Internal Info: loading servlet /#####/index.jsp
    [08/Jul/2003:13:27:21] info ( 2705): JSP: JSP1x compiler threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP/opt/iplanet/servers/https-<server>/c
    onfig/../ClassCache/_jsps/_#####/_index_jsp.java:15: Package com.esri.aims.mtier.io not found in import.
    import com.esri.aims.mtier.io.*;
    ^
    /opt/iplanet/servers/https-<server>/config/../ClassCache/_jsps/_#####/_index_jsp.java:16: Class com
    .esri.aims.mtier.model.map.layer.FeatureLayer not found in import.
    import com.esri.aims.mtier.model.map.layer.FeatureLayer;
    ^
    /opt/iplanet/servers/https-<server>/config/../ClassCache/_jsps/_#####/_index_jsp.java:17: Class com
    .esri.aims.mtier.model.envelope.Envelope not found in import.
    import com.esri.aims.mtier.model.envelope.Envelope;
    ^
    /opt/iplanet/servers/https-<server>/config/../ClassCache/_jsps/_#####/_index_jsp.java:18: Class com
    .esri.aims.mtier.model.acetate.Point not found in import.
    import com.esri.aims.mtier.model.acetate.Point;
    ^
    /opt/iplanet/servers/https-<server>/config/../ClassCache/_jsps/_#####/_index_jsp.java:19: Class com
    .esri.aims.mtier.model.map.layer.query.Filter not found in import.
    import com.esri.aims.mtier.model.map.layer.query.Filter;
    ^
    /opt/iplanet/servers/https-<server>/config/../ClassCache/_jsps/_#####/_index_jsp.java:20: Class com
    .esri.aims.mtier.model.map.layer.renderer.symbol.SimpleMarkerSymbol not found in import.
    import com.esri.aims.mtier.model.map.layer.renderer.symbol.SimpleMarkerSymbol;
    ^
    /opt/iplanet/servers/https-<server>/config/../ClassCache/_jsps/_#####/_index_jsp.java:21: Class com
    .esri.aims.mtier.model.map.Map not found in import.
    import com.esri.aims.mtier.model.map.Map;
    ^
    7 errors
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
    at com.iplanet.server.http.servlet.NSServletEntity.load(NSServletEntity.java:252)
    at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:173)
    at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:416)
    [08/Jul/2003:13:27:21] warning ( 2705): Internal error: Failed to get GenericServlet. (uri=/#####/index.jsp,SCRIPT_NA
    ME=/#####/index.jsp)
    Hopefully that is readable -- basically, it can't find a bunch-o-classes. Now, normally, I would snicker, and say something smart about classpaths. However, I have already done this, and looked in all the places that I think should have these classes in (I shall just use the last eg, com.esri.aims.mtier.model.map.Map, rather than all of them):
    # find /home/websites/#####/ |grep com.esri.aims.mtier.model.map.Map
    /home/websites/#####/WEB-INF/classes/com/esri/aims/mtier/model/map/Map.class
    # jar tvf /home/websites/#####/WEB-INF/lib/arcims_jconnect.jar |grep com.esri.aims.mtier.model.map.Map
    33267 Wed Dec 04 15:50:14 GMT+09:30 2002 com/esri/aims/mtier/model/map/Map.class
    So, as you can see, the relevant files are in not just one, but two places that I had assumed were in the classpath. Judging from the error messages, they are not. Am I doing something wrong here?
    Here's some of the config...
    The relevant line from web-apps.xml:
    <web-app uri="/#####" dir="/export/home/websites/#####" enable="true"/>
    The classpath from jvm12.conf:
    jvm.classpath=/opt/iplanet/servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar
    That's all that I can find that is relevant. Please ask if there is anything else I can give you (apart from access to the server or the application -- I can't give that).
    Any ideas?

    The solution was to download the DTD file and change
    the URL to a file: link, so iPlanet could
    successfully use the DTD. Did you have to define the file link as an absolute path? Or where you able to use a relative link.? If so, can you please provide the full syntax?
    We faced a similar problem and after much trial and error ended up placing the DTD on the server in /usr. But we'd like to try and find a way to define a relative file path and put the DTD right in the WEB-INF directory (or somewhere similar) so that we have one less configuration hassle and platform/server independence (i.e. the war file has everything it needs). But we have not been able to determine a way of doing this.
    Thanks

  • Where do I put config files for a webapp (war file)?

    To my understanding a war file is supposed to be dropped in. It's isn't intended to be unzipped by the person installing the webapp. Inside my web app I have some xml files I access to get configuration information for how the servlet works. This xml file is intended to be edited by the sysadmin using the webapp. So, it's obvious I can't put my xml file inside my war file otherwise they'd have to unzip it to edit it. So my question is, where do I put it? What is the normal place to put stuff like this for a webapp?
    Example:
    I make a servlet (or jsp/custom tags) that generates an explorer-like directory tree. It reads the tree folders and files from an xml file. So one sysadmin might make a tree that looks like this:
    Fruit
    |-apples
    | |-Gala
    |-oranges
    |-pears
    another sysadmin might make a tree that looks like this:
    Bookstore
    |-Technical Books
    | |- JSP to go
    |-Children's Books
    |-Dr Seuss
    And these are defined in the xml file.
    It's driving me crazy because I want to make my webapp deployable in a war file. Since I have to unzip it right now, the war file is useless.
    Thanks,
    David

    I don't have the answer, but I understand your pain. I was trying to figure this out last year before my company went out of business and made this problem go away.
    The issue is that you want to have a user install your webapp by deploying the war file and configure the app without unzipping the war file. If you can start the webapp first, why not just put the default or empty configuration file somewhere in your webapp director structure and write an administration servlet or JSP to configure it.
    If you must configure the application before it can start up, the following might apply.
    The obvious approach would be to install a properties or xml file separately from the war file and let the user edit that file. The problem is that your servlets and jsps need to be able to find it at run time. This is problematic because the current directory for relative paths seems to vary from one server to another. If I remember correctly, on Windows NT running Tomcat, current directory points to C:\jakarta-tomcat-x.x.x\bin. When running Websphere, it points to C:\WINNT. You can figure this out for the server your user is going to be running and have them put the file in one of those places. But I don't like putting my application files in places like that.
    I can't remember at the moment how it works in other servers, but at least in Tomcat you might put the configuration file in the webapps directory with your war file. Then you could have your servlet do a getServletContext().getRealPath() or something like that and back up the path one level to get to the file.
    At one point I thought it would be nice to put the path to the configuration file in the system environment, but we couldn't find any way in Java to get access to it.
    Will.

  • Images and js files within a deployed war file are generating 404 errors.

    Greetings,
    I have an odd situation in that image files and js files that are part of a deployed war file are generating 404 (not found) errors when accessed via https but ARE found when accessed via http.
    Unfortunately we are required to use https.
    I have verified via jar -tf that the files are indeed part of the war file. So, it is not that they are missing as is evident when accessed via http. (they appear as expected)
    A work around is to create the sub directories under the document root, on the ohs, and populate the sub directories with the images and js files that were used as part of the war file build. While this works, it doesn't explain why they would generate a 404 error when referenced from within the war via https.
    The war file works correctly on our 10g installation.
    I also have a very simple deployed war file and it too seems to have an issue finding direcotries/files that are part of the war file when referenced via https but not http.
    We are using Oracle 11g OHS and using the WLS Admin Console to do the deploying. We also are using the OSSO for the performing the required authentication.
    I have an SR in with oracle and have been working with them but I thought I would post here too.
    Suggestions?
    Thanks in advance.
    Edited by: emmett on Jan 5, 2011 2:47 PM

    Don't crosspost. Continue here: http://forum.java.sun.com/thread.jspa?threadID=5251627

  • Pack java classes in to a war file

    i cant pack the java classes when i build my web project i works fine in localhost but when i tried to proved in my server the war file doesnt pack the java classes. How do i pack the classes???
    i tried in the properties to add the files in packing to add the files but i didnt work.
    how do i pack the java classes???

    Are we talking about deploying a war file here or creating one???
    If we are talking about deploying, it may very well be that auto deployment is turned off. In that case the server will have some kind of admin interface through which you can deploy your war file manually, this is server specific so I can't help you any further with it.

  • Problem reading a file from inside a war file

    Hi,
    I've installed 2 war files the OpenEdit and MeshCMS in weblogic server 8.1.5 but i've problems when i access to their pages.
    <3/Abr/2006 16H23m BST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: com.openedit.servlet.OpenEditFilter.java.lang.NullPointerException
    at java.io.File.<init>(Ljava/lang/String;)V(Unknown Source)
    at com.openedit.servlet.OpenEditFilter.init(Ljavax/servlet/FilterConfig;)V(OpenEditFilter.java:85)
    at weblogic.servlet.internal.WebAppServletContext$FilterInitAction.run()Ljava/lang/Object;(WebAppServletContext.java:7008)
    <3/Abr/2006 16H08m BST> <Error> <HTTP> <BEA-101020> <[ServletContext(id=13727982,name=meshcms,context-path=/meshcms)] Servlet failed with Exception java.lang.NullPointerException
    at java.io.File.<init>(Ljava/lang/String;)V(Unknown Source)
    at com.cromoteca.meshcms.WebApp.<init>(Ljavax/servlet/ServletContext;)V(WebApp.java:62)
    at com.cromoteca.meshcms.HitFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V(HitFilter.java:61)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(FilterChainImpl.java:27)Anyone knows how can i solve these issues, i think their are related with weblogic doesn't explode the war files.
    Thanks in advanced,
    rjc

    I think your guess is probably correct. FWIW, WLS 9.x does explode WAR files.
    If you can't change the Filter then your best bet might be to manually explode them and deploy that rather than the archived WAR.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • How To Access a jar file present outside the war file through a jnlp

    Aoa
    I m new to this forum
    I m having problem with my jnlp file
    i want to know is there any way to access a jar file through jnlp.The problem is that my jnlp file is present in the war file
    and i want to know how to acess a jar file through this jnlp.The scenerio is as below
    I m using ear file on jboss.Its hirerchy is as
    -PAN-war.war
    -launch.jnlp
    -PAN-app-client.jar
    my jnlp file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/" href="PAN/launch.jnlp">
    <information>
    <title>PanEmirates</title>
    <vendor>M Fazal Ur Rehman</vendor>
    <description>PanEmirates</description>
    <description kind="short">PanEmirates</description>
    <homepage href=""/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="PAN-app-client.jar" download="eager"/>
    <jar href="lib/javafxrt.jar" main="true" download="eager" />
    <jar href="lib/Filters.jar" download="eager"/>
    <jar href="lib/javafx-netbeans-fxuserlib.jar" download="eager"/>
    <jar href="lib/swing-layout-1.0.3.jar" download="eager"/>
    </resources>
    <application-desc main-class="net.java.javafx.FXShell">
    <argument>pan.Main</argument>
    </application-desc>
    </jnlp>
    when i run launch.jnlp file it says unable to download resource http://localhost:8080/PAN/PAN-app-client.jar
    how to access this jar file
    Any help or comment would be highly appreciated
    Regards
    M Fazal Ur Rehman

    Excellent question. I don't see any client-jar in your EAR file structure. So I am assuming you are writing a separate client application which will talk to the ejbs deployed as part of this EAR. You need to do the following:
    Write another EAR file with the following structure:
    ear:
    META-INF/application.xml
    util.jar
    client.jar
    client.jar should have a META-INF/MANIFEST.MF and that should contain Class-Path:util.jar and value for Main-Class attribute.
    Now deploy this new ear to your application server and execute it using Application Client Container that comes with your app server.
    If you don't want to write another EAR file, then bundle th client.jar in your original EAR file.
    Points to note are:
    you have to repackage util.jar again inside this ear file.
    For portability reason, you should use Class-Path manifest entry in client.jar. Refer to http://java.sun.com/j2ee/verified/packaging.html and J2EE platform spec section #8.2.
    Hope this helps,
    Sahoo

  • Building WAR files

    Is there a way not to include my local file(s), but only the ones that are already in CVS when building a WAR file. I'll try and explain this. I started adding a new feature to our current web app. I had to create a few new classes and JSPs on my local computer but I will not add them to CVS until I am completely done with the feature. So now when I have to fix a current bug and create a new WAR file, I don't want these local files to be included. Is there a way to do this? Maybe using Ant or something in those lines? Any suggestions?

    You could write an ant target called "buildFromCM" or something that will pull the source out of version control to another subdirectory and war from there rather than your normal source tree.
    Lee

  • EJB(EAR file) lookup from separate WAR file

    Hi
    I have 2 applications (EAR and WAR) deployed in an OC4J instance using Oracle 10g. All my EJB components are in my EAR file and all my front-end/servlet component are in the WAR file. My lookup in the servlet fails, like:
    05/01/21 13:47:05 javax.naming.NameNotFoundException: SessionEJB not found
    05/01/21 13:47:05 at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:149)
    05/01/21 13:47:05 at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:248)
    05/01/21 13:47:05 at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:119)
    05/01/21 13:47:05 at javax.naming.InitialContext.lookup(InitialContext.java:347)
    05/01/21 13:47:05 at efdw.eap.servlet.SessionEJBAction.execute(SessionEJBAction.java:48)
    05/01/21 13:47:05 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    05/01/21 13:47:05 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    05/01/21 13:47:05 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    05/01/21 13:47:05 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    05/01/21 13:47:05 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    05/01/21 13:47:05 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    05/01/21 13:47:05 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
    05/01/21 13:47:05 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    05/01/21 13:47:05 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    05/01/21 13:47:05 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
    05/01/21 13:47:05 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
    05/01/21 13:47:05 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    05/01/21 13:47:05 at java.lang.Thread.run(Thread.java:534)
    EJB reference in web.xml looks like:
    <ejb-ref>
    <ejb-ref-name>SessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.app.bean.SessionEJBHome</home>
    <remote>com.app.bean.SessionEJB</remote>
    </ejb-ref>
    I've added the "parent" attribute in server.xml, something like:
    <application name="myapp" path="../applications/myapp.ear" auto-start="true" />
    <application name="myweb" path="../applications/myweb.ear" auto-start="true" parent="myapp" />
    but the sever.xml file gets reset and there is no parent attribute in the file
    lookup in my servlet:
    Context ctx = new InitialContext();
    Object objref = ctx.lookup("SessionEJB");
    sessionEJBHome = (SessionEJBHome)PortableRemoteObject.narrow(objref, SessionEJBHome.class);
    beanRemote = sessionEJBHome.create();
    I also tried using the jndi.properties file and by specifying context attributes (PROVIDER_URL,INITIAL_CONTEXT_FACTORY,..) nothing worked.
    Is there a way I can configure the jndi tree like in weblogic? How do I need to configure the lookup?

    Hi Naga,
    You have to lookup the ejb as follows:
    Object objref = ctx.lookup("java:comp/env/ejb/SessionEJB");
    location tag in orion-ejb-jar.xml for the EJB determines where the JNDI-name to which this bean will be bound documented in EJB Guide at http://download-west.oracle.com/docs/cd/B14099_01/web.1012/b15505/dtdxml001.htm#sthref1130
    <ejb-ref-mapping ... > in orion-web.xml :
    This element creates a mapping between an EJB reference, defined in an <ejb-ref> element, and a JNDI location when deploying.
    The <ejb-ref> element can appear within the <web-app> element of orion-web.xml or web.xml and is used to declare a reference to an EJB.
    -Debu

  • Absolute file path in a war file

    Hi,
    I have a war file which I have deployed on a Weblogic 7 server.I have a startup servlet which tries to read an xml file located in the WEB-INF folder.I need to have the absolute path to the file so that my parser can read the xml file.
    ServletContext.getRealPath() returns null when the application is in a war format.
    Would be grateful for any help.
    regards
    Vikram

    I've been using the getRealPath() method from the
    ServletContext object to ..
    I'm suspicious of the fact that
    you are getting a null pointer when you use
    getRealPath().
    I have also been deploying my webapps to Tomcat using
    war files. So without knowing more I'm guessing you
    may have some sort of problem with your overall
    configuration here...Nothing to do with configuration. getRealPath() returns null if the .war file doesn't get unpacked. The Tomcat servlet engine unpacks the war files but weblogic apparently does not.
    So getRealPath() is not generic enough, as it depends on the servlet container used.
    Also, I would not recommend the suggestion to use the ProtectionDomain.getCodeSource() method (although it may work). ProtectionDomain is not intended for reading xml files, (wether inside the web-inf dir or not) but has to do with security. It is simply overkill in this case.
    The poster should be able to get the file with the class.getResource() method, get a java.net.URL obj out of it, then call URL.getPath() or getFile() (check the URL class for these methods ), get back a path string and call his parser.
    The other way would be to simply list that file in the web.xml as an init param :
    <context-param>
    <param-name>filename</param-name>
    <param-value>WEB-INF/file.xml</param-value>
    </context-param>and get it with
    getInitParameter("filename")

  • Build WAR file in NWDS 7.1

    Hi,
    How can we create a WAR file in NWDS 7.1? Please provide any inputs.
    With Regards,
    Ramesh G.

    Hi Ramesh,
    We canu2019t create in WAR file in Webdynpro JAVA Perspective in NWDS 7.1
    Only we can create the WAR file by using java application in JAVA Perspective in NWDS 7.1
    Please Refer to this Link. This is having how to create WAR File in JAVA Prespective:http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/503193d9-f586-2b10-4eb6-e8b46dc096db?quicklink=index&overridelayout=true
    How to create WAR file
    [Manual Development|http://help.sap.com/saphelp_nw04/helpdata/en/43/2eafd8d2f30d24e10000000a1553f7/plain.htm]    
    I hope this is helpfull for you,
    Regards
    Vijay

  • Renaming the files present inside a war file.

    Hi,
    I am using the java.util.zip API for reading a war file(a zip file).
    I wanted to know whether its possible to rename a particular file present in the zip using this API.
    Thanks in advance.

    You can't edit a ZIP file with the standard libraries.

  • "Java file" & "Jsp file" compilation issues in Eclipse

    Hi,
    Eclipse
    Question 1:
    I have set the value for preference->java->Installed JREs as : j2re1.4.2_07 not to jdk
    When I write a java file, its compiling, how? From where its using "javac" exe file for compilation.
    Question 2:
    Whereas in prefrence->Tomcat->JVMSettings -> JRE(drop down box) set value as j2re.1.4.2_07
    When I write a jsp file as follows
    index.jsp
    <html>
    <body>
    <%java.util.Date d = new java.util.Date();%>
    Todays date is <%= d.getDate()%> and this jsp page worked!
    </body>
    </html>
    when i try to save this file & strat tomcat I got exception as follows:
    Exception:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    Please clear my doubts.
    Thanks,
    Hari

    Try going into your TOMCAT_HOME/conf/web.xml and look for this section:
    <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
    <param-name>logVerbosityLevel</param-name>
    <param-value>WARNING</param-value>
    </init-param>
    <init-param>
    <param-name>fork</param-name>
    <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
    </servlet>
    Change the <param-value> for fork from false to true and see if that helps.
    Otherwise it's a problem with your JSP.

  • Java 6 Compiler issue with Windows 7

    Hi,
    Sorry for the newbie question. I am very new to Java and am currently reading Sams Teach Yourself Java 6 and am having a problem with the JDK 6 compiler. I wrote the beginner program "Hello Username" to test if the compiler is working and am getting the following configuration error when i go to compile it. 'javac' is not recognized as an internal or external command, operable program or batch file. I added the path C:\Program Files\Java\jdk1.6.0_01\bin to the PATH system variable as the book suggested but it did not change anything. What am I missing? The book was published in 2007 and does not include Windows 7. How can I fix this and get it running?
    Thanks for any help you can offer.
    Casey

    At first you have to sucessfully run the command
    java -versionin a DOS console. if the output is something like
    java version "1.6.0_15"
    Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
    Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)your problem is gone.
    Type in this console th command
    pathand there you have to find your path setting
    ...;C:\Program Files\Java\jdk1.6.0_01\bin;...In general you will have a environment setting JAVA_HOME=C:\Program Files\Java\jdk1.6.0_01 and the path has a
    ...;%JAVA_HOME%\bin;...

  • Capturing the output of a jsp page and save that output in a WORD .doc file

    Hi,
    This is Naveen. I got stuck up with a problem/doubt. URGENT ! URGENT !
    My doubt is how to capture the output of a jsp page(the content is dynamic generated) and save that output to a MS-Word doc file.
    I know that therez an option of using Servlets Filters, but this concept is supported by Servlet 2.3 spec. and not earlier. And we are working on previous spec. and our web-servers also supports the prev. version and not the 2.3 version.
    If incase, therez a third-party utility for free usage, suggestions are appreciated.
    Hope most of them came across this kind of functional requirement. If anyone of them succeeded in this, please express ur bitter experience if any, faced during the coding.
    Thanks in Advance for help.
    Naveen

    You can set the MIME content type as .doc and try to open the Page.
    res.setContentType("application/vnd.ms-excel"); to generate the Page output as Excel
    res.setContentType("application/vnd.ms-word"); to generate the Page output as MS Word doc
    Hope this helps..

Maybe you are looking for

  • URGENT Check this code for me please

    Dear whoeverthisreads, please read and see at the bottom my sourcecode, or whatever I could make of it until (even with help) I failed to see any solution. Please copy, paste and run to see if you can manage to adjust the program to make it work in t

  • How to alert user the Db is shutting down

    Hi all: Is there a way through forms such as using 'DBMS Alert' that will warn the users when the DB is being shut down. I need a proc or something that will warn the users on the system when the DB is being shut down. Does anyone have any suggestion

  • Regarding status of job

    Hi friends, we  are having some  rapidmart , one of the rapid mart job server shows red in color in data services management console Iam just gettinng confusion whether the job or data has been scheduled succesfully or not? or Job has already schedul

  • What does this keyboard shortcut mean?

    It's from Latex editor Texmaker and TexStudio. Tried Option + UpArrow, but it doesn't work.

  • Unable to merge two partitions

    I have my Macintosh HD partition, and a bunch of GB of free space, also partitioned. I am unable to merge the two together, there seems to be no drop down arrows to have them combine. Also, I cannot reformat the free space, so all I am left with is 3