Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Help deploying app-duke bookstore .WAR file

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys,

I have been working through the tutorial of building the Duke Bookstore app on the sun website:http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro3.html

I got the bookstore2app to run -displaying all the pages, using the cloudscape db etc. I fired up the j2ee server and deployed the app using the provided deployer tool.

I would like to move this app and deploy it using the Tomcat server. I copied over the .WAR file to the /webapps directory. When I restarted the tomcat server, the directory structure stucture for the app was created ok-
webapps/bookstore2.

When I try to access the app, I get the 404 error. I have tried different URLs and still cant get the start page to display. Any suggestions?

Thanks,
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the name of the directory that was created under webapps?
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dir is bookstore2

bookstore2- contains the .jsp files
...META-INF
...WEB-INF-contains web.xml
..classes
..cart
..database
..messages
..util
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what url are you using to access it?

Should be http://localhost:8080/bookstore2

It's case sensitive.
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used the following and other url's as well:
http://localhost:8080/bookstore2/
and get the 404 error. When the j2ee server is fired up, I used http://localhost:8000/bookstore2/enter and it worked fine.

Also, I am able to run other .jsp files in the webapps/root directory.

The web.xml for this app is:

<web-app>
<display-name>Bookstore2WAR</display-name>
<description>no description</description>
<servlet>
<servlet-name>cashier</servlet-name>
<display-name>cashier</display-name>
<description>no description</description>
<jsp-file>/cashier.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>banner</servlet-name>
<display-name>banner</display-name>
<description>no description</description>
<jsp-file>/banner.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>enter</servlet-name>
<display-name>enter</display-name>
<description>no description</description>
<jsp-file>/bookstore.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>receipt</servlet-name>
<display-name>receipt</display-name>
<description>no description</description>
<jsp-file>/receipt.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>showcart</servlet-name>
<display-name>showcart</display-name>
<description>no description</description>
<jsp-file>/showcart.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>catalog</servlet-name>
<display-name>catalog</display-name>
<description>no description</description>
<jsp-file>/catalog.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>bookdetails</servlet-name>
<display-name>bookdetails</display-name>
<description>no description</description>
<jsp-file>/bookdetails.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>cashier</servlet-name>
<url-pattern>/cashier</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>enter</servlet-name>
<url-pattern>/enter</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>receipt</servlet-name>
<url-pattern>/receipt</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>showcart</servlet-name>
<url-pattern>/showcart</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>catalog</servlet-name>
<url-pattern>/catalog</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>bookdetails</servlet-name>
<url-pattern>/bookdetails</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
</web-app>

[ April 26, 2005: Message edited by: tim mahoney ]
[ April 26, 2005: Message edited by: tim mahoney ]
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I don't think Tomcat is seeing /bookstore2. I placed a basic html, which works with other apps and I get the 404 error. The URL is http://localhost:8080/bookstore2/
Is there a master file or something that I need to modify? Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a welcome-file-list entry in your web.xml file so you can have a default page.
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just want to make sure this is right:
I have my J2EE_HOME =c:\j2sdkee1.3.1

The bookstore2 app works fine when I fire up the j2ee server under j2sdkee1.3.1/bin/j2ee.bat. When I close down this server and fire up the tomcat server, the app will not run.

Also,I did a search for welcome-file-list in my directory and didnt find any. I will keep banging at this. The index file does come up for other apps. I did put the welcome-list tag in my web.xml and the index page didnt load using url http://localhost:8000/bookstore2/

....
<?xml version="1.0" encoding="Cp1252"?>

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

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<display-name>Bookstore2WAR</display-name>
<description>no description</description>
<servlet>
<servlet-name>cashier</servlet-name>
<display-name>cashier</display-name>
<description>no description</description>
<jsp-file>/cashier.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>banner</servlet-name>
.....
....
If anyone has any ideas on how to get the application to run in tomcat, Please post. Thanks

[ April 26, 2005: Message edited by: tim mahoney ]
[ April 26, 2005: Message edited by: tim mahoney ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a 2.3 DTD, welcome-file-list needs to come AFTER the servlet mappings.
In 2.4, they've lifted the restriction on the order of elements in web.xml
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Tomcat are you using? Have you verified that Tomcat is up and running correctly by accessing the default Tomcat page:


Check the log file either thru the console or the catalina.out file to see if the bookstore2 war file was deployed without any problems.
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat version:
jakarta-tomcat-5.5.9

Yes, verified tomcat is running.

Did not have a file named catalina.out.

Keep in mind that I used the delployer tool in j2sdkee1.3.1 to create the app. I moved the .war file over to the tomcat dir.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can try running the war file on my machine if you like.
Check your private messages for an address to send it to.
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied the bookstore2 folder that was created in j2ee and placed in my webapps/. Started tomcat and got the following errors? Making some progress here. Any ideas on this?

exception

javax.servlet.ServletException: exception/BooksNotFoundException
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NoClassDefFoundError: exception/BooksNotFoundException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
java.lang.Class.getConstructor0(Class.java:1930)
java.lang.Class.getConstructor(Class.java:1027)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1218)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The type database.BookDBEJB cannot be resolved. It is indirectly referenced from required .class files



Is this an ejb app?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The implementation of the database helper object follows. The bean has two instance variables: the current book and a reference to the database enterprise bean.



Tomcat is not an EJB container.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBoss is an open source EJB container that uses Tomcat as it's servlet/jsp engine.
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the problem. Thanks Ben and everyone else that helped. I will look into JBOSS.
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic