Servlet and j2ee

Hi all,
I am using the standard j2ee server and running the example of bookstore1 given in the j2ee tutorial. I have successfully deployed the application which is basically a bunch of servlets. When I try to access the page in the browser by giving the machine address and port number, I get http error "the requested resource not found" with http status 404. Similarly in the j2ee server error output, I get the following message
ERROR reading java.io.ByteArrayInputStream@9b774e
At Line 111 /web-app/error-page/
Can anybody please tell me where I am going wrong. I have deployed following the steps as given in the tutorial.
Thanks,
deepak

The problem may be u have given the wrong path for the .ear file. Also check u'r database is running and the tables are created. In my case, the table was not created in the database, but the j2ee server never threw exception and never displayed the error page. After the tables were created, the application is workin fine.
cheers,
deepak
The solution to this query is posted as being use the
"Update and Deploy" option.
However when I choose "Update and Deploy" all I get is
a message stating that my .ear file is up to date.
Would appreciate if any other solutions are about as I
would like to resolve this error also.
cheers
steve

Similar Messages

  • JWSDP and J2EE Integration: Doesn't work. What's the point?

    My problems involve the integration of JWSDP and J2EE as described in these two documents:
    http://developer.java.sun.com/developer/technicalArticles/WebServices/wsj2ee/
    http://java.sun.com/j2ee/documentation/windows_guide.html
    It looks like a long one, but it�s really not that bad. All comments are appreciated.
    I�ve numbered each line-paragraph-section for easy reference later.
    (1) My ultimate goal is to setup a website that displays data from a database. I will use Java, Apache, Oracle, and whatever else I need to create a website that uses servlets, JavaServer Pages (JSP), and JDBC.
    (2) I�ve got four Pentium III computers:
    1. Windows 2000 Server to be the web server (MyWebServer, IP = 10.10.1.1).
    2. Windows 2000 Professional to be the database server (MyDatabaseServer, IP = 10.10.1.2).
    3. Windows 2000 Professional that I use to develop and test (MyDeveloperPC, IP = 10.10.1.3).
    4. Windows 2000 Professional that I use as a client to connect to the website (MyClientPC, IP = 10.10.1.4).
    (3) On MyWebServer I installed the following:
    Java 2 Standard Edition (J2SE)
    Java 2 Enterprise Edition (J2EE)
    Java Web Services Developer Pack (JWSDP)
    The JWSDP tutorial
    Apache HTTP Server
    (4) The files I downloaded and installed are as follows:
    j2sdk-1_4_0-rc-win.exe
    j2sdkee-1_3_1-win.exe
    jwsdp-1_0-ea1-win.exe
    jwsdp-1_0-ea1_01-tutorial.zip
    apache_1.3.23-win32-x86-no_src.exe
    (5) After installing these products, I set the environment variables as follows:
    JAVA_HOME = c:\j2se
    J2EE_HOME = c:\j2ee
    JWSDP_HOME = c:\jwsdp
    Path = c:\j2se\bin;c:\j2ee\bin;c:\jwsdp\bin; [and other previous statements]
    (6) I checked to see that Apache is running as a service. It is.
    On MyWebServer I start Tomcat and J2EE. Both start properly and are operating simultaneously.
    (7) From MyClientPC I open Internet Explorer and in the address box I type:
    http://10.10.1.1
    This displays the page c:\ApacheHTTP\apache\htdocs\index.html.en (The Apache default server installation page.)
    (8) I then enter this address in IE:
    http://10.10.1.1:8080
    This displays the page c:\jwsdp\webapps\root\index.html (The default JWSDP page).
    (9) I then enter this address in IE:
    http://10.10.1.1:8000
    This displays the page c:\j2ee\public_html\index.html (The J2EE 1.3 Default Home Page).
    (10) So far so good. Now I want to test JWSDP as a container for JSP pages.
    (11) I use ant to build the converter app found in the tutorial examples (in folder c:\jwsdp\�\tutorial\examples\gs). I then deploy the converter app to the c:\jwsdp\webapps\gs folder.
    (12) From MyClientPC I open Internet Explorer and in the address box I type:
    http://10.10.1.1:8080/gs
    The converter app works perfectly.
    (13) To eliminate the need to enter the port number, I create a link from the Apache default server installation page to the converter app. From MyClientPC and enter this address into IE:
    http://10.10.1.1
    I then click on the link to the converter app and it works perfectly.
    (14) Question: Is this the best way to display JSP pages without having to enter the port number?
    (15) Now it�s time to integrate JWSDP and J2EE as described in these two documents:
    http://developer.java.sun.com/developer/technicalArticles/WebServices/wsj2ee/
    http://java.sun.com/j2ee/documentation/windows_guide.html
    (16) After I complete this integration I cannot start both Tomcat and J2EE at the same time. This makes sense because they both share port 8080.
    I start Tomcat.
    (17) From MyClientPC and use Internet Explorer to test the various relevant addresses. Everything works the same as it did before except this one:
    http://10.10.1.1:8000
    The page cannot be displayed. The J2EE default home page is not displayed, which makes sense because the J2EE port is no longer 8000; it has been changed to 8080.
    (18) Now I shutdown Tomcat and start J2EE.
    From MyClientPC and use Internet Explorer to test the various relevant addresses:
    (19) http://10.10.1.1:8080
    Displays the JWSDP default home page.
    (20) http://10.10.1.1:8080/gs
    The page cannot be displayed. The converter app no longer works.
    (21) From MyWebServer and use Internet Explorer to test localhost:
    http://localhost:8080
    This displays the J2EE default home page.
    (22) Question: Why does localhost give me a different page than the IP address?
    (23) Question: What was the point of integrating JWSDP and J2EE?
    (24) I want to get the converter app working, so I create a .war file and attempt to add it to the J2EE deploytool (see the two integration documents listed above at section 15.) I create the .war file following the instructions in the JWSDP tutorial:
    http://java.sun.com/webservices/docs/ea1/tutorial/doc/WebApp3.html#64606
    (25) I change to the c:\jwsdp\�\tutorial\examples\gs\build folder.
    I then type:
    jar cvf converter.war .
    A .war file is created.
    (26) I open the deploytool: File, New, Application, and I name it �converter�.
    I attempt to add the .war file: File, Add to Application, Web WAR.
    (27) When I attempt to add the converter.war file I get this error:
    �converter.war does not appear to be a valid web JAR.�
    I tried a few different attempts, all with the same result. I�m stuck.
    (28) I ask again, What was the point of integrating JWSDP and J2EE?
    (29) If this is the preferred configuration, how do I display my JSP pages like the converter app?
    Please help!!!

    The JWSDP tutorial says to be in the �build� folder of the example when issuing the jar command to create the .war file. The build folder is created when I run the �ant build� command.
    Attempt 1 from the command prompt in folder c:\jwsdp\tutorial\examples\gs\build>
    I typed this command:
    jar cvf c:\jaxmservices\converter.war .
    In this case I directed the .war file to be placed in a different folder as you suggested. Here�s the output:
    added manifest
    adding: index.jsp(in = 921) (out= 525)(deflated 42%)
    adding: WEB-INF/(in = 0) (out= 0)(stored 0%)
    adding: WEB-INF/classes/(in = 0) (out= 0)(stored 0%)
    adding: WEB-INF/classes/Converter.class(in = 582) (out= 358)(deflated 38%)
    Didn�t work. Same error as before.
    Attempt 2 from the same folder:
    I typed this command as you suggested (I tried it with and without the final dot):
    jar tvf converter.war
    Here is the output:
    java.io.FileNotFoundException: converter.war (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:103)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at sun.tools.jar.Main.run(Main.java:185)
    at sun.tools.jar.Main.main(Main.java:904)
    I tried a few other variations on these attempts with no luck. I�m stuck.
    I�m attempting to create a .war file out of two files: index.jsp and converter.class.
    Now that I�ve integrated JWSDP and J2EE, is there some other way that I can run the converter app instead of a .war file and the deploytool? In other words, if I go back to using ant to build and deploy converter, where would I deploy it so that it will work with J2EE?
    By the way, it doesn�t have to be converter. I�d be happy if I could get any JSP page to work in J2EE after the integration.
    Forever grateful,
    Logan

  • 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

  • New in java server pages and j2ee

    hello, im new in jsp and servlet..im new in j2ee..
    my OS is Windows XP ..
    i dont know how to start learning...
    i installed J2EE development kit.. also.. i start the server from (Start Default Server)
    i dont know how to create jsp files. and java files..
    where to write the java code and where to write html code..
    also.. where should i save these files.. i mean.. in which directory?
    i want to know how can i start the servlet and JSP.. someone told me.. to put http://localhost:8080.. when i put this in the browser.. it works correctly..
    can anybody help me????

    http://java.sun.com/learning/training/index.html

  • Flex and J2EE

    I am using the Flex 3 SDK. On the server side, I am using
    Java.
    I looked at the Flex 3 SDK documentation and I found the Flex
    3 compiler modules for Apache and IIS:
    http://livedocs.adobe.com/flex/3/html/help.html?content=apache_1.html
    Is there a Java servlet filter that can compile MXML files on
    demand?
    Thanks in advance.

    I found the FlexMxmlServlet.
    1) visit
    http://opensource.adobe.com/wiki/display/flexsdk/Downloads
    2) download: FlexModule_j2ee.zip
    The zip file contains the FlexMxmlServlet and a Flex JSP Tag
    Library.
    Curiously, I can't find the source code for the
    FlexMxmlServlet or the Flex JSP Tag Library. I looked in Adobe's
    Subversion repository but the code is not there.
    Anyway, here is a web.xml file that shows how to use the
    servlet and the tag library:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD
    Web Application 2.3//EN" "
    http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Flex Webtier
    Compiler</display-name>
    <description>Flex SDK Webtier Compiler Template
    Application</description>
    <context-param>
    <param-name>flex.class.path</param-name>
    <param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
    </context-param>
    <servlet>
    <servlet-name>FlexMxmlServlet</servlet-name>
    <display-name>MXML Processor</display-name>
    <description>Servlet wrapper for the Mxml
    Compiler</description>
    <servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
    <init-param>
    <param-name>servlet.class</param-name>
    <param-value>flex.webtier.server.j2ee.MxmlServlet</param-value>
    </init-param>
    <init-param>
    <param-name>webtier.configuration.file</param-name>
    <param-value>/WEB-INF/flex/flex-webtier-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>FlexSwfServlet</servlet-name>
    <display-name>SWF Retriever</display-name>
    <servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
    <init-param>
    <param-name>servlet.class</param-name>
    <param-value>flex.webtier.server.j2ee.SwfServlet</param-value>
    </init-param>
    <!-- SwfServlet must be initialized after MxmlServlet
    -->
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>FlexForbiddenServlet</servlet-name>
    <display-name>Prevents access to *.as/*.swc
    files</display-name>
    <servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
    <init-param>
    <param-name>servlet.class</param-name>
    <param-value>flex.webtier.server.j2ee.ForbiddenServlet</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>FlexInternalServlet</servlet-name>
    <servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
    <init-param>
    <param-name>servlet.class</param-name>
    <param-value>flex.webtier.server.j2ee.filemanager.FileManagerServlet</param-value>
    </init-param>
    <load-on-startup>10</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>FlexMxmlServlet</servlet-name>
    <url-pattern>*.mxml</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>FlexSwfServlet</servlet-name>
    <url-pattern>*.swf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>FlexForbiddenServlet</servlet-name>
    <url-pattern>*.as</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>FlexForbiddenServlet</servlet-name>
    <url-pattern>*.swc</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>FlexInternalServlet</servlet-name>
    <url-pattern>/flex-internal/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>FlexTagLib</taglib-uri>
    <taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location>
    </taglib>
    </web-app>

  • Difference between J2SE and J2EE...

    Hi all. I was wondering what the difference between J2SE and J2EE were. I mean in the code structure. Are the packages the same, like Swing, IO, things like that. I'm a bit of a beginner in Java, only been messing around with it for about 6 months now kind of in my spare time, and I know I'm in now way ready for J2EE, but it's something I think I'd like to maybe look into. I know it's for Enterprise Applications, much bigger scale than I'm used to, but fundamentally, how is it different? Different coding conventions? New packages not in J2SE? I hope what I want is coming across okay. Thanks for all the input.
    James

    J2EE defines a large number of specifications, in addition to J2SE. Examples are the Servlet, JSP, JMS, and EJB specifications. Most of those specifications are designed to have implementations running inside an Application Server. There are free implementations available such as JBoss (combined with for example Tomcat), and I think youre best bet to learn is to download one of those and go from there. Servlets and JSP are a good beginning, and then maybe move on to EJB and the rest.
    Br - J

  • ABAP and J2EE-Stacks in SAP WEB AS

    Hi,
    I have two questions about the technical architecture of SAP WebAS, particularly about the ABAP- and J2EE-Server.
    Can someone recommend detailed papers/guides (besides help.sap.com)describing:
    1) the management of processes and resources in two parts (ABAP and Java)
    and
    2) The communication mechanisms between J2EE- and ABAP-server.
    What are the problems with JCo?
    Is there other possibilities to communicate between  2EE- and ABAP-server.(besides JCO), what is the performance in this case compares with JCO?
    Thank you!
    Peter Hneke

    Hi
    please have a look in to this Pdf Doc .   might be of soem help to you .
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b52456bd-0a01-0010-6d9b-f153bf15a82f
    Apart from JCO communication between JAVA and ABAP can also be handled using ESA services .
    please have a llok at these blogs
    /people/scott.campbell/blog/2005/05/16/the-esa-is-coming-the-esa-is-coming
    /people/kevin.liu/blog/2005/10/17/esa-soa-es
    /people/harsh.chauhan/blog/2005/08/27/building-esa-and-delivering-it-through-caf
    /people/sap.user72/blog/2005/10/28/the-fundamental-problem-solved-by-esa
    Hope this helps . pelase do not forget to reward points , if helpful
    regards
    rajeshkr

  • 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

  • Servlets and OC4J

    Hi!
    I need help. I'm working with OC4J 9.0.2.0.0a behind Apache. In my application a have to obtain data of DataBase and show it in a fdf. To do that i have done a class that obtains the data and a servlet that show it in a fdf using classes of Adobe. The Adobe jar's name is jFdfTk. The servlet runs ok at port 7777, but when i change to port 80 the fdf doesn't show data. I can't understand why.
    Does anyone have the same problem??
    Can anyone help me??
    Does anyone know why??
    Thanks!

    I see now that I can use the old method of JNDI
    lookup with the 3rd party messaging from a web
    container, I just can't use the java:comp/resource/MQSeries logical JNDI location.
    document: oracle 9ias Container for J2EE,
    Services Guide
    Release 2(9.0.3)
    Aug 2002
    Part No A97690-01
    Chapter 9 Page 9-2
    I am having trouble with this statement;
    The ResourceProvider interface enables you to plug in
    third-party message
    providers for JMS connections. For Oracle JMS, this
    allows EJBs, servlets, and OC4J
    clients to access many different queue
    implementations.
    (OK good so far,)
    With third-party message
    providers, only EJBS can access queue
    implementations. The resources are available
    under java:comp/resource/ as the default JMS
    resources.
    WHAT? I can't do asynchronous messaging from a web
    App to a MDB with a 3rd party JMS implementation?
    What gives?
    Can someone tell me this is not true please

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

  • JBuilder 8 and J2EE, what adjustments do I make?

    I have JBuilder 8 SE and I am trying to dabble in Servlets and eventually EJB. I was told that I need to add the location of the servlet.jar to my CLASSPATH environment variable to allow JBuilder to compile Servlets, is this correct and do I have to do anything else with evironmental variables to achieve full IDE functionality with J2EE?
    thanks,
    Rob

    it depends on what you mean by "full functionality"...
    Instead of using servlet.jar, use the j2ee.jar. This will allow you to compile any classes that make use of J2EE classes (ejb, servlet, jms, jca, etc.)
    However, your ejb/servlets will not run as they need a container to run in. Generally this container is implemented by an app-server. To actually deploy your code and have it work you'll need to use an app-server.
    A few app-servers are:
    Weblogic (www.bea.com)
    Websphere (www.ibm.com)
    JBoss (www.jboss.org)
    Tomcat (go to the j2ee tutorials on this site)
    You'll have to download, install, and configure an app-server. Then you'll have to deploy your code in the app-server (the steps vary significantly by app-server). Finally you'll be able to run your code.

  • Matrix for jdk version and j2ee version.

    Recently, I started working on web application.
    I downloaded eclipse etc and now i am totally confused b/w various j2ee + jdk versions.
    I want to develop application in jdk1.4, and j2ee v1.4
    So how j2ee 1.4 version is related jdk version? Eclipse is giving me so many options to select for version compatibility.
    Isn't j2ee api is based on jdk 1.4?
    Where i can find version matrix for servlet specs + ejb specs for j2ee v1.4?

    WSL 10.3.3: http://www.oracle.com/technetwork/middleware/downloads/index-087510.html
    Comes with its own JDK or download the newest here http://www.oracle.com/technetwork/java/javase/downloads/index.html
    Timo

  • Help needed on Servlets and JSTL

    Hi
    I am using tomcat 5.5 and JDK 1.5. What are the softwares I have to download for compiling servlets and creating JSTL ?. Help needed.
    Thanks
    IndyaRaja

    I tried compling servlet, but it is raising error
    that coul not find package javax.servletWhat I did not mention... you need to add those JARs in the Classpath explicitly. You will find them in %TOMCAT_HOME%\common\lib. You atleast need to add servlet-api.jar to your Classpath. :)

  • Difference between servlet and filter

    difference between servlet and filter

    Its not a secret you know; if you just read a little about what they are used for, you answer your own question plus many more to follow.
    Servlet: http://en.wikipedia.org/wiki/Java_Servlet
    Filter: http://www.oracle.com/technetwork/java/filters-137243.html

  • Difference between servlet and ActionServlet

    Difference between servlet and ActionServlet..
    Anybody reply

    jsf_VWP5.5.1 wrote:
    Difference between servlet and ActionServlet..
    Anybody replyAs their name imply, ActionServlets like outdoor activities, whereas Servlets are rather contemplative types.
    The only time Servlets exhibit behavior similar to ActionServlets, in under extremely stressful situations, like when a Servlet is being chased by a pit bull.

Maybe you are looking for

  • Open Directory won't start after crash no logins

    Server was crashed due to work in the room. OD will not start. I've tried every fix I can find, but the main problem is that this command will not work: sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist I also have time mac

  • Power Mac G5 duel 2.7 firmware / bootrom version 5.2.4f1 ?? is this latest?

    I was looking to see if Apple had updated the firmware version for my 2.7 because it has always been a little noisy. The fans kick up whenever you have the computer launch a big app like photoshop or garageband. It then winds down quickly and is pret

  • ITunes opens with error -42110 in Windows 8

    Have a variety of iTunes libraries. All those running on Windows 8 have an error -42110 on opening. Googling yields no help. Anyone? What causes error and what does it mean. And how is it fixed? TIA.

  • Push() and pop()

    I'm writing my own Stack class, in which I'm using a 100 element String array. I'm trying to write the push and pop methods for this class. I'm having trouble figuring out how to add an element to my array in the push method. Here is my code so far:

  • SUS Service Entry Sheet Proxy Class

    Hi All, PLease let me know the proxy class called for the service interface ServiceAcknowledgementERPCreateRequest_In. This interface is used to create Service Entry Sheet in MM from SRM SUS system. regards, Neeraj