facebook

Creating Web Service Project is failing

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #319909 Reply

    Greg Soulsby
    Member

    I am creating a new Web Service Project, CRUD scaffolding in the usual way, selecting the make REST-ful services along the way.

    Then when I “Run As MyEclipse Server Application” I am getting the following error about not finding classes.

    Can you advise?

    Thanks

    2011-09-24 17:56:57,895 INFO [main] SessionFactoryImpl – building session factory
    2011-09-24 17:56:58,114 INFO [main] SessionFactoryObjectFactory – Not binding factory to JNDI, no JNDI name configured
    No properties path set – looking for transactions.properties in classpath…
    transactions.properties not found – looking for jta.properties in classpath…
    Using init file: /home/innovative/Workspaces005/.metadata/.me_tcat/webapps/BRO003/WEB-INF/classes/jta.properties
    /atomikos-sw-tmp/ could not be created – using default
    /atomikos-sw-tmp/ could not be created – using default
    24-Sep-2011 17:56:58 org.apache.catalina.core.ApplicationContext log
    INFO: Marking servlet JAX-RS REST Servlet as unavailable
    24-Sep-2011 17:56:58 org.apache.catalina.core.ApplicationContext log
    SEVERE: Error loading WebappClassLoader
    delegate: false
    repositories:
    /WEB-INF/classes/
    ———-> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@353c375
    com.sun.jersey.spi.container.servlet.ServletContainer
    java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)

    #319938 Reply

    jkennedy
    Member

    When you created the web services project, which options did you choose on that panel for the project creation.

    The WebServices project may have added its own version of the JAX-RS libraries that may vary from the versions being used by the scaffolding wizard.

    Generally, the easiest way to get a scaffold web services project is just to create a standard web project and then run the scaffolding wizard, letting it configure the classpath.

    If you need a WebServices project specifically, and you want to scaffold into that project we may need to modify the classpath etc depending on your needs.

    Let me know if you require a Web Services project specifically and if so, which options you are selecting so that I can help to determine the conflicts you might see on the classpath.

    Thanks,
    Jack

    #319939 Reply

    Greg Soulsby
    Member

    Jack, thanks, let me review.

    Before I do that, can you tell me what a web services project has over a web project? Just in general.

    What I am trying to get to is a servlet that will provide rest back end responces to calls from the client facing servlet.

    Greg

    #320016 Reply

    jkennedy
    Member

    Sure,
    The Web Services project type offers the ability to add specific versions of libs that are often used when creating web services etc.

    There are a few wizards available in the Web Services project for creating Web Service from code and these wizards can be helpful, but in my experience, the basic web services wizard/project generally leave developers with a project that is partially configured and not immediately functional. There may be other capabilities for these projects but I am not aware of them.

    My recommendation would be to create a web project, run through scaffolding clicking checkbox to add rest support, and then take a look at the resulting code and configuration. The scaffolding wizard will take care of completely configuring your project to support Rest and Spring together, and will create the basic CRUD based Rest services for your data model.

    Once you run through the scaffolding you will see a package in your generated source folder that ends in .web.rest where you will have a Spring controller wired up for Rest based calls, as well as a Test class for each of your Data Types.

    Thanks,
    Jack

    #320350 Reply

    Greg Soulsby
    Member

    Thanks, I am now following your recommendation, working fine, so will forget the other options.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Creating Web Service Project is failing

You must be logged in to post in the forum log in