Servlets in Jar files  in WLS 6.1 ?

Trying to port a WLS 5.1 servlet into 6.1 (an entirely different
          animal it appears)
          I have added an application to my config.xml file as below as well as
          trying to start it
          PasswordPolicy="wl_default_password_policy"
          Realm="wl_default_realm"/>
          <Application Deployed="true" Name="DefaultWebApp_cb2java"
          Path=".\config\PM\applications">
          <WebAppComponent Name="DefaultWebApp_cb2java"
          Targets="PCPNEARN"
          URI="DefaultWebApp_cb2java" WebServers="PCPNEARN"/>
          </Application>
          <StartupClass Arguments="servlet=ProMan"
          ClassName="weblogic.servlet.utils.ServletStartup"
          FailureIsFatal="true" Name="StartPMServlet1"
          Targets="PCPNEARN"/>
          Now my servlet is packaged in a JAR file under the lib directory of so
          when I assume that WLS will automatically pick this up from
          C:\Weblogic6.1\wlserver6.1\config\PM\applications\DefaultWebApp_cb2java\WEB-INF\lib
          directory ? ( as the lib directory is where the doc says it picks up
          jar files from )
          Now when I start WLS it cant find the servlet? Is that because I cant
          package it in a JAR as of WLS 6.1 and have to move the class files to
          the Classes directory instead ?
          Furthermore the Servlet itself references JavaBeans deployed in a
          totally different application. Can I also assume that if I have my
          Classpath correct these will get picked up ?
          

I would look here
http://e-docs.bea.com/wls/docs61/webapp/security.html#100365 for methods on
protecting web app resources.
"zhen Ni" <[email protected]> wrote in message
news:3c86d70c$[email protected]..
Hello:
I have some derectories and files on my web site,and only appointed usersstored in my database can access their special directories.how can i do?
thank u!

Similar Messages

  • Hot Deploy Servlet in JAR file problem

    I've been playing with hot deploying servlets in WLS 5.1. I have SP2
              installed. I have things working fine with individual servlet class files. I
              decided to try hot deploying with jar files.
              I created a servlet, added it to a jar file, and then added the jar file to
              the 'weblogic.http.servlet.classpath'. I then restarted the server. I
              started the console and was able to hot deploy the servlet. So far so good.
              My next test is what failed. I modified the servlet, and rebuilt the jar
              file. I went back to the console, selected the servlet and hit the redeploy
              button. I went back to the browser and hit refresh - nothing, still the old
              servlet.
              It appears that WLS isn't reloading the jar file and the updated servlet.
              Everything works with individual class files.
              Does anyone know how I can cause the reload of updated servlets embedded
              within a jar file?
              Weblogic group - If there is no way now, will support be added soon?
              Thanks,
              Rick
              

    Hi,
              If I use weblogic.servlet.ServletServlet to try just the servlet , It
              works correctly.But When I develop it in a web application , there is a lot
              of hypelink to this servlet,thus I can't use the relative path reference to
              that servlet.I try to set the name of weblogic.servlet.ServletServlet same
              as the webapp,It doesn't work,how do I solve this problem?
              Thank you
              Pan
              Subject: Re: Hot deploy Servlet in webapp
              > http://www.weblogic.com/docs51/classdocs/API_servlet.html#134798
              >
              > It even explains why you shouldn't use it in production environment.
              >
              > Dimitri
              

  • How to deploy jar file in WLS using ant script

    Hi,
    Im trying to deploy a jar file in weblogic 10.3 using ant script and am running into the below error.
    +[wldeploy] weblogic.management.DeploymentException: [J2EE:160177]The application at "/u01//RSJBObjects.jar" was not recognized as a valid application type. If this is an EAR file, please ensure the META-INF/application.xml exists. EJB-JARs should have a META-INF/ejb-jar.xml or corresponding annotations exist. If this is an exploded WAR, the name of directory must be end with ".war". RARs require a META-INF/ra.xml. A JMS deployment should be an XML file whose name ends with "-jms.xml". A JDBC deployment should be an XML file whose name ends with "-jdbc.xml". For other application types, please consult the WebLogic Server documentation.+
    When i try to deploy the same manually from the console, i get a warning stating that WLS thought this as a library and hence proceeding to deploy as a library. After this warning the deployment continues and completes.
    Problem is when i try to deploy using ant, it breaks at this point.
    Is there any means that we can deploy a jar to WLS using ant script. This has to be deployed as a library as other apps would be using this jar.
    Im unable to create a ear file for this single jar file.
    If there is any suggestion on can this be done, please share.
    Thanks,
    Vijay.

    Hi Sunil,
    Thanks for the reply, it worked.
    Another doubt on the same lines. Now that the jar has been deployed as a library in WLS, when i try to deploy a WAR which refers to this deployed jar library, im unable to. I run into and error stating that the library is inaccessible.
    I have to bounce the server and before doing that, i have to manually copy the library.jar from <WLS_domain>/servers/AdminServer/upload/ directory to <WLS_domain>/lib/ directory, once copied i then try to deploy the WAR, then the deployment goes fine.
    Is there any means that this deployed library jar be made available soon after deployment and also to avoid copying the file.
    Thanks,
    Vijay.

  • How to run servlet inside jar file

    Hi
    I have a problem on running a servlet class which resides in a jar file.
    At first, it runs if it is located in the root directory of jar file, but if I put in inside a sub directory, I wasn't able to run it. It seems that the servlet class was not found.
    Here's the contents of my jar file:(eg. application.jar)
    META-INF/
    META-INF/MANIFEST.MF
    Business/
    Business/Business.class
    TransferManager/
    TransferManager/Default.class
    TransferManager/Application.class
    DAL/
    DAL/XMLDocument.class
    DAL/ParameterCollection.class
    DAL/ConnectionReaper.class
    DAL/JDCConnectionPool.class
    DAL/JDCConnection.class
    DAL/JDCConnectionDriver.class
    DAL/DataAccess.class
    Presentation/
    Presentation/IPresentation.class
    Presentation/XslTransform.class
    When I deploy this jar in tomcat4.0 and try to run the Default.class
    in the TransferManager package, the server can not locate the class.
    But if I put it in the root directory of the jar it works.
    Is there any additional setting in tomcat for this? Anyone can give
    me an idea for this?
    Thanks in advance...

    If you want to put the compiled servlet into Business/Business.class, you need for it to be in the Business package. I.e. the first line of code should be "package Business;" It looks like your jar file is in the right place, since Tomcat is finding something in it. So put your servlets in the appropriate packages and they should run. Also, you would have to change the configuration to refer to "Business.Business.class" and so on.

  • Servlets in JAR File

              Hi all!
              How can I declare and execute a servlet from a JAR-file? I tried
              severel times with different parameters in the properties file
              and in the browser, but always was getting error 500. Standalone
              servlet class, properly declared, is executed without problems.
              Thanks in advance
              Boyko Trendafilov
              Smalltalk developer
              

    If it isn't a Web application, but a stand alone servlet, what do you do?
              We added the jar file to the classpath used to start the server and this
              worked, but we wondered if there was a better way.
              "Mark Spotswood" <[email protected]> wrote in message
              news:[email protected]..
              > For web applications, jar files should go in the WEB-INF/lib directory.
              > --
              > mark
              >
              > Boyko Trendafilov wrote:
              >
              > > Hi all!
              > > How can I declare and execute a servlet from a JAR-file? I tried
              > > severel times with different parameters in the properties file
              > > and in the browser, but always was getting error 500. Standalone
              > > servlet class, properly declared, is executed without problems.
              > > Thanks in advance
              > >
              > > Boyko Trendafilov
              > > Smalltalk developer
              >
              

  • Servlet-jsp.jar file

    Hi
    iam new to use jstl.i wrote on tag handler (java) class when i am compiling it is not identifying any of javax.jspexception ,java.jsp.tagext.
    please help me what are all the jar files i have to have in class path or at any place and from where can i download them. i searched for servlet-jsp.jar,servlet-api.jar but i could not find anywhere in java.sun.com.any help is greatly appreciated
    thanks

    hi thanks for the reply. iam using tomcat 5.0
    server. from where can i down load those jar files
    please let me know
    what jar files are needed if iam using tomcat 5.0 Like I said, Tomcat 5 uses Tomcat 5: servlet-api.jar jsp-api.jar. They will be in the server's classpath someplace. Look around were you installed TC. I am away from my machine at the moment so I can't say for sure, but it might be common/lib or shared/lib, something like that...
    and
    if weblogic 8.0Dunno. Look around the file structure.
    Thanks for the help

  • .jar file for wls client application

    Is there a .jar file include files when client app needs at runtime

    You need weblogic jar file and if its ejb client application you might need client
    file that can be produced by ejbc.
    S
    "Wei Li" <[email protected]> wrote:
    >
    Is there a .jar file include files when client app needs at runtime

  • Which jar file for the classpath ?

    At my office on my machine i have weblogic 8.1 and tomcat installed.
    weblogic have 2.3 version of servlet and
    tomcat have 2.4 version of servlet
    weblogic is for production purpose (development of servlet, jsp and ejb)
    and tomcat is for my own practice. (just for servlet and jsp)
    i have weblogic.jar as well as servlet-api.jar in my class path.
    now when i compile my servlets which jar file the compiler will use to create the classes.
    if the compiler chooses servlet-api.jar will my servlet run in weblogic
    else
    if the compiler chooses weblogic.jar will my servlet run in tomcat

    i have weblogic.jar as well as servlet-api.jar in my class path.What does this mean? Do you have a system CLASSPATH environment variable?
    Bad idea.
    now when i compile my servlets which jar file the
    compiler will use to create the classes.You should set CLASSPATH using the -classpath option on javac.exe.
    The compiler won't "choose" anything, because it has no idea how you'll deploy. It'll use the one that you tell it to. If you have just a system CLASSPATH it'll always use the first JAR that it finds with the packages it needs.
    You need to specify exactly what you want the compiler to use.
    In the case of servlet.jar it might not matter, because that's pretty standard. JSPs and EJBs are another story, however. If you change deployment, it's best to recompile and repackage the Web app.
    Learn Ant. It'll help you automate this.
    %

  • JAR file does not get uploaded to client for my SERVLET generated APPLET

    Some help please...
    I have a servlet that generates the HTML code that contains an APPLET. This APPLET needs a JAR file that is listed under its ARCHIVE property. The SERVLET is in a JAR file that is in the same directory as the other needed JAR file. If I create a static HTML with the output of the SERVLET it works fine. But if go through Weblogic the needed JAR file does not get uploaded to the client so I get a java.lang.NoClassDefFoundError:and my APPLET does not load.
    Q1: I am not sure what to put under the CODEBASE tag. I tried "." and I also tried "http://mymachine" but both did not work. I also tried without the CODEBASE tag. No luck. The SERVLET is bound to http://mymachine/servlet.
    Q2: Does anyone have any suggestions on how to do this? Is there a way to force the browser to upload a certain JAR file?
    Thanks...

    It works!!
    This is what I did:
    The jar file in question was the weblogic.jar. I tried putting it under the lib directory of my war file but I had problems because the weblogic.jar contains other war files inside so when I tried to deploy my war file it also tried to deploy the inner war files which for some reason did not work. So I tried removing the war files from the weblogic.jar and this time I had no problems deploying my war file but I still could not find the classes I needed. So I tried moving the weblogic.jar to the root dir of my war file and it worked!! Now the trick here was: I did not set the CODEBASE AND I had the ARCHIVE paramenter set in TWO places like below:
    <APPLET CODE = "marketmap.client.MarketMapApplet"
    ARCHIVE = "weblogic.jar"
    WIDTH = "657"
    HEIGHT = "382"
    ALIGN = "BOTTOM"
    ALT = "APPLET tag not recognized">
    </XMP>
    <PARAM NAME = CODE VALUE = "MyApplet" >
    <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME = "scriptable" VALUE="false">
    <PARAM NAME = ARCHIVE VALUE="weblogic.jar">
    </APPLET>
    Actually if you do not place a parameter named ARCHIVE (at the end) it wil NOT work. I tried with multiple jar files listed and it works great too.
    Anyway I figure I'd share. Thanks for the help too.
    Lastly for people who choose not to upload the jar files to clients, you should look at the bea documentation on applets. It lists a classpath servlet that allows you to provide classes to the clients without having to force them to download the jar file.

  • Use jar file for one servlet in one application (not global in classpath)

    I have a servlet application that needs a jar file to load with one particular servlet. If I put the classpath to the jar file in the jvm12.conf, the servlet loads fine. I can't run it like that, however, since I use another jar file by the same name in a different application. I would like to specify it only with the servlet that needs it. According to the online help file, it says more than one jar, zip, or class file can be specified in the servlet classpath, but that doesn't seem to be the case. We're running iPlanet 4.1. I've tried adding the classpath to the jar file after the classpath for the servlet itself (servlet.properties), but it gives the class not found error for that function. Is there a way to do this? Context.properties, maybe? I can't find any instructions on setting that up.

    You might have better luck asking this question on a web server forum. This is an application server forum and most people here are going to more experienced with iAS.
    David

  • What are the required jar files for servlets compilation?

    hello all,
    which jar files are required to compile a servlet class.I am using Tomcat 5.5 version and my deployment folder is in tomcat's webapps folder.
    already i have servlets-api,jar,but i got several errors while i compile my servlet program.
    do i need to set path and classpath also? if yes, tell me how?
    can any one help me.
    errors are-
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\sample\WEB-INF\classes>javac *.java
    GetData.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    GetData.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    GetData.java:6: cannot find symbol
    symbol: class HttpServlet
    public class GetData extends HttpServlet {
    ^
    GetData.java:8: cannot find symbol
    symbol : class HttpServletRequest
    location: class GetData
    public void doGet(HttpServletRequest request, HttpServletResponse response) thr
    ows ServletException, IOException{
    ^
    GetData.java:8: cannot find symbol
    symbol : class HttpServletResponse
    location: class GetData
    public void doGet(HttpServletRequest request, HttpServletResponse response) thr
    ows ServletException, IOException{
    ^
    GetData.java:8: cannot find symbol
    symbol : class ServletException
    location: class GetData
    public void doGet(HttpServletRequest request, HttpServletResponse response) thr
    ows ServletException, IOException{
    ^
    6 errors
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\sample\WEB-INF\classes>

    I think you did not set the path and the classpath...
    set the path to jdk bin folder
    set PATH=c:\program files\java\jdk1.x\bin;
    also set classpath to servlets-api.jar
    set CLASSPATH=C:\program files\ ..... \servlets-api.jar

  • Do I need to add to add a new jar file to the WLS ?

    I am new to java development and would like to know if I were to use a new jar
    file developed by another party in my EJB development, do I need to have this
    jar file available in WLS when I deploy the EJB to it ?
    I think this is not required but just need a confirmation.
    Thanks

    Hi,
    I take this to mean you are using java classes from the 3rd party jar in your
    EJB bean class. If that is the case, then you need the jar file in your classpath
    when you compile the EJB classes.
    Also, you will need the jar file to be in the classpath when the EJB is used.
    You can do this in a variety of ways. If the 3rd party jar is going to change
    infrequently, then you can put it in the system CLASSPATH in your startWebLogic
    script. Or you can add all the classes of the jar file in the root level of the
    EJB (Yuck!!).
    Perhaps the best answer is to create an enterprise application (EAR). Then you
    place the jar file in the root level of the EAR. In the META-INF\MANIFEST.MF
    file of the EJB place
    Class-Path: filename.jar
    Then when you build the .ear file use:
    jar -cvfm ..\commuterLog.jar META-INF\MANIFEST.MF *
    hope this helps,
    pat
    "John" <[email protected]> wrote:
    >
    I am new to java development and would like to know if I were to use
    a new jar
    file developed by another party in my EJB development, do I need to have
    this
    jar file available in WLS when I deploy the EJB to it ?
    I think this is not required but just need a confirmation.
    Thanks

  • How to get list of jar files loaded by servlet container.

    Hi,
    I need to display in my servlet program about the list of jar files loaded by servlet container. Does it vary for each servlet container or is it same. Where can I get those details.
    I need to write code to support tomcat 4x, iplanet 5.0 and websphere 6.0.
    Thanks & Regards,
    Nasrin.N

    For curious, here are output prints for all 3 methods:
    1) parsing system property
    2) tschodt
    3) overcast SystemClassLoader to URLClassLoader
    /home/espinosa/workspace/jboss_embedded_test1/target/test-classes
    /home/espinosa/workspace/jboss_embedded_test1/target/classes
    /opt/javalibs/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
    /opt/javalibs/javax/jms/jms/1.1/jms-1.1.jar
    /opt/javalibs/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
    package com.sun.org.apache.xerces.internal.impl.validation, Java Platform API Specification, version 1.6
    package com.thoughtworks.qdox.directorywalker
    package com.sun.org.apache.xerces.internal.parsers, Java Platform API Specification, version 1.6
    package java.util.jar, Java Platform API Specification, version 1.6
    package org.testng.internal.thread
    package com.sun.org.apache.xerces.internal.util, Java Platform API Specification, version 1.6
    package java.net, Java Platform API Specification, version 1.6
    package sun.reflect.misc, Java Platform API Specification, version 1.6
    package esp.ejb.samples1.test
    package sun.security.provider, Java Platform API Specification, version 1.
    file:/home/espinosa/workspace/jboss_embedded_test1/target/test-classes/
    file:/home/espinosa/workspace/jboss_embedded_test1/target/classes/
    file:/opt/javalibs/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
    file:/opt/javalibs/javax/jms/jms/1.1/jms-1.1.jar
    file:/opt/javalibs/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
    ...Interestingly, method 1 and 3 gives the same list, same order, same count, just format of item is a little bit different. The order is same as in Eclipse .classpath file.
    Method 2 (tschodt) give significantly more items! rougly 3x! Different order (somewhat random it seems to me). Some items contain extra information, like version and string "Java Platform API Specification".
    It prints not absolute paths but logical Java names.

  • Includere Jar file into servlet

    I developed a class called Compare and I put it in mypackage(it is the unique class in this package) than I created a jar file called myjar.jar in which there is mypackage.
    Now I have a servlet and I want to use the Compare class, How do it?
    Where do i put the jar file?
    I use Eclipse and tomcat 5.5.23
    Thank you

    Excese me I don't figure out !
    The class Compare is in the PoolClass.jar.
    PoolClass is in WEB-INF/lib
    In the servlet I import the class with import PoolClass.Compare code line:
    But Eclipse say " the import PoolCalss cannot be resolved"
    What does it wrong?
    Many Thanks
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import PoolClass.Compare;
    public class ServletA extends HttpServlet {....

  • Servlet jar file

    I am trying to compile a simple example servlet. It is looking for the javax.servlet.* and javax.servlet.http.* import classes.
    I discovered that I needed to add c:\j2sdkee1.2.1\lib\j2ee.jar to my classpath for this to compile. c:\j2sdkee1.2.1\lib would not work.
    My question is this: why do I need to explicitly name the jar file in my classpath? I compiled on another machine that only had c:\j2sdkee1.2.1\lib and it worked there without naming the jar file explicitly.
    Thanks,
    Denise

    Possibly the other machine had a copy of the jar file in its extensions directory.

Maybe you are looking for