• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error 500 Unable to compile

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Help!
I am just starting with JSP, I am getting this message:
HTTP ERROR: 500 Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file
this is the simple text,
<HTML>
<BODY>
Hello! The time is now <%= new java.util.Date() %>
</BODY>
</HTML>

I don't know what's wrong!!!
HElP!!!
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try simplifying the problem until you are at a known state, either an error state or success state. In this case, try using just the HTML markup without the scriplet.
Does it compile then? If so, the error has something to do with the scriptlet. If it still doesn't compile, it might be some kind of configuration problem. Try it without the scriplet and report back what happens.
 
Marv Dexter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rob Ross:
Try simplifying the problem until you are at a known state, either an error state or success state. In this case, try using just the HTML markup without the scriplet.
Does it compile then? If so, the error has something to do with the scriptlet. If it still doesn't compile, it might be some kind of configuration problem. Try it without the scriplet and report back what happens.

 
Marv Dexter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tired everything it's just not working.
Thanks anyway.
/md
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using Apache Tomcat? If so, then you can look at a folder under that directory called "work", and it will show you the actual compile messages. May help in your troubleshooting. You can also see your source code (servlet), which is a good tool for learning.

Dorothy
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you get the example webapps to work? If they don't either, then there's something funky with the way you've installed Tomcat. If they are working ok, it's a configuration setting for your specific example web app.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the problem is that the expression element ie
<%= XXX%> needs some expression which will return a result that can be converted to a String . But constructors will not return any explicit value.
Compiler will need something like this
<%java.util.Date dt = new java.util.Date();%>
<%=dt%>
 
Sheriff
Posts: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But constructors will not return any explicit value.


While this is true, the fact that the new operator is being used means that the constructed object will be returned and its toString() value displayed. This is clearly not part of the problem.
We await the answer to Rob's query regarding the sample web apps.
bear
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic