• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Weird Tomcat problem -- with assert

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suddenly I am having a very weird problem with Tomcat, and it was working a couple of days ago. I have used "assert" in my code liberally, and it compiles just fine with ANT. And it did work fine in Apache Tomcat till recently -- however, now for some weird reason Tomcat fails with Internal Server Error and this is wat I get in logs -- suggesting that asertiosn are for some reason are creating problems. What could be the reason??? How can I fix this problem???

java.lang.Error: Unresolved compilation problems:
assert cannot be resolved to a type
Duplicate local variable condition

at com.xyz.core.Contract.cAssert(Contract.java:56)
at com.xyz.core.Trace.<init>(Trace.java:218)
at com.xyz.core.Trace.<init>(Trace.java:203)
at com.xyz.core.Application.<clinit>(Application.java:229)
at com.xyz.core.Configuration.getSystemConfiguration(Configuration.java:554)
at com.xyz.core.Configuration.getSystemConfiguration(Configuration.java:562)
at com.xyz.core.Configuration.loadSystemConfiguration(Configuration.java:293)
at com.xyz.util.At.<init>(At.java:331)
at com.xyz.util.At.buildInstance(At.java:322)
at com.xyz.util.At.getInstance(At.java:315)
at com.xyzsoftware.edith.servlet.AtInitializerServlet.init(AtInitializerServlet.java:98)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
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.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

TIA,
- Amit
 
Amit Babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Java 5, and JAVA_HOME has been set properly, I wonder what could be the problem??? Interestingly even some ANT targets running Java fail with similar problems so I think Java itself is having problems with assert (I did try to use -ea) in the code. What can I do now???
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does this line of code look like?
at com.xyz.core.Contract.cAssert(Contract.java:56)
 
Amit Babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
What does this line of code look like?
at com.xyz.core.Contract.cAssert(Contract.java:56)





There is no problem with the code, it has been working for more than 2 years now. Moreover, the problem is with "assert" itself. If i change code here, error shofts to another place where assert has been used. Somehow my JVM itself is having problems with "assert". I use Java 5 and that's the only JVM on machine, moreover it just worked couple of days ago!!!

See another post here --
https://coderanch.com/forums/

Any clues why would this happen???

TIA,
- Amit
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One way to verify that you are running under jdk1.5 is to fire up the tomcat manager app
http://localhost:8080/manager/html
Then click on the "Server Status" link.
It will show you the JVM version being used.

If it's running with the proper JVM version, I'm not sure what else it could be.


Side Note:
A lot of people will immediately start ignoring your posts if they see that you are cross-posting your questions. Nobody wants to spend time trying to help you only to find out that all the same questions are being asked and answered in another forum.
Pick which forum you want to use to continue this conversation.
If you want to continue in Java in General, let me know and I'll close this one, otherwise, ask someone over there to close that one.
 
Amit Babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understan dabout cross-posting, initially I thought it was Tomcat problem, but later I realzied that it was a diffferent problem altogether. Hence posted in another forum --

This is what I see in status, it does show JVm version correctly --

Tomcat Version JVM Version JVM Vendor OS Name OS Version OS Architecture
Apache Tomcat/5.0.28 1.5.0_01-b08 Sun Microsystems Inc. Windows XP 5.1 x86


So what could be the problem???
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what the problem could be.

If you think that your thread would do better in another forum, just ask for it to be moved and we'll be happy to move it for you.

I'll move this one to Java In General (Intermediate) and have the duplicate closed.

Good-luck.
 
Amit Babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!!
I have deleted my duplicate thread from the intermediate forum.
Now wondering what could be the problem??
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic