# Tomcat und Webservices - Exception - Ich bin ratlos

## robelr

Hallo, ich habe ein riesiges Problem.

Ich hab mit der Netbeans IDE nen Java Webservice gebastelt (unter Windows) und versuche den jez auf nem Gentoo Server mit Tomcat 5.5 zu deployen..

Das Resultat ist dieses:

```

May 21, 2007 11:28:29 AM org.apache.catalina.core.StandardContext listenerStart

SEVERE: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener

java.lang.UnsupportedClassVersionError: Bad version number in .class file

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)

        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)

        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)

        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)

        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:242)

        at com.sun.xml.ws.transport.http.servlet.RuntimeEndpointInfoParser.getImplementorClass(RuntimeEndpointInfoParser.java:296)

        at com.sun.xml.ws.transport.http.servlet.RuntimeEndpointInfoParser.parseEndpoints(RuntimeEndpointInfoParser.java:95)

        at com.sun.xml.ws.transport.http.servlet.RuntimeEndpointInfoParser.parse(RuntimeEndpointInfoParser.java:66)

        at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:110)

        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)

        at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1176)

        at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:542)

        at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:105)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)

        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)

        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)

        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)

        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)

        at java.lang.Thread.run(Thread.java:595)

```

und wen die Exception nicht kommt (die Exception komm auf meinem Heim-PC)

dann komm die (Arbeitspc)

```

May 21, 2007 11:56:48 AM org.apache.catalina.core.StandardContext listenerStart

SEVERE: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener

javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found

        at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)

        at com.sun.xml.ws.util.xml.XmlUtil.<clinit>(XmlUtil.java:173)

        at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.createModelAndMetadata(WSServletContextListener.java:175)

        at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:117)

        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)

        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:515)

        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)

        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:585)

        at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:457)

        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)

        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)

        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)

        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)

        at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1397)

        at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:214)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)

        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)

        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)

        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)

        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)

        at java.lang.Thread.run(Thread.java:595)

```

Was kann ich jetzt tun??

Danke fuer die hilfe...

Roman

----------

## forrestfunk81

Hi,

der erste Fehler (java.lang.UnsupportedClassVersionError) kommt wahrscheinlich davon, dass du nicht die richtige Java Version einsetzt (also z.B. Klassen sind kompiliert fuer 1.4 und du hast 1.5 o.ae.). 

Wenn du dein War-Archiv auf dem Tomcat deployst, werden bei der ersten Anfrage die Java Klassen mit deiner JVM kompiliert. Hast du dein Archiv deployed oder einfach nur die Klassen (vllt von Windows) ins Tomcat Verzeichnis geschoben? Versuch einfach mal n redeploy des Archivs.

Der zweite Fehler (javax.xml.transform.TransformerFactoryConfigurationError) ist anscheinend ein Konfigurationsfehler:

http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/TransformerFactoryConfigurationError.html

 *Quote:*   

> public class TransformerFactoryConfigurationError
> 
> extends Error
> 
> Thrown when a problem with configuration with the Transformer Factories exists. This error will typically be thrown when the class of a transformation factory specified in the system properties cannot be found or instantiated. 

 

Vllt hilft dir dazu diese Seite

mfg

----------

## robelr

danke fuer dich schnelle antwort  :Smile: 

also ich hab das archiv deployed nichts passiert.

ich hab auch die jars gezogen und in das verzeichniss kopiert... wirkungslos

```
System.setProperty("javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl");
```

wo soll ich denn das reinschreiben???

\\ jez hab ich wieder diesen bad class version error...

in meinem tomcat manager steht das ich version 1.5 hab

mit netbeans stellt ich source_level auf 1.5

und trotzdem kommt der fehler?!

warum??? was kann ich denn dagegen tun??

----------

## forrestfunk81

also wegen dem UnsupportedClassVersionError:

Entfern mal die alten Class-Files des Projektes. Die sollten unter $tomcat\webapps\$projekt_name liegen. 

Hatte vor kurzer Zeit ein ähnliches Problem. Wir stellten einige Server von 1.4 auf 1.5 um und die Java Projekte in Tomcat waren noch mit 1.4 kompiliert. Also haben wir Tomcat gestoppt, Class-Files gelöscht, neugestartet und beim ersten Aufruf der entsprechenden Seiten wurden diese dann mit der neuen Java Version kompiliert.

Zu dem anderen Problem werden auf der Seite doch zwei Lösungen gegeben:

 *Quote:*   

> In this directory you find two jar files: xercesImpl.jar and xml-apis.jar needed by tomcat and that must be loaded before all xmsl stuff present in the jdk (1.4 naming problem). And in the file xml-apis.jar the TransformerFactoryImpl is set to "org.apache.xalan.processor.TransformerFactoryImpl".
> 
> The solution: remove the file xml-apis.jar from the directory. 

 

 *Quote:*   

> JDK 1.5 doesn't have xalan libraries and hence it throws this exception.
> 
> Copy the xalan.jar and serializer.jar, xercesImpl.jar, xml-apis.jar (this are needed as there are dependencies from xalan.jar) into the tomcat_home/common/endorsed folder.
> 
> If some of the jars are already present, there is no need to overwrite the files.
> ...

 

Mehr kann ich dazu nicht sagen, hab das nicht ausprobiert.

----------

## robelr

habs hinbekommen, 

musste java 6 deinstallieren und hab 5 installiert,

jez gehts.

Danke trotzdem fuer die Tipps.

roman

----------

