tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Isaacs" <Larry.Isa...@sas.com>
Subject RE: UnsupportedClassVersionError
Date Thu, 08 Dec 2005 14:16:13 GMT
I believe the message:

java.lang.UnsupportedClassVersionError: 
com/sun/tools/javac/Main (Unsupported major.minor version 49.0)

indicates that while running with 1.4.2, you are attempting to
use a tools.jar from a JDK 1.5.x.  The simplest way I know to
encounter this is to install Tomcat using the exe on Windows
with JAVA_HOME pointing to a JDK 1.5.x.  During the installation
process, tools.jar will be copied from the JDK to the
common/lib directory of the installation.  As long as you use
this installation with 1.5 you are okay.  But if you switch
back to using 1.4.x, you will get this symptom because 1.4
doesn' know how to load the newer format classes in the 1.5
tools.jar.

Assuming the diagnosis above is correct, how to address this
depends on how you are running Tomcat.  If running as a service,
I think the only option is to overwrite the tools.jar in
common/lib with a version from JDK 1.4.x.  If running using
batch scripts, and don't care about running it as a service,
I believe you can delete the tools.jar in common/lib and
ensure your JAVA_HOME points to a JDK.

HTH.

Cheers,
Larry

> -----Original Message-----
> From: e-Denton Subscriber [mailto:subscriber@e-denton.com] 
> Sent: Thursday, December 08, 2005 8:06 AM
> To: 'Tomcat Users List'
> Subject: UnsupportedClassVersionError
> 
> Hi,
> 
>  
> 
> I recently uploaded an updated Struts application to a remote 
> server. Now I get this message (below: 
> UnsupportedClassVersionError). I am using Tomcat 5.0.27. I do 
> have 5.5 on that system, but everything points to 5.0.27 (as 
> far as I can tell). I am running Java 1.4.2_01_b06. I have 
> the same setup on my dev machine--except Tomcat 5.5 is not on 
> that system--and everything works fine. 
> 
>  
> 
> Thanks for your help.
> 
>  
> 
> (I already tried to email this under the wrong email address. 
> Sorry if both show up.)
> 
>  
> 
> 2005-12-08 04:30:59 
> NamingContextListener[/Catalina/localhost]:   Resource
> parameters for jdbc/portal = ResourceParams[name=jdbc/portal, 
> parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory,
> maxWait=10000, maxActive=10, password=small1, 
> url=jdbc:mysql://127.0.0.1:3306/fortune?autoReconnect=true,
> driverClassName=com.mysql.jdbc.Driver, maxIdle=5, username=fortune}]
> 
>  
> 
> 2005-12-08 04:30:59 
> NamingContextListener[/Catalina/localhost]:   Adding
> resource ref jdbc/portal
> 
>  
> 
> 2005-12-08 04:30:59 NamingContextListener[/Catalina/localhost]:
> ResourceRef[className=javax.sql.DataSource,factoryClassLocatio
> n=null,factory
> ClassName=org.apache.naming.factory.ResourceFactory,{type=scop
> e,content=Shar
> eable},{type=auth,content=Container},{type=factory,content=org
> .apache.common
> s.dbcp.BasicDataSourceFactory},{type=maxWait,content=10000},{t
> ype=maxActive,
> content=10},{type=password,content=small1},{type=url,content=j
> dbc:mysql://12
> 7.0.0.1:3306/fortune?autoReconnect=true},{type=driverClassName
> ,content=com.m
> ysql.jdbc.Driver},{type=maxIdle,content=5},{type=username,cont
> ent=fortune}]
> 
>  
> 
> 2005-12-08 04:30:59 
> NamingContextListener[/Catalina/localhost]:   Resource
> parameters for mail/Session = 
> ResourceParams[name=mail/Session, 
> parameters={mail.smtp.host=mars.webappcabaret.net}]
> 
>  
> 
> 2005-12-08 04:30:59 
> NamingContextListener[/Catalina/localhost]:   Adding
> resource ref mail/Session
> 
>  
> 
> 2005-12-08 04:30:59 NamingContextListener[/Catalina/localhost]:
> ResourceRef[className=javax.mail.Session,factoryClassLocation=
> null,factoryCl
> assName=org.apache.naming.factory.ResourceFactory,{type=scope,
> content=Sharea
> ble},{type=auth,content=Container},{type=mail.smtp.host,conten
> t=mars.webappc
> abaret.net}]
> 
>  
> 
> 2005-12-08 04:30:59 
> NamingContextListener[/Catalina/localhost]:   Resource
> parameters for UserTransaction = null
> 
>  
> 
> 2005-12-08 04:32:43 StandardWrapperValve[jsp]: 
> Servlet.service() for servlet jsp threw exception
> 
>  
> 
> java.lang.UnsupportedClassVersionError: 
> com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
> 
>  
> 
>       at java.lang.ClassLoader.defineClass0(Native Method)
> 
>  
> 
>       at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
> 
>  
> 
>       at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.
> java:123)
> 
>  
> 
>       at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> 
>  
> 
>       at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> 
>  
> 
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> 
>  
> 
>       at java.security.AccessController.doPrivileged(Native Method)
> 
>  
> 
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> 
>  
> 
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> 
>  
> 
>       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> 
>  
> 
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> 
>  
> 
>       at
> org.apache.catalina.loader.StandardClassLoader.loadClass(Stand
> ardClassLoader
> .java:803)
> 
>  
> 
>       at
> org.apache.catalina.loader.StandardClassLoader.loadClass(Stand
> ardClassLoader
> .java:721)
> 
>  
> 
>       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> 
>  
> 
>       at java.lang.Class.forName0(Native Method)
> 
>  
> 
>       at java.lang.Class.forName(Class.java:141)
> 
>  
> 
>       at
> org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory
> .doesModernCom
> pilerExist(CompilerAdapterFactory.java:140)
> 
>  
> 
>       at
> org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory
> .getCompiler(C
> ompilerAdapterFactory.java:98)
> 
>  
> 
>       at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
> 
>  
> 
>       at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
> 
>  
> 
>       at
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
> 
>  
> 
>       at 
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
> 
>  
> 
>       at 
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
> 
>  
> 
>       at 
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
> 
>  
> 
>       at
> org.apache.jasper.JspCompilationContext.compile(JspCompilation
> Context.java:5
> 11)
> 
>  
> 
>       at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:2
> 95)
> 
>  
> 
>       at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:292)
> 
>  
> 
>       at 
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> 
>  
> 
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
>  
> 
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(Application
> FilterChain.java:237)
> 
>  
> 
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterCh
> ain.java:157)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.ja
> va:214)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:104)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardContextValve.invokeInternal(S
> tandardContext
> Valve.java:198)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.ja
> va:152)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:104)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:137
> )
> 
>  
> 
>       at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:104)
> 
>  
> 
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:117
> )
> 
>  
> 
>       at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:102)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java
> :109)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:104)
> 
>  
> 
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 
>  
> 
>       at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 
>  
> 
>       at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.
> java:160)
> 
>  
> 
>       at
> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
> 
>  
> 
>       at 
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
> 
>  
> 
>       at 
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
> 
>  
> 
>       at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSo
> cket.java:675)
> 
>  
> 
>       at 
> org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
> 
>  
> 
>       at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.jav
> a:683)
> 
>  
> 
>       at java.lang.Thread.run(Thread.java:534)
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message