ObjectDB ObjectDB

Eclipse/JPA database tutorial

#1

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.

edit
delete
#2

Please help ASAP. Thank you.

edit
delete
#3

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
edit
delete
#4

Thanks for the response.

Its the web tutorial.

I have attached the screenshot.

Thank you.

 

edit
delete
#5

This URL is not expected to be valid.

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

ObjectDB Support
edit
delete
#6

Is it a problem with Tomcat by any chance?

I have uploaded the project.

Its eclipse juno.

Thank you.

edit
delete
#7

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
edit
delete
#8

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.

edit
delete
#9

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
edit
delete

Reply

To post on this website please sign in.