280 words

Eclipse/JPA database tutorial

#1
2012-09-16 07:20

Hello Sir/Madam,

I followed all the steps correctly as given in the tutorial.

But when i run it , I'm getting an error saying, the resource not available.

Please help regarding the issue as soon as possible.

Thank you.

Sand
Sand's picture
Joined on 2012-09-16
User Post #1
#2
2012-09-16 07:25

Please help ASAP. Thank you.

Sand
Sand's picture
Joined on 2012-09-16
User Post #2
#3
2012-09-18 18:36

Please provide more details:

  • Is it the console tutorial? a web tutorial?
  • When exactly do you get the error message? Do you get any additional text in the error?
  • Can you post a screenshot that shows the error?

In addition, check if there are exceptions in the console or in the server log.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,260
#4
2012-09-19 11:29

Thanks for the response.

Its the web tutorial.

I have attached the screenshot.

Thank you.

 

Sand
Sand's picture
Joined on 2012-09-16
User Post #3
#5
2012-09-19 22:33

This URL is not expected to be valid.

Could you please upload the project? What version of Eclipse are you using?

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,263
#6
2012-09-20 06:33

Is it a problem with Tomcat by any chance?

I have uploaded the project.

Its eclipse juno.

Thank you.

Sand
Sand's picture
Joined on 2012-09-16
User Post #4
#7
2012-09-20 23:07

Apparently the tutorial requires some updates for Tomcat 7 with newer Eclipse versions:

  • Add an annotation to the GuestServlet class:
  • @WebServlet(name="guestbook", urlPatterns={"/GuestServlet"})
    public class GuestServlet extends HttpServlet {
  • Add an annotation to the GuestListener class:
  • @WebListener
    public class GuestListener implements ServletContextListener {

In addition, the guest.jsp file was located in WEB-INF. You should move it up to WebContent.

Then the application should work on url: http://localhost:8080/Guestbook/GuestServlet

A fixed project is also attached.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,266
#8
2014-04-12 18:40

Dear Friends

I have done everything as per tutorial except that i have added a field message in my Guest entity. Please also note that I am using jdk1.8 and tomcat8. Error Message gives me Status 500. Screen shot is also attached. Please suggest.

Waqas Azam Java Student Information Systems Specialist
a_o_waqas
a_o_waqas's picture
Joined on 2014-04-12
User Post #1
#9
2014-04-14 19:32

Maybe you ran the JSP as your main page rather than the servlet?

In this example the servlet sets the "guest" attribute and only then invokes the JSP. If the JSP is run directly the attribute is not set so you may have a NullPointerException.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,849

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel