You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jack Yu <jy...@iis-consulting.com> on 2007/05/08 16:08:51 UTC

(Solution) RE: problem with Struts 2 setup -class file has wrong version 49.0, should be 48.0

Hi All, 

Thanks for all the help, but the true solution I found was to replace the
tools.jar in tomcat5 with the tools.jar file from jdk1.6. Now I'm able to 
get Struts2 up and running. 

And they have a thread in sun's website related to this: 
http://forum.java.sun.com/thread.jspa?threadID=5121172

thanks, 

Jack 


-----Original Message-----
From: Jack Yu [mailto:jyu@iis-consulting.com] 
Sent: Tuesday, May 08, 2007 9:46 AM
To: 'Struts Users Mailing List'
Cc: 'Jae Lim'
Subject: RE: problem with Struts 2 setup -class file has wrong version 49.0,
should be 48.0

Ok, I have did all the steps below, and still can't fix this version problem
with Java. 

  1) Delete the "Catalina" folder under tomcat5/work/
  2) Restart tomcat
  3) Make sure javac and java are both 1.6 from the command line, and in the
tomcat configuration, the jvm path is: 
     C:\Program Files\Java\jdk1.6.0_01\jre\bin\server\jvm.dll
  4) Go to http://localhost:8080/struts2-blank-2.0.6/
     And get this error: 

============================================================================
javax.servlet.ServletException: Unable to compile class for JSP

Generated servlet error:
C:\Tomcat5\work\Catalina\localhost\struts2-blank-2.0.6\org\apache\jsp\exampl
e\HelloWorld_jsp.java:7: cannot access java.lang.Object


Generated servlet error:
bad class file: C:\Program
Files\Java\jdk1.6.0_01\jre\lib\rt.jar(java/lang/Object.class)
class file has wrong version 49.0, should be 48.0
============================================================================

Version 48.0 is Java 1.4,  version 49.0 is Java 1.5, but I only have version
Java 1.6(Version 50.0) on my computer right now. 

Another question I have raised is that I downloaded and installed Java SDK,
do I need to download Java EE separately? 

Thanks. 







-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, May 07, 2007 5:50 PM
To: jyu@iis-consulting.com
Cc: Struts Users Mailing List
Subject: Re: problem with Struts 2 setup -The requested resource
(/struts2-blank-2.0.6/) is not available

what happens when you clean the work dir (as earlier suggested) and 
recompile the webapp under 6???
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Dave Newton" <ne...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, May 07, 2007 5:31 PM
Subject: RE: problem with Struts 2 setup -The requested resource 
(/struts2-blank-2.0.6/) is not available


> --- Jack Yu <jy...@iis-consulting.com> wrote:
>> Yeah, I have tried this, but it still give me the
>> same problem. Thanks.
>
> ?! I hate to ask, but are you sure? If the compilation
> is happening with one version and the execution with
> another something seems horribly wrong.
>
> You say you're using 1.6, but the trace below is using
> 1.5.
>
> d.
>
>> Clean out your work directory so the JSPs are
>> re-compiled.
>>
>> --- Jack Yu <jy...@iis-consulting.com> wrote:
>>
>> > Ok, I can start my webapps now, by using JVM 1.6.
>> > (The mistakes was that I
>> > configured tomcat to point to the jre1.4
>> directory.
>> > )
>> >
>> > However, I encounter a new problem, when I go to
>> > http://localhost:8080/struts2-blank-2.0.6/, I get
>> > the following error.
>> >
>> > I read compile each java src files and restart
>> > tomcat again, still give me
>> > the same problem.
>> >
>>
> ==============================================================
>> > javax.servlet.ServletException: Unable to compile
>> > class for JSP
>> >
>> > Generated servlet error:
>> >
>>
>
C:\Tomcat5\work\Catalina\localhost\struts2-blank-2.0.6\org\apache\jsp\exampl
>> > e\HelloWorld_jsp.java:7: cannot access
>> > java.lang.Object
>> >
>> >
>> > Generated servlet error:
>> > bad class file:
>> >
>>
> C:\jdk1.5.0_11\jre\lib\rt.jar(java/lang/Object.class)
>> > class file has wrong version 49.0, should be 48.0
>> > Please remove or make sure it appears in the
>> correct
>> > subdirectory of the
>> > classpath.
>> > public final class HelloWorld_jsp extends
>> > org.apache.jasper.runtime.HttpJspBase
>> >              ^
>> > 1 error....
>> >
>>
> ===================================================================
>> >
>> > -----Original Message-----
>> > From: Musachy Barroso [mailto:musachy@gmail.com]
>> > Sent: Monday, May 07, 2007 3:03 PM
>> > To: Struts Users Mailing List
>> > Subject: Re: problem with Struts 2 setup -The
>> > requested resource
>> > (/struts2-blank-2.0.6/) is not available
>> >
>> > That problem is definitely a jvm version issue.
>> Run:
>> >
>> > java -showversion
>> >
>> > to see what version you have in the path and make
>> > sure it is 1.5 (1.6 should
>> > be fine also)
>> >
>> > musachy
>> >
>> > On 5/7/07, Jack Yu <jy...@iis-consulting.com> wrote:
>> > >
>> > > Ok,
>> > >
>> > > I'm using JDK 1.6 and JVM 1.6 now, and I still
>> > have the same problem.
>> > >
>> > > I also tried to use JDK 1.5, but still have the
>> > same problem.
>> > >
>> > >
>> >
>>
> ===================================================================
>> > > 007-05-07 14:55:21
>> > StandardContext[/manager]HTMLManager: start:
>> > Starting
>> > > web
>> > > application at '/struts2-blank-2.0.6'
>> > > 2007-05-07 14:55:21
>> > StandardContext[/struts2-blank-2.0.6]Exception
>> > > starting
>> > > filter struts2
>> > > java.lang.UnsupportedClassVersionError:
>> > > org/apache/struts2/dispatcher/FilterDispatcher
>> > (Unsupported major.minor
>> > > version 49.0)
>> > >         at
>> > java.lang.ClassLoader.defineClass0(Native Method)
>> > >
>> > >
>> >
>>
>
============================================================================
>> > > ===
>> > >
>> > >
>> > >
>> > > -----Original Message-----
>> > > From: Patrick J Kobly [mailto:patrick@kobly.com]
>> > > Sent: Monday, May 07, 2007 1:09 PM
>> > > To: Struts Users Mailing List
>> > > Subject: Re: problem with Struts 2 setup -The
>> > requested resource
>> > > (/struts2-blank-2.0.6/) is not available
>> > >
>> > > Download a more recent JVM for Tomcat to use.
>> > Looks like struts needs
>> > > 1.5+...
>> > >
>> > > PK
>> > > Jack Yu wrote:
>> > > > Ok, I found the error from the log
>> > > >
>> >
>>
> ==========================================================
>> > > > 2007-05-07 12:51:55
>> > StandardContext[/manager]HTMLManager: start:
>> > > Starting
>> > > > web application at '/struts2-blank-2.0.6'
>> > > > 2007-05-07 12:51:56
>> > StandardContext[/struts2-blank-2.0.6]Exception
>> > > starting
>> > > > filter struts2
>> > > > java.lang.UnsupportedClassVersionError:
>> > > > org/apache/struts2/dispatcher/FilterDispatcher
>> > (Unsupported major.minor
>> > > > version 49.0)
>> > > >
>> > >
>> > >
>> > >
>> >
>>
> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail:
>> > user-unsubscribe@struts.apache.org
>> > > For additional commands, e-mail:
>> > user-help@struts.apache.org
>> > >
>> > >
>> > >
>> >
>>
> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail:
>> > user-unsubscribe@struts.apache.org
>> > > For additional commands, e-mail:
>> > user-help@struts.apache.org
>> > >
>> > >
>> >
>> >
>> > -- 
>> > "Hey you! Would you help me to carry the stone?"
>> > Pink Floyd
>> >
>> >
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> > user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail:
>> > user-help@struts.apache.org
>> >
>> >
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam
>> protection around
>> http://mail.yahoo.com
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>>
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] (Solution) RE: problem with Struts 2 setup -class file has wrong version 49.0, should be 48.0

Posted by Laurie Harper <la...@holoweb.net>.
At this point, this is a Tomcat configuration issue rather than a Struts 
issue, but for the sake of completeness:

 >   3) Make sure javac and java are both 1.6 from the command line, and 
in the
 > tomcat configuration, the jvm path is:
 >      C:\Program Files\Java\jdk1.6.0_01\jre\bin\server\jvm.dll

You're pointing to the JRE, which doesn't include the Java compiler. 
Tomcat needs the compiler to compile the servlets it generates from your 
JSPs, which is why you end up with an error (all be it, not a very clear 
error :-( ).

The correct solution would be to point Tomcat to the full SDK instead of 
just the JRE. If you'd like further clarification of advice regarding 
this, please follow up on the Tomcat Users list.

L.

Jack Yu wrote:
> Hi All, 
> 
> Thanks for all the help, but the true solution I found was to replace the
> tools.jar in tomcat5 with the tools.jar file from jdk1.6. Now I'm able to 
> get Struts2 up and running. 
> 
> And they have a thread in sun's website related to this: 
> http://forum.java.sun.com/thread.jspa?threadID=5121172
> 
> thanks, 
> 
> Jack 
> 
> 
> -----Original Message-----
> From: Jack Yu [mailto:jyu@iis-consulting.com] 
> Sent: Tuesday, May 08, 2007 9:46 AM
> To: 'Struts Users Mailing List'
> Cc: 'Jae Lim'
> Subject: RE: problem with Struts 2 setup -class file has wrong version 49.0,
> should be 48.0
> 
> Ok, I have did all the steps below, and still can't fix this version problem
> with Java. 
> 
>   1) Delete the "Catalina" folder under tomcat5/work/
>   2) Restart tomcat
>   3) Make sure javac and java are both 1.6 from the command line, and in the
> tomcat configuration, the jvm path is: 
>      C:\Program Files\Java\jdk1.6.0_01\jre\bin\server\jvm.dll
>   4) Go to http://localhost:8080/struts2-blank-2.0.6/
>      And get this error: 
> 
> ============================================================================
> javax.servlet.ServletException: Unable to compile class for JSP
> 
> Generated servlet error:
> C:\Tomcat5\work\Catalina\localhost\struts2-blank-2.0.6\org\apache\jsp\exampl
> e\HelloWorld_jsp.java:7: cannot access java.lang.Object
> 
> 
> Generated servlet error:
> bad class file: C:\Program
> Files\Java\jdk1.6.0_01\jre\lib\rt.jar(java/lang/Object.class)
> class file has wrong version 49.0, should be 48.0
> ============================================================================
> 
> Version 48.0 is Java 1.4,  version 49.0 is Java 1.5, but I only have version
> Java 1.6(Version 50.0) on my computer right now. 
> 
> Another question I have raised is that I downloaded and installed Java SDK,
> do I need to download Java EE separately? 
> 
> Thanks. 
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com] 
> Sent: Monday, May 07, 2007 5:50 PM
> To: jyu@iis-consulting.com
> Cc: Struts Users Mailing List
> Subject: Re: problem with Struts 2 setup -The requested resource
> (/struts2-blank-2.0.6/) is not available
> 
> what happens when you clean the work dir (as earlier suggested) and 
> recompile the webapp under 6???
> M--
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
> 
> ----- Original Message ----- 
> From: "Dave Newton" <ne...@yahoo.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Monday, May 07, 2007 5:31 PM
> Subject: RE: problem with Struts 2 setup -The requested resource 
> (/struts2-blank-2.0.6/) is not available
> 
> 
>> --- Jack Yu <jy...@iis-consulting.com> wrote:
>>> Yeah, I have tried this, but it still give me the
>>> same problem. Thanks.
>> ?! I hate to ask, but are you sure? If the compilation
>> is happening with one version and the execution with
>> another something seems horribly wrong.
>>
>> You say you're using 1.6, but the trace below is using
>> 1.5.
>>
>> d.
>>
>>> Clean out your work directory so the JSPs are
>>> re-compiled.
>>>
>>> --- Jack Yu <jy...@iis-consulting.com> wrote:
>>>
>>>> Ok, I can start my webapps now, by using JVM 1.6.
>>>> (The mistakes was that I
>>>> configured tomcat to point to the jre1.4
>>> directory.
>>>> )
>>>>
>>>> However, I encounter a new problem, when I go to
>>>> http://localhost:8080/struts2-blank-2.0.6/, I get
>>>> the following error.
>>>>
>>>> I read compile each java src files and restart
>>>> tomcat again, still give me
>>>> the same problem.
>>>>
>> ==============================================================
>>>> javax.servlet.ServletException: Unable to compile
>>>> class for JSP
>>>>
>>>> Generated servlet error:
>>>>
> C:\Tomcat5\work\Catalina\localhost\struts2-blank-2.0.6\org\apache\jsp\exampl
>>>> e\HelloWorld_jsp.java:7: cannot access
>>>> java.lang.Object
>>>>
>>>>
>>>> Generated servlet error:
>>>> bad class file:
>>>>
>> C:\jdk1.5.0_11\jre\lib\rt.jar(java/lang/Object.class)
>>>> class file has wrong version 49.0, should be 48.0
>>>> Please remove or make sure it appears in the
>>> correct
>>>> subdirectory of the
>>>> classpath.
>>>> public final class HelloWorld_jsp extends
>>>> org.apache.jasper.runtime.HttpJspBase
>>>>              ^
>>>> 1 error....
>>>>
>> ===================================================================
>>>> -----Original Message-----
>>>> From: Musachy Barroso [mailto:musachy@gmail.com]
>>>> Sent: Monday, May 07, 2007 3:03 PM
>>>> To: Struts Users Mailing List
>>>> Subject: Re: problem with Struts 2 setup -The
>>>> requested resource
>>>> (/struts2-blank-2.0.6/) is not available
>>>>
>>>> That problem is definitely a jvm version issue.
>>> Run:
>>>> java -showversion
>>>>
>>>> to see what version you have in the path and make
>>>> sure it is 1.5 (1.6 should
>>>> be fine also)
>>>>
>>>> musachy
>>>>
>>>> On 5/7/07, Jack Yu <jy...@iis-consulting.com> wrote:
>>>>> Ok,
>>>>>
>>>>> I'm using JDK 1.6 and JVM 1.6 now, and I still
>>>> have the same problem.
>>>>> I also tried to use JDK 1.5, but still have the
>>>> same problem.
>>>>>
>> ===================================================================
>>>>> 007-05-07 14:55:21
>>>> StandardContext[/manager]HTMLManager: start:
>>>> Starting
>>>>> web
>>>>> application at '/struts2-blank-2.0.6'
>>>>> 2007-05-07 14:55:21
>>>> StandardContext[/struts2-blank-2.0.6]Exception
>>>>> starting
>>>>> filter struts2
>>>>> java.lang.UnsupportedClassVersionError:
>>>>> org/apache/struts2/dispatcher/FilterDispatcher
>>>> (Unsupported major.minor
>>>>> version 49.0)
>>>>>         at
>>>> java.lang.ClassLoader.defineClass0(Native Method)
>>>>>
> ============================================================================
>>>>> ===
>>>>>
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: Patrick J Kobly [mailto:patrick@kobly.com]
>>>>> Sent: Monday, May 07, 2007 1:09 PM
>>>>> To: Struts Users Mailing List
>>>>> Subject: Re: problem with Struts 2 setup -The
>>>> requested resource
>>>>> (/struts2-blank-2.0.6/) is not available
>>>>>
>>>>> Download a more recent JVM for Tomcat to use.
>>>> Looks like struts needs
>>>>> 1.5+...
>>>>>
>>>>> PK
>>>>> Jack Yu wrote:
>>>>>> Ok, I found the error from the log
>>>>>>
>> ==========================================================
>>>>>> 2007-05-07 12:51:55
>>>> StandardContext[/manager]HTMLManager: start:
>>>>> Starting
>>>>>> web application at '/struts2-blank-2.0.6'
>>>>>> 2007-05-07 12:51:56
>>>> StandardContext[/struts2-blank-2.0.6]Exception
>>>>> starting
>>>>>> filter struts2
>>>>>> java.lang.UnsupportedClassVersionError:
>>>>>> org/apache/struts2/dispatcher/FilterDispatcher
>>>> (Unsupported major.minor
>>>>>> version 49.0)
>>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>>>
>>>>
>>>> -- 
>>>> "Hey you! Would you help me to carry the stone?"
>>>> Pink Floyd
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>>
>>>>
>>>
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam
>>> protection around
>>> http://mail.yahoo.com
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>>
>>>
>> === message truncated ===
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org