Post new topic   Reply to topic
Author Message
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

I am running into a problem with scaffolding a MySQL db. After successfully scaffolding the db I deploy the project and then start the Tomcat server. The server is reporting the errors listed below. The project shows no errors, also this was not a problem with 8.5. The problem always reproduces. I have also included the first part of the web.xml file. Any help on this would be greatly appreciated.


INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
Aug 10, 2010 4:31:01 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Work\workspace\.metadata\.me_tcat\webapps\collector\WEB-INF\lib\geronimo-servlet_2.5_spec-1.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Aug 10, 2010 4:31:01 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Work\workspace\.metadata\.me_tcat\webapps\collector\WEB-INF\lib\servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Aug 10, 2010 4:31:03 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:976)
at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:749)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:369)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1062)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4236)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 10, 2010 4:31:03 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/collector/WEB-INF/web.xml
java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2726)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2752)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1061)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:369)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1062)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4236)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 10, 2010 4:31:03 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Occurred at line 78 column 20
Aug 10, 2010 4:31:03 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
Aug 10, 2010 4:31:03 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Aug 10, 2010 4:31:03 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/collector] startup failed due to previous errors
Aug 10, 2010 4:31:04 PM org.apache.coyote.http11.Http11Protocol start



=================================================================================
web.xml: up to line 200
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<filter>
<description>
generated-persistence-filter</description>
<icon>
</icon>
<filter-name>MotorHeadFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
<init-param>
<param-name>entityManagerFactoryBeanName</param-name>
<param-value>MotorHead</param-value>
</init-param>
</filter>
<filter>
<description>
generated-sitemesh-filter</description>
<icon>
</icon>
<filter-name>Sitemesh Filter</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MotorHeadFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Sitemesh Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>

com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>
generated-servlet</description>
<servlet-name>collector Servlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:collector-generated-web-context.xml,classpath:collector-web-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>
generated-resources-servlet</description>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>
org.springframework.js.resource.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>
generated-servlet</description>
<servlet-name>WebFlow Servlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/config/collector-generated-webflow-config.xml,WEB-INF/config/collector-webflow-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/editMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/indexMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/confirmDeleteMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/saveMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/deleteMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/deleteMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/newMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/editMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/selectMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/newMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/confirmDeleteMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/deleteMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/saveMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/listMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/listMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/selectMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/editMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/deleteMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/listMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/confirmDeleteMhEvent</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/saveMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/newMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/selectMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/editMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/saveMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/confirmDeleteMhEventEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/selectMhEventMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/newMhEventErrors</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector Servlet</servlet-name>
<url-pattern>/newErrorsForce</url-pattern>
</servlet-mapping>
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

the section in the web.xml that is in question is

<servlet-mapping>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

It looks like there is a problem generating the web.xml for JAX-RS Rest. first the <servlet section for the JAX-RS Rest has an empty line and the servlet-mapping that should relate to the JAX-RS Rest is missing the <servlet-name section.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
hhogan
Registered Member
Registered Member
Joined: Apr 14, 2008
Posts: 104

Is the project created in 8.5 failing in 8.6, or is this a new project? Can you provide me the steps you are taking, from project creation through running it? I have some ideas, but I'm not seeing the issue, so precise steps would be very helpful.

Regards,
Heflin
 
 View user's profile Send private message  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

I can create the "Web Service Project" in 8.6 with Maven support and REST (JAX-rs), do a Scaffolding Spring CRUD->Database Schema against a mySQL db with all layers enabled, and Spring MVC + Spring WebFlow and iPhone web clients selected, spring 3.0. summary:
Data Types
Device
Errors
Eventinvitestatus
Force
Locationevent
MhEvent
MhUser

Application Layers and Packages
Web layer artifacts will be generated into package: com.ipei.traveler.collector.web
Service layer artifacts will be generated into package: com.ipei.traveler.collector.service
DAO layer artifacts will be generated into package: com.ipei.traveler.collector.dao
Domain layer artifacts will be generated into package: com.ipei.traveler.collector.domain


Then deploy to MyEclipse Tomcat

The web.xml file from these steps result in 2 issues as far as I can see:
1) from the web.xml there is an extra line inserted after the ,servlet-class and the com.sun.jersey.spi.container.servlet.ServletContainer. also there is an incorrect incorrect line terminator for both the empty line and the line containing the com.sun.jersey.spi.container.servlet.ServletContainer. they have only the LF and not the CRLF like all of the other lines in the web.xml file.
<servlet>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>

com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
2) there is no servlet-name section in the servlet-mapping
<servlet-mapping>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
===============================================================
If I correct these isues fixing the LF and adding a <servlet-name>JAX-RS REST Servlet</servlet-name>
section

I fail later in the Tomcat startup with :

Aug 11, 2010 11:17:11 AM com.sun.jersey.api.core.ClasspathResourceConfig init
INFO: Scanning for root resource and provider classes in the paths:
C:\Work\workspace\.metadata\.me_tcat\webapps\collector\WEB-INF\lib
C:\Work\workspace\.metadata\.me_tcat\webapps\collector\WEB-INF\classes
Aug 11, 2010 11:17:13 AM com.sun.jersey.server.impl.container.config.AnnotatedClassScanner indexJar
SEVERE: Exception while processing file, C:\Work\workspace\.metadata\.me_tcat\webapps\collector\WEB-INF\lib\icu4j-2.6.1.jar
java.lang.ArrayIndexOutOfBoundsException: 48188
at org.objectweb.asm.ClassReader.readClass(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.analyzeClassFile(AnnotatedClassScanner.java:326)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:288)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:277)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexDir(AnnotatedClassScanner.java:269)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.index(AnnotatedClassScanner.java:228)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:104)
at com.sun.jersey.api.core.ClasspathResourceConfig.init(ClasspathResourceConfig.java:131)
at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:103)
at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:85)
at com.sun.jersey.spi.container.servlet.WebComponent.getClassPathResourceConfig(WebComponent.java:515)
at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:322)
at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:488)
at com.sun.jersey.spi.container.servlet.ServletContainer$1.getDefaultResourceConfig(ServletContainer.java:461)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:546)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:521)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:167)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:281)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:442)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 11, 2010 11:17:16 AM com.sun.jersey.server.impl.application.WebApplicationImpl processRootResources
SEVERE: The ResourceConfig instance does not contain any root resource classes.
Aug 11, 2010 11:17:16 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:753)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:625)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:414)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:377)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:242)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:449)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:169)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:281)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:442)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 11, 2010 11:17:16 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /collector threw load() exception
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:753)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:625)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:414)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:377)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:242)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:449)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:169)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:281)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:442)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 11, 2010 11:17:16 AM org.apache.catalina.core.ApplicationContext log

It should be noted that I did not do a "New Web Service" to create a REST Service if I do I still get the same problem.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

After doing the project creation step by step it is the CRUD scaffolding that is corrupting the REST entries.
steps taken to reproduce
1) create a web service project enabling the REST
examine and preserve a copy of the web.xml file: at this point the following is generated in the web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<display-name>JAX-RS REST Servlet</display-name>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
=================================================================
step 2) run the scaffolding wizard against this project and a MySQL db
examine and preserve the web.xml file: the file is now corrupt: the first 102 lines of the 1000+ lines in the web.xml

<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<filter>
<description>
generated-persistence-filter</description>
<icon>
</icon>
<filter-name>MotorHeadFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
<init-param>
<param-name>entityManagerFactoryBeanName</param-name>
<param-value>MotorHead</param-value>
</init-param>
</filter>
<filter>
<description>
generated-sitemesh-filter</description>
<icon>
</icon>
<filter-name>Sitemesh Filter</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MotorHeadFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Sitemesh Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>

com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>
generated-servlet</description>
<servlet-name>collector_xxx01 Servlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:collector_xxx01-generated-web-context.xml,classpath:collector_xxx01-web-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>
generated-resources-servlet</description>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>
org.springframework.js.resource.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>
generated-servlet</description>
<servlet-name>WebFlow Servlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/config/collector_xxx01-generated-webflow-config.xml,WEB-INF/config/collector_xxx01-webflow-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector_xxx01 Servlet</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector_xxx01 Servlet</servlet-name>
<url-pattern>/newMhUserDevice</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector_xxx01 Servlet</servlet-name>
<url-pattern>/newMhUser</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector_xxx01 Servlet</servlet-name>
<url-pattern>/listMhUserEventinvitestatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collector_xxx01 Servlet</servlet-name>
<url-pattern>/saveMhUserErrors</url-pattern>
</servlet-mapping>
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
hhogan
Registered Member
Registered Member
Joined: Apr 14, 2008
Posts: 104

Thanks! I've reproduced it here, and I'm writing up an issue for it. I did notice that if you scaffold the application before adding the REST JAX-RS stuff, the web.xml file doesn't get corrupted.

I really do appreciate you taking the time to detail this for us.

Regards,
Heflin
 
 View user's profile Send private message  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

I also discovered if I scaffolded first the web.xml looked better but the Tomcat server still has issues loading. I don't know yet if it is because I have not yet created the "New Web Service" to create a REST Service. I will try it out tonight and let you know. by the way here is the runtime error I get if I scaffold and then add REST capabilities and deploy an start the server:

INFO: Scanning for root resource and provider classes in the paths:
C:\Work\workspace\.metadata\.me_tcat\webapps\collector_xxx03\WEB-INF\lib
C:\Work\workspace\.metadata\.me_tcat\webapps\collector_xxx03\WEB-INF\classes
Aug 11, 2010 12:39:01 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.analyzeClassFile(AnnotatedClassScanner.java:326)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:288)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:277)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexDir(AnnotatedClassScanner.java:269)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.index(AnnotatedClassScanner.java:228)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:104)
at com.sun.jersey.api.core.ClasspathResourceConfig.init(ClasspathResourceConfig.java:131)
at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:103)
at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:85)
at com.sun.jersey.spi.container.servlet.WebComponent.getClassPathResourceConfig(WebComponent.java:515)
at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:322)
at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:488)
at com.sun.jersey.spi.container.servlet.ServletContainer$1.getDefaultResourceConfig(ServletContainer.java:461)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:546)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:521)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:167)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:281)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:442)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 11, 2010 12:39:01 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /collector_xxx03 threw load() exception
java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.analyzeClassFile(AnnotatedClassScanner.java:326)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:288)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:277)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.indexDir(AnnotatedClassScanner.java:269)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.index(AnnotatedClassScanner.java:228)
at com.sun.jersey.server.impl.container.config.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:104)
at com.sun.jersey.api.core.ClasspathResourceConfig.init(ClasspathResourceConfig.java:131)
at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:103)
at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:85)
at com.sun.jersey.spi.container.servlet.WebComponent.getClassPathResourceConfig(WebComponent.java:515)
at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:322)
at com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:488)
at com.sun.jersey.spi.container.servlet.ServletContainer$1.getDefaultResourceConfig(ServletContainer.java:461)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:546)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:521)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:167)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:281)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:442)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 11, 2010 12:39:01 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'collector_xxx03 Servlet'
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
hhogan
Registered Member
Registered Member
Joined: Apr 14, 2008
Posts: 104

I deployed both maven and non-maven applications that I ran scaffolding on first, them the "Add REST" option, and both ran without producing that error. From what I can tell, it looks like you have an asm library conflict of some sort, or an older asm jar. You may want to look at your pom file and local maven repo and see if anything pops up there.

Regards,
Heflin
 
 View user's profile Send private message  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

Heflin, when you did the scaffolding and then the REST service did you by chance try the "Test with REST Web Service Explorer" It seems to be failing with the following exception:
!ENTRY org.eclipse.ui 4 0 2010-08-16 12:38:33.066
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at com.genuitec.eclipse.ws.jaxws.WEBXMLFile.getJerseyServletPattern(WEBXMLFile.java:260)
at com.genuitec.eclipse.ws.action.TestRESTWSActionDelegate.run(TestRESTWSActionDelegate.java:39)
at com.genuitec.eclipse.core.ui.action.LicenseValidatingActionDelegate.runWithEvent(Unknown Source)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
=================================================================================================================
the web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">



<display-name>abc002</display-name>

<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


<filter>
<description>generated-persistence-filter</description>
<filter-name>MotorHeadFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
<init-param>
<param-name>entityManagerFactoryBeanName</param-name>
<param-value>MotorHead</param-value>
</init-param>
</filter>

<filter>
<description>generated-sitemesh-filter</description>
<filter-name>Sitemesh Filter</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>MotorHeadFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>Sitemesh Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<servlet>
<display-name>JAX-RS REST Servlet</display-name>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<description>generated-servlet</description>
<servlet-name>abc002 Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:abc002-generated-web-context.xml,classpath:abc002-web-context.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet>
<description>generated-resources-servlet</description>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/selectLocationevent</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/saveLocationevent</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/newLocationevent</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/editLocationevent</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/deleteLocationevent</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/indexLocationevent</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>abc002 Servlet</servlet-name>
<url-pattern>/confirmDeleteLocationevent</url-pattern>
</servlet-mapping>


<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
eddybell
Registered Member
Registered Member
Joined: Jun 10, 2010
Posts: 14

A little more information if I have 2 projects the REST tutorial and my Project both deployed and bring up the Test with REST Web Service Explorer and
change the URL to point to my application path rather than the RESTDemo path I can see my REST services. This implies that the tool (REST Explorer) startup has some issues.
A second issue is that in the startup the WAD URL is always http:localhost:8080/... It does not look at the port configuration for Tomcat which in my case is 8888. There should probably be a bug entered for this as well.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
All times are GMT - 6 Hours
Post new topic   Reply to topic
® 2014 - Genuitec, LLC.