java.lang.NoClassDefFoundError: org/hibernate/boot/MetadataBuilder - java

I have this strange error when deploying my application , but the jar needed is in my POM file !!!
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.4.Final</version>
</dependency>
Here the error:
Error creating bean with name 'entityManagerFactory' defined in class path resource [fr/telecom/configuration/HibernateConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/boot/MetadataBuilder
I even check the war and the jar is inside the war
Searching Ctrl + Shift + T I found:
org.hibernate.validator.internal.metadata.aggregated.MetaDataBuilder
and
org.hibernate.boot.MetadataBuilder

You are using the wrong version. org.hibernate.boot.MetadataBuilder is available in version 5:
$ jar tvf ~/.m2/repository/org/hibernate/hibernate-core/5.0.4.Final/hibernate-core-5.0.4.Final.jar | grep MetadataBuilder
3931 Wed Nov 18 12:22:14 CET 2015 org/hibernate/boot/MetadataBuilder.class
In version 4.3.6.Final, it's defined in another package:
$ jar tvf ~/.m2/repository/org/hibernate/hibernate-core/4.3.6.Final/hibernate-core-4.3.6.Final.jar | grep MetadataBuilder
672 Wed Jul 16 16:28:14 CEST 2014 org/hibernate/metamodel/MetadataBuilder.class

1) The head of you DTD in hibernate.config.xml must be the following:
`<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"classpath:/org/hibernate/hibernate-configuration-3.0.dtd">
`
2) if you have you hibernate.config.xml in /WEB-INF remove it and place in /src/main/resources;
3) Finally, you will have to ovewrite some lines in web.xml file where you invoke the hibernate to be as the following:
`<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:hibernate.cfg.xml
</param-value>
</context-param>`
I Hope it halps. Herman, Mozambique

Related

Problems accessing restful web service

To make some context, i asked this question last week with some problems configuring tomcat on my computer. Question.
Well, now, i have it set up. I run it from intellij and the local page for tomcat at localhost:8080/ shows up. But, in whatever other URL i try to navigate, it shows me the same message:
ERROR 404 - The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
I think i'm typing the URL wrong or something, but since i had so many problems setting it up (i still have some, because if i try to deploy a war exploded, not even the localhost:8080/ shows up), it might be some other thing i'm not seeing.
Here's my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>restTest</groupId>
<artifactId>RestTest</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.18.3</version>
</dependency>
</dependencies>
</project>
And my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>API</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>restTest</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>API</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
My resource class:
package restTest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
#Path("/hello")
public class HelloWorld {
#GET
#Produces(MediaType.TEXT_PLAIN)
public String getMessage() {
return "Hello world!";
}
}
My project structure:
And, i don't know if it's needed, but in the other question, it helped:
Using CATALINA_BASE: "C:\Users\vitor\.IntelliJIdea2018.2\system\tomcat\Tomcat_9_0_8_RestTest"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 9.0"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp"
Using JRE_HOME: "C:\Program Files\Java\jre1.8.0_191"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar"
I decided to ask another question because that one had a different intent, and i'm having different problems now (although some of the other one remains).
I tried this URLs:
localhost:8080/hello
localhost:8080/RestTest/hello
localhost:8080/restTest/hello
localhost:8080/restTest
But all of them gave me the same error. Am i ponting to the wrong URL, or is something wrong with my tomcat configuration? Like i said, when i try to deploy a war exploded, it shows a lot of errors mentioned in the last question.
Thanks!
Edit: the errors when i try to deploy a war exploded are:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
java.lang.NoClassDefFoundError: com/google/common/base/Function
java.lang.ClassNotFoundException: com.google.common.base.Function
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
javax.management.RuntimeOperationsException: Exception invoking method manageApp
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

Unresolved Webapp Library references while deploying ADF Application

I have following Versions for developing and Implementing ADF Application
Jdeveloper Studio Edition Version 11.1.2.4.0
Weblogic 10.3.6.0
ADF Run Time 11.1.1.9.0
Below is my Weblogic.xml Setting
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.1/weblogic-web-app.xsd" xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<context-root>FlashDB</context-root>
<library-ref>
<library-name>adf.oracle.domain.webapp</library-name>
</library-ref>
<library-ref>
<library-name>jstl</library-name>
<specification-version>1.2</specification-version>
</library-ref>
<library-ref>
<library-name>jsf</library-name>
<specification-version>2.0</specification-version>
<implementation-version>1.2</implementation-version>
<exact-match>false</exact-match>
</library-ref>
</weblogic-web-app>
When i am deploying ADF Application from Jdeveloper i got below error on Weblogic Console
<Dec 19, 2017 8:22:13 PM PKT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for applicati
on 'FlashDB_Project1_FlashDB'.>
<Dec 19, 2017 8:22:13 PM PKT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Failed to load webapp: 'FlashDB'
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:395)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:180)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:518)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
Truncated. see log file for complete stacktrace
Caused By: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext#54465674[app:F
lashDB_Project1_FlashDB module:FlashDB path:/FlashDB spec-version:2.5]", defined in weblogic.xml [Extension-Name: jsf, Specificati
on-Version: 2, exact-match: false]
at weblogic.servlet.internal.WebAppServletContext.processWebAppLibraries(WebAppServletContext.java:2750)
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:416)
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:494)
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
Truncated. see log file for complete stacktrace
Any Can help what exactly is wrong here
You are mixing the wrong runtime version of ADF with the version you developed.
Your JDeveloper version should match your ADF Runtime version - both should be 11.1.2.4 in your case.
Also 11.1.2.4 is quite old - better upgrade to 12c

Hibernate DTD not loading from the classpath, the jar is there, still getting FileNotFoundException

I am getting
Caused by:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Failed to import bean definitions from relative
location [hibernate.cfg.xml] Offending resource: ServletContext
resource [/WEB-INF/applicationContext.xml]; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from ServletContext resource
[/WEB-INF/hibernate.cfg.xml]; nested exception is
java.io.FileNotFoundException: class path resource
[org/hibernate/hibernate-configuration-3.0.dtd] cannot be opened
because it does not exist
this is the dependency I am using
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.5.Final</version>
</dependency>
hibernate.cfg.xml -
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration SYSTEM
"classpath://org/hibernate/hibernate-configuration-3.0.dtd">
importing hibernate file in spring using import-
<import resource="hibernate.cfg.xml"/>
Jar is there in the maven dependencies but still cannot load DTD
You don't need to import the hibernate.cfg.xml in the Spring application context.
So, instead of having:
<import resource="hibernate.cfg.xml"/>
You need to make sure the hibermate.cfg.xml is located somewhere in your jars.
If you're using Maven, just place it in the following path:
${project.home}/src/main/resources/hibernate.cfg.xml
This way, the hibernate.cfg.xml file will be included in the module jar during the build time.

Websphere 7 with JSF 2

I need to use JSF 2 for an application running under Websphere 7.0.0.13, I have followed this:
http://www.manorrock.com/online/wiki/app/page/edit.html
***It says:
Even though Websphere 7 does not formally support JSF 2.0 you can get it to work in a degraded mode. Follow the steps below to get it to work on your version of Websphere 7.
Upgrade to at least version 7.0.0.13
Ship the Mojarra JAR files in your WEB-INF/lib directory
Set the WAR classloader to PARENT_LAST
Set the EAR classloader to PARENT_LAST and APPLICATION
Note the degraded mode means you are NOT going to be able to use #Resource or any JPA annotations. If you think you need support for it contact your IBM representative.
Note it will process #PostConstruct and #PreDestroy.***
I did this, but I getting this error, in the log:
[8/30/13 22:51:32:702 CDT] 0000000c webapp E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
java.lang.LinkageError: loading constraint violation: loader "com/ibm/ws/classloader/CompoundClassLoader#31c031c" previously initiated loading for a different type with name "javax/servlet/ServletContext" defined by loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader#66656665"
at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:184)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:163)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1681)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:374)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:299)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100
And the error en my page:
Error 404: javax.servlet.UnavailableException: SRVE0201E: Servlet [javax.faces.webapp.FacesServlet]: not a servlet class
This is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 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">
<display-name>testJSF2</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
I accesed by:
..../testJSF2/index.faces
If I enter by:
..../testJSF2/index.jsp
get this in the page:
HTTP Error Code: 500
Error Message:
JSPG0049E: /index.jsp failed to compile :
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 48 : The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 100 : The method handlePageException(Exception) in the type PageContext is not applicable for the arguments (Throwable)
JSPG0091E: An error occurred at line: 20 in the file: /index.jsp
JSPG0093E: Generated servlet error from file: /index.jsp
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 119 : The method getELContext() is undefined for the type PageContext
JSPG0091E: An error occurred at line: 21 in the file: /index.jsp
JSPG0093E: Generated servlet error from file: /index.jsp
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 144 : The method getELContext() is undefined for the type PageContext
Root Cause:
com.ibm.ws.jsp.JspCoreException: JSPG0049E: /index.jsp failed to compile :
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 48 : The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 100 : The method handlePageException(Exception) in the type PageContext is not applicable for the arguments (Throwable)
JSPG0091E: An error occurred at line: 20 in the file: /index.jsp
JSPG0093E: Generated servlet error from file: /index.jsp
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 119 : The method getELContext() is undefined for the type PageContext
JSPG0091E: An error occurred at line: 21 in the file: /index.jsp
JSPG0093E: Generated servlet error from file: /index.jsp
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/wasccNode01/server4/testJSF2EAR/testJSF2.war/_index.java : 144 : The method getELContext() is undefined for the type PageContext
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:574)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:441)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:299)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:149)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
Thanks for you help.
For WebSphere 7, I've followed another article:
http://wasbehindtheglass.blogspot.co.uk/2011/11/myfaces-20-and-websphere-application.html
I've created shared library on WebSphere (name is not important, only content) with following jars:
manifest.jar
myfaces-api-2.0.7.jar
myfaces-impl-2.0.7.jar
commons-logging-1.1.1.jar
commons-digester-1.8.jar
commons-collections-3.2.jar
commons-codec-1.3.jar
commons-beanutils-1.8.3.jar
\IBM\SDP\runtimes\base_v7\optionalLibraries\IBM\JSFProviders\WebSphere-MyFaces20-annotation-provider.jar
You need to give absolute paths. WebSphere-MyFaces20-annotation-provider.jar should be in your WebSphere installation. manifest.jar is the jar containing only following META-INF/MANIFEST.MF:
Manifest-Version: 1.0
Extension-Name: org/apache/myfaces
Specification-Title: MyFaces 2.0.7 shared lib
Specification-Version: 1.0
Specification-Vendor: apache.org
Implementation-Version: 1.0
Final thing to be done is to modify your pom.xml to create the manifest entries referring the shared library:
<manifestEntries>
<Extension-List>myfaces</Extension-List>
<myfaces-Extension-Name>org/apache/myfaces</myfaces-Extension-Name>
<myfaces-Specification-Version>1.0</myfaces-Specification-Version>
</manifestEntries>
After the deploy, if both shared library and manifest are configured correctly, the binding is automatically created.
I'd guess you are not only providing the JSF classes, but a second instance / api as well.
Check if you have a servlet-api or something similar in your WEB-INF/lib folder.
As it cannot load the ServletContext you get the other follow-up errors. Probably even loading a simple jsp with no JSF in it fails.
I tried this, and it is working, just put here an alternative solution for future questions
this issue happen because we have add the servlet-api-2.5.jar in the project lib so when we remove it work .
so here the final Step to get this work
1- set the Parent last in the class loading policy for the application and module as well .
2- don't add the servlet-api-2.5 .jar to the porject lib
taked from here
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014541986
C:\apache-tomcat-8.0.3\webapps\kumar-app\WEB-INF\lib\servlet-api-2.3.jar
C:\apache-tomcat-8.0.3\lib\servlet-api.jar
I had above jar file version mismatch , i deleted the jar from C:\apache-tomcat-8.0.3\webapps\kumar-app\WEB-INF\lib\servlet-api-2.3.jar and my application worked properly.

JAX-RS exception with Tomcat

When starting the a servlet (from eclipse), I'm getting the following error:
It's tomcat 7 and the servlet is REST.
INFO: validateJarFile(C:\beezer\WebServerWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\BeezerServer\WEB-INF\lib\geronimo-j2ee_1.4_spec-1.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
448 [localhost-startStop-1] ERROR org.apache.wink.server.internal.servlet.RestServlet - com.test.AddressBookApplication<br />
java.lang.ClassNotFoundException: com.test.AddressBookApplication<br />
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)<br/>
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)<br/>
at java.lang.Class.forName0(Native Method)<br/>
at java.lang.Class.forName(Class.java:169)<br/>
at org.apache.wink.server.internal.servlet.RestServlet.getApplication(RestServlet.java:144)<br/>
at org.apache.wink.server.internal.servlet.RestServlet.createRequestProcessor(RestServlet.java:105)<br/>
at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:81)<br/>
at javax.servlet.GenericServlet.init(GenericServlet.java:160)<br/>
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)<br/>
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)<br/>
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)<br/>
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)<br/>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)<br/>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)<br/>
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)<br/>
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)<br/>
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)<br/>
at java.util.concurrent.FutureTask.run(FutureTask.java:138)<br/>
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br/>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br/>
at java.lang.Thread.run(Thread.java:662)<br/>
Aug 30, 2012 7:49:41 PM org.apache.catalina.core.ApplicationContext log<br/>
INFO: Marking servlet JAX-RS Servlet as unavailable<br/>
Aug 30, 2012 7:49:41 PM org.apache.catalina.core.StandardContext loadOnStartup<br/>
SEVERE: Servlet /BeezerServer threw load() exception<br/>
javax.servlet.UnavailableException: com.test.AddressBookApplication<br/>
at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:91)<br/>
at javax.servlet.GenericServlet.init(GenericServlet.java:160)<br/>
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)<br/>
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)<br/>
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)<br/>
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)<br/>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)<br/>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)<br/>
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)<br/>
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)<br/>
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)<br/>
at java.util.concurrent.FutureTask.run(FutureTask.java:138)<br/>
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br/>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br/>
at java.lang.Thread.run(Thread.java:662)<br/>
Aug 30, 2012 7:49:41 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
My web.XML:
<?xml version="1.0" encoding="UTF-8"?><br/> <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/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee<br/> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>BeezerServer</display-name>
<servlet>
<description>JAX-RS Tools Generated - Do not modify</description>
<servlet-name>JAX-RS Servlet</servlet-name>
<servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.test.AddressBookApplication</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JAX-RS Servlet</servlet-name>
<url-pattern>/jaxrs/*</url-pattern>
</servlet-mapping>
Does anyone has a clew?
thanks!
First check that this class really exists. Check class name and package. Does it belong to the web project or dependent project?
If everything is OK, refresh project, then run Project/Clean, then clean and re-publish tomcat. If it does not work create server again (I mean in eclipse). If it still does not work go to C:\beezer\WebServerWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\BeezerServer\WEB-INF\classes (the path is taken from your log) and check that the class file is there.
Good luck and welcome to the club of people that spend night fighting against the bugs in plugin of tomcat for eclipse...
Get rid of C:\beezer\WebServerWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\BeezerServer\WEB-INF\lib\geronimo-j2ee_1.4_spec-1.1.jar It contains the class Servlet.java, which should be provided by the AS itself. If you are using Maven, mark the dependency as provided (<scope>provided</scope>)
Btw. the jar is still needed for compilation, but not in runtime.
EDIT: Oh, now I've noticed, it is only INFO in the log. So it is not the source of the problem, the root cause is the ClassNotFound ex. Make sure the class is on the classpath.

Categories