Adding Servlet to j2ee directory

Hello,
I'm trying to add a servlet to the j2ee\home\default-web-app\WEB-INF\classes directory but after I restart SOA Suite, I get a 404 error servlet not found. I've updated the web.xml file to include the new servlet with the following line, but it still gives me the 404. Is there another location or different steps I need to take to get the Servlet recognized? I can add a JSP file fine.
<servlet>
<servlet-name>HttpAccept</servlet-name>
<servlet-class>HttpAccept</servlet-class>
</servlet>
thanks

It is not the solution but maybe will help you
New servlet is actually the same as new adapter, you should find out how to add a new adapters to the server and do the same.
Apparently It is nor enough to modify the web.xml file, probably you have to define the connection factory as well (oc4j-ra.xml file) and maybe something else.

Similar Messages

  • Cannot find javax.servlet in J2EE

    I am learning about servlet programming. I am using JBuilder-student edition. I downloaded J2EE. I changed the project properties in JBuilder to use the java.exe in J2EE, but when I try importing javax.servlet or the like, it does not show that javax has such a package. Please help. I am working on this project with a professor, and I have to show some work done soon! I cannot get started with my work unless I get javax.servlet.
    I hope somebody can help me.
    Thank you,

    It seemed that the installation did not unzip the j2ee.WAR, which contains the servlet stuff.(or is it not supposed to?) I then added the folder j2ee to the class path, and it works. I am dumb enough not to understand how it worked, could someone explain please.
    Thank you

  • How to execute servlets in j2ee server

    please help me out in running servlets in j2ee server.
    i dont know where to put my servlets class files.

    please help me out in running servlets in j2ee
    server.
    i dont know where to put my servlets class files.In your j2ee server, look for your virtual host directory (webapps, deploys...information may be found in a \conf\ directory )
    Your application have to respect the hierarchy :
    /WEB-INF/web.xml --> The Web Application Deployment Descriptor
    /WEB-INF/classes/ --> put any java class (servlet or non-servlet)
    /WEB-INF/lib/ --> put jar file (external ressource)
    *.jsp;*.html ...
    /subdir/*.jsp;*.html...
    put this hierarchy in your web apps directory
    note : You can packed the hierarchy in a WAR file(Web ARchive)
    a web.xml example :
    <web-app>
    <servlet>
    <servlet-name>
    myservlet
    </servlet-name>
    <servlet-class>
    MyFirstServlet <!-- (your servlet's class)-->
    </servlet-class>
    <servlet-mapping>
    <servlet-name>
    myservlet
    </servlet-name>
    <url-pattern>
    /myservleturl <!--(URL to call servlet) -->
    </url-pattern>
    </servlet-mapping>
    </web-app>

  • Running a servlet in J2EE server

    Hi there! I'm sorry if I have placed the query in a wrong place, can anybody help me where can I get some step by step process of deploying a servlet in J2EE server, please help me, and your kind help will be appreciated, regards, shabeer

    hi thanks for your response Mr meadandale, well the server is Sun's J2EE1.4 server. regards

  • How to run servlet in J2EE

    Hi I am evaluating J2EE. I am wondering if it is possible to run Servlets on J2EE that works just like under servlets 2.2, i.e.: I can use:
    http://servername/servlet/HelloWorldServlet
    without add any servlet mappings into the web.xml file.
    Or is there a tool that can automatically generate the web.xml file?
    Any help is appreciated. Thanks.

    You can use the J2EE deploytool to generate the web.xml file. Deploytool is a GUI app that lets you specify the context and alias for the servlet, along with many other parameters.
    There is some documentation at
    http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Client4.html#11442

  • Scripts for adding/deleting/modifying Open Directory accounts?

    I think I have searched high and low for an answer to this question, but if I missed it please point me in the right direction. Where can I find information on scripts for adding/deleting/modifying open directory accounts? At the very least, a command line utility with some syntax guidelines! Any help would be greatly appreciated.

    Hi
    I personally don't know if any scripts although you can use the command line to do pretty much anything you want with the Open Directory. Consult the manual: man dscl. If you launch terminal and issue dscl you should see something like this:
    my-Laptop:~ me$ dscl
    dscl (v20.4)
    usage: dscl [options] [<datasource> [<command>]]
    datasource:
    localhost (default) or
    <hostname> (requires DS proxy support, >= DS-158) or
    <nodename> (Directory Service style node name) or
    <domainname> (NetInfo style domain name)
    options:
    -u <user> authenticate as user (required when using DS Proxy)
    -P <password> authentication password
    -p prompt for password
    -raw don't strip off prefix from DS constants
    -url print record attribute values in URL-style encoding
    -q quiet - no interactive prompt
    commands:
    -read <path> [<key>...]
    -create <record path> [<key> [<val>...]]
    -delete <path> [<key> [<val>...]]
    -list <path> [<key>]
    -append <record path> <key> <val>...
    -merge <record path> <key> <val>...
    -change <record path> <key> <old value> <new value>
    -changei <record path> <key> <value index> <new value>
    -search <path> <key> <val>
    -auth [<user> [<password>]]
    -authonly [<user> [<password>]]
    -passwd <user path> [<new password> | <old password> <new password>]
    Entering interactive mode...
    The above is for 10.4 and should server equally as well for 10.5.
    Hope this helps, Tony

  • Is there any alternative for adding servlet name in Web.xml?

    Hi,
    I am new to Weblogic and I have an application(Ear file) which was developed
    in Websphere and I am trying to install in weblogic 8.1. I have installed my application
    in Websphere without adding servlet entries in Web.xml and it was working fine.
    I have installed the same Ear file in Tomcat and added the
    following to make all my all servlets work.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    Is there any alternative of doing like that in WebLogic instead of adding each
    and every servlet entry in web.xml because my application has around 200 servlets
    Thanks&Regards,
    Gopi.

    Is Servlet servlet same as weblogic.servlet.ServletServlet?
    Deepak
    Rob Woollen <[email protected]> wrote:
    Yes, you could register weblogic.servlet.ServletServlet.
    -- Rob
    Gopi Krishna wrote:
    Hi,
    I am new to Weblogic and I have an application(Ear file) whichwas developed
    in Websphere and I am trying to install in weblogic 8.1. I have installedmy application
    in Websphere without adding servlet entries in Web.xml and it was workingfine.
    I have installed the same Ear file in Tomcat and added the
    following to make all my all servlets work.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    Is there any alternative of doing like that in WebLogic instead ofadding each
    and every servlet entry in web.xml because my application has around200 servlets
    Thanks&Regards,
    Gopi.

  • When building an application unit tests are added to a support directory

    Why are unit tests (.lvtest files) added to a support directory when building an application? I cannot find a way to exclude them from the support directory.

    I'd imagine this is happening to you because they are in the "Dependencies" section of your project file (*.lvproj). Is this correct?
    If so, you should add them to your project file somewhere. Then you will be able to prevent them from being installed. In my experience LabVIEW grabs files it thinks are nesecary from the Dependencies list and installs them in a support directory. 

  • Can't find the J2EE directory on Oracle 9iAS version 1.0.2.2.x

    Hi,
    I'm trying to set the JDBC Data Source. According to the documentation I need to go to the J2EE directory. I can't find this directory on Oracle 9iAS version 1.0.2.2.x. We can't upgrade so I don't know how to proceed.
    Your feedback is appreciated.
    Thanks,
    Merced

    Hi!
    I'm not 100% sure but I believe that in the 1.0.2.x release there was no J2EE structure in the application server. Things were done then with JServ.
    I understand that you cannot upgrade but be aware that 1.0.2.x is ancient (like stone-age) and Oracle desupported this long ago.
    cu
    Andreas

  • Adding servlet entry in web.xml of j2ee engine

    Hi ,
    I want a servlet to be loaded on startup of the j2ee engine SAP WAS which is basically flex based (MessageBrokerServlet). 
    The init param for the servlet is not accessible or cannot be initialized in init method of the servlet using the servletconfig object.
    This is when the servlet is used as a portal component of type servlet.
    So as to load the servlet and the servlet being able to access the init param i would be changing the web.xml of the sap j2ee engine (NW CE 7.1). are there any other effects of the same or is it fine if i just add this param in the web.xml
        <servlet>
            <servlet-name>MessageBrokerServlet</servlet-name>
            <display-name>MessageBrokerServlet</display-name>
            <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
            <init-param>
                <param-name>services.configuration.file</param-name>
                <param-value>/WEB-INF/flex/services-config.xml</param-value>
           </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>

    Hi ,
    Vivek in case my servlet is part of the Portal Application as PortalComponent how do i define init parameters  that can be accessed in the servlet.
    The config file would be accessed in the init method of the servlet how do i do that when the servlet is added as PortalComponent in PortalApplication. The servlet config file needs to accessed in t he init method.
    The load on startup thing would be taken care of by setting parameter startup = true of application properties.
    Regards
    Srikumar V

  • Placing class files for servlets in j2ee

    i am new to java servlets. i recently installed j2ee v1.4 sdk. i have gotten my first file that imports packages to compile. i now need a path to place .class files and .jar files. everyone says web-inf/classes and web/lib. due to the directory structure paths are so long. can someone give me the right path in j2ee v1.4 (C:\Sun\Appserver) to place these .class files and .jar files. if there is anything else i need to do before i can run a servlet, please inform me. i just want to run this silly helloWorld servlet. any suggestions would be greatly appreciated.

    Hi rickjamesb_tch,
    What you have heard is correct - you need to place your class files in the WEB-INF's classes directory (or jar files in the lib directory).
    To give you a little background, J2EE servers use custom ClassLoaders (a set of Java Classes that actually load the class into the JVM). The top-level class loaders has classes that are accessible through the JVM (and are usually picked up from the classpath).
    The other class loaders load classes that are only accessible within a particular web (or enterprise) application. These classloaders pick classes from the WEB-INF directory. These classloaders also have the capability of dynamically re-loading classes (eg when you change your .jsp file). Finally, the classes loaded are only visible within the web-application so that they do not pollute the global namespace.
    Hope that helps.
    Of course, the J2EE specification goes into a lot of depth about class loading, but unless you are designing an application server, you need not understand those details and specifics - just understanding where to place your classes is enough.

  • Running Servlet in J2EE server

    hello friends
    i am very new to servlet technology, i create the servlet java file and complied it and using j2ee application server (1.4) i deploy it and put the war file at autodeploy file but i cant run it ,how i can use j2ee server for running the servlet, and i also used apache-tomcat-5.5.12 but i cant see any class folder at ROOT/webinf please help me

    I m not familiar with the j2ee server...
    But a bit with Tomcat...
    The tomcat 5.5.X is bit hard to configure..
    I hope you have successfully configured the Tomcat in your PC..
    in that you have to create a directory in
    <your tomcat base directory>/webapps/<yourdirectory>
    in that <yourdirectory>/, you have to create a new folder WEB-INF into which your class file has to go..
    your web.xml file should be placed in <yourdirectory>/
    Doing this is a bit hard to understand..
    I recommend you to use the latest version of NetBeans IDE ..
    it will come with a bundeled Tomcat...you can simply run your servlet files and deploy them very easily with it..

  • Tomcat: How to run servlets in ROOT directory ?

    Hi,
    I am developing an app that has all JSP in ROOT directory.
    ROOT/appname/submodule/XXX.jsp
    How do I configure Tomcat so that I can place Servlets
    also in the same directory.
    (For better organization)
    i.e I would like to run as:
    http://host/appname/submodel/XXX.jsp
    and
    http://host/appname/submodule/YYY
    where YYY is the servlet YYY.class ??
    Is this doable ?

    Hi there,
    I am running into some trouble in configuring servlet directory other than the default /example/servlet/
    i am using tomcat3.2 with IIS as the webserver(NT 4.0).
    in the $tomcat_home/conf/server.xml, I added the following:
    <Context path="/myServletDir"
    docBase="E:/myServletDir"
    crossContext="false"
    debug="0"
    reloadable="true" >
    </Context>
    and i store my classes in
    E:/myServletDir/WEB-INF/classes/
    i even added a E:/myServletDir/WEB-INF/web.xml
    and tried to add something like this as suggested by some other people in tomcat forum:
    <servlet>
    <servlet-name>
    HelloWorldExample
    </servlet-name>
    <servlet-class>
    HelloWorldExample
    </servlet-class>
    </servlet>
    i stopped tomcat and restart, still can't make it work:
    http://myhost/myServletDir/servlet/HelloWorldExample
    or
    http://myhost/myServletDir/HelloWorldExample
    it would then tell me files not found. but if i put any classes in the examples/WEB-INF/classes, they would be just fine...
    what should I do? please help...
    thanks in advance,
    ann

  • Can't compile Servlets in J2EE 1.4 SDK 5.0

    Hi,
    I downloaded J2EE 1.4 SDK 2005Q2 UR2 which has J2SE 5.0 and has built in support for Java Servlet implementation. But when I try to complie a Servlet, compiler cribs javax.serlet.* package can't be found.
    Some solutions suggested on this forum direct one to include j2ee.jar or servlet.jar in the classpath. I have added j2ee.jar in the classpath but still the same thing happens. And there's no servlet.jar in this instalation.
    Any pointers???

    Hi,
    I downloaded J2EE 1.4 SDK 2005Q2 UR2 which has J2SE
    5.0 and has built in support for Java Servlet
    implementation. But when I try to complie a Servlet,
    compiler cribs javax.serlet.* package can't be
    found.You realize, of course, that you misspelled "servlet" - you left out the 'v'. Check your code.
    Some solutions suggested on this forum direct one to
    include j2ee.jar or servlet.jar in the classpath. I
    have added j2ee.jar in the classpath but still the
    same thing happens. And there's no servlet.jar in
    this instalation.Right. servlet.jar is for Tomcat 4.x and earlier; it's servlet-api.jar for Tomcat 5.x and later. J2EE reference app server uses j2ee.jar.
    Did you ever think to open the JAR and make sure that the package was inside? Might be worth doing instead of taking it on faith. If you can't find it, the class loader won't, either.
    Any pointers???See above. If that's not it, you think you have the JAR in your CLASSPATH but you don't. Don't argue with the compiler. Figure out what YOU did wrong.
    %

  • Running Servlet with J2EE Web Server

    Hi experts
    My web server is J2EE. I have compiled the servlet classes and have put them in the web-inf/classes directory. I have also declared the servlets in the web.xml file in the web-inf directory.
    When I run this, it gives error HTTP Status 404 - /fijidirectory.
    Experts can you help me with this pliz.
    Deepak

    Now the code looks like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>J2EE Servlet Config</display-name> 
      <servlet>
        <servlet-name>dirinterface</servlet-name>
        <servlet-class>DirectoriesInterface.DirInterface</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>dispplaydirinfo</servlet-name>
        <servlet-class>DirectoriesInterface.DispplayDirInfo</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>fijidirmain</servlet-name>
        <servlet-class>DirectoriesInterface.FijiDirMain</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>whitedirinterface</servlet-name>
        <servlet-class>DirectoriesInterface.whiteDirInterface</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>dirinterface</servlet-name>
        <url-pattern>/FijiDirectory</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>dispplaydirinfo</servlet-name>
        <url-pattern>/dirInfo</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>fijidirmain</servlet-name>
        <url-pattern>/fiiidirectory</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>whitedirinterface</servlet-name>
        <url-pattern>/whfd</url-pattern>
      </servlet-mapping>
    </web-app>
    The url that I am using to access the system is: http://localhost:8080/whfd

Maybe you are looking for