MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
P0rridge
Post subject: Creating Web Service Project is failing  PostPosted: Sep 24, 2011 - 06:08 PM
Registered Member
Registered Member


Joined: Jun 20, 2010
Posts: 143

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)
 
 View user's profile Send private message  
Reply with quote Back to top
jkennedy
Post subject:   PostPosted: Sep 26, 2011 - 01:31 PM



Joined: Jan 27, 2010
Posts: 245

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
 
 View user's profile Send private message  
Reply with quote Back to top
P0rridge
Post subject:   PostPosted: Sep 26, 2011 - 01:46 PM
Registered Member
Registered Member


Joined: Jun 20, 2010
Posts: 143

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
 
 View user's profile Send private message  
Reply with quote Back to top
jkennedy
Post subject:   PostPosted: Sep 28, 2011 - 02:03 PM



Joined: Jan 27, 2010
Posts: 245

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
 
 View user's profile Send private message  
Reply with quote Back to top
P0rridge
Post subject: No problem  PostPosted: Oct 10, 2011 - 03:05 PM
Registered Member
Registered Member


Joined: Jun 20, 2010
Posts: 143

Thanks, I am now following your recommendation, working fine, so will forget the other options.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits