hlashila / webgoat

Automatically exported from code.google.com/p/webgoat
0 stars 0 forks source link

Linux start script requires java 1.5 though webgoat is compiled with java 1.6 #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I discovered some problems with the 5.2 Release of WebGoat. I'm using the
Sun JDK in version jdk1.5.0_16 under linux with a x86 machine. When I
try to start WebGoat of the "standard" release, the Tomcat complains
about a "java.lang.UnsupportedClassVersionError:" error while deploying
the *.war file. This sounds to me like I should use a newer version of Java.
A look in the manifest.mf file WebGoat.war indicates that the 5.2
Release is compiled with java 1.6
However the startscript asks me to use Java 1.5 ("The JVM in $JAVA_HOME
isn't version 1.5.")

Bruce was kind enough to confirm the bug in the linux start-script (see
WebGoat-Mailinglist)

WebGoat-5.2$ sh webgoat.sh start8080
Using CATALINA_BASE:   ./tomcat
Using CATALINA_HOME:   ./tomcat
Using CATALINA_TMPDIR: ./tomcat/temp
Using JAVA_HOME:       /..../tools/java/jdk1.5.0_16/

  Open http://127.0.0.1:8080/WebGoat/attack
  Username: guest
  Password: guest
  Or try http://guest:guest@127.0.0.1:8080/WebGoat/attack

Jul 16, 2008 11:51:58 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-127.0.0.1-8443
Jul 16, 2008 11:51:58 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1135 ms
Jul 16, 2008 11:51:58 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 16, 2008 11:51:58 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.4
Jul 16, 2008 11:51:59 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 16, 2008 11:51:59 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive WebGoat.war
Jul 16, 2008 11:52:00 AM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive WebGoat.war
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:1626)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:85
0)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:12
99)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:11
81)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:988)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3817
)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4079)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:777)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:672)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.ja
va:119)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Jul 16, 2008 11:52:01 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain:
[org.apache.webapp.balancer.RuleChain:
[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string:
News / Redirect URL: http://www.cnn.com],
[org.apache.webapp.balancer.rules.RequestParameterRule: Target param
name: paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com],
[org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]
Jul 16, 2008 11:52:01 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
Jul 16, 2008 11:52:01 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-8443
- JK2: ajp13 listening on /127.0.0.1:8009
Jul 16, 2008 11:52:01 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/128  config=null
Jul 16, 2008 11:52:01 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2578 ms

Original issue reported on code.google.com by haemme...@gmail.com on 16 Jul 2008 at 2:30

GoogleCodeExporter commented 8 years ago

Original comment by mayhe...@gmail.com on 26 Aug 2008 at 1:46

GoogleCodeExporter commented 8 years ago
This also applies to Mac OS X, however it's a quick fix.

Original comment by eric.bir...@gmail.com on 2 Feb 2009 at 7:18

GoogleCodeExporter commented 8 years ago
Eric, what is the fix for OS X ? I am running version 10.4, and seems like java 
1.6 is available only for 10.5 
onwards. I see the same error, is upgrading versions the only solution ?

Original comment by sric...@gmail.com on 16 Aug 2009 at 7:09

GoogleCodeExporter commented 8 years ago
Fixed in 5.4

Original comment by mayhe...@gmail.com on 23 Apr 2012 at 7:18