You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by olk <Ol...@web.de> on 2008/01/16 14:40:11 UTC

Tomcat 6 embedded use - problems with jsp - No Java compiler available

Hi,

I'm running tomcat in embedded mode from an applet. When I open a html page
the embedded server responds correct. When I call a jsp I get the error
"java.lang.IllegalStateException: No Java compiler available" below. Does
maybe someone know what the reason could be ? - or point me to a good
documentation for the embedded use of tomcat 6 ?

Thx.

INFO: Starting tomcat server
Jan 16, 2008 12:10:23 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
Jan 16, 2008 12:10:23 PM org.apache.catalina.startup.ContextConfig
defaultWebConfig
INFO: No default web.xml
Jan 16, 2008 12:10:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 16, 2008 12:10:24 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 16, 2008 12:10:48 PM org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: No Java compiler available
	at
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:229)
	at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:561)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
	at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
	at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
	at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Unknown Source)

-- 
View this message in context: http://www.nabble.com/Tomcat-6-embedded-use---problems-with-jsp---No-Java-compiler-available-tp14881179p14881179.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


solved -- missing jasper-jdt.jar

Posted by olk <Ol...@web.de>.
I was missing the jasper-jdt.jar  which caused the message.... !!




olk wrote:
> 
> Hi,
> 
> I'm running tomcat in embedded mode from an applet. When I open a html
> page the embedded server responds correct. When I call a jsp I get the
> error "java.lang.IllegalStateException: No Java compiler available" below.
> Does maybe someone know what the reason could be ? - or point me to a good
> documentation for the embedded use of tomcat 6 ?
> 
> Thx.
> 
> INFO: Starting tomcat server
> Jan 16, 2008 12:10:23 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
> Jan 16, 2008 12:10:23 PM org.apache.catalina.startup.ContextConfig
> defaultWebConfig
> INFO: No default web.xml
> Jan 16, 2008 12:10:24 PM org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Jan 16, 2008 12:10:24 PM org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Jan 16, 2008 12:10:48 PM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet jsp threw exception
> java.lang.IllegalStateException: No Java compiler available
> 	at
> org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:229)
> 	at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:561)
> 	at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
> 	at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
> 	at
> org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
> 	at
> org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
> 	at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> 	at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-6-embedded-use---problems-with-jsp---No-Java-compiler-available-tp14881179p14918590.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Download Dialog inclusing file extention

Posted by Mark Thomas <ma...@apache.org>.
Kazufumi Arai wrote:
> Hello,
> 
> someone gives me information about definishion parameter for download dialog.
> I have phenomenon that windows download dialog with no file extention
> when using tomcat 1.4.x. I guess where I can set file extention like ".mol"
> in any file in conf folder included in tomcat 1.4.x

This isn't a Tomcat setting, it is caused by how you have coded your 
application. You probably just need to set the headers properly. Post some 
sample code and someone on the list should help out.

Mark


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


Re: Download Dialog inclusing file extention

Posted by Konstantin Kolinko <kn...@gmail.com>.
You should use "Content-Disposition" header in your response.
It allows you to provide filename of the file, and that includes its extension.

Also, I suppose that the "save as" dialog honors the mime-type of your
response. If that mime-type is known at your client computers, it may
offer the relevant extension. I have not tested that, though.

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


Download Dialog inclusing file extention

Posted by Kazufumi Arai <ka...@strad.ssg.fujitsu.com>.
Hello,

someone gives me information about definishion parameter for download dialog.
I have phenomenon that windows download dialog with no file extention
when using tomcat 1.4.x. I guess where I can set file extention like ".mol"
in any file in conf folder included in tomcat 1.4.x

Please give me any information about solving this phenomenon.

Thank you for cooperations.



Arai




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


RE: Tomcat 6 embedded use - problems with jsp - No Java compiler available

Posted by olk <Ol...@web.de>.
Hi,

thanks for your reply - meanwhile I found it out myself - I was missing the
jasper-jdt.jar.

But it was hard to guess as the error message "No compiler available" does
not point you on this. I would rather expect a "ClassDef not found" or so
.....

You never stop learning new things .... :o)



Reich, Matthias wrote:
> 
> Hi Oliver,
> 
> I would guess that a library is missing in your classpath.
> I am also using Tomcat in embedded mode, and I had seen the same kind of
> error because I missed to add el-api.jar to the classpath.
> These are the tomcat libraries I have included and which are sufficient
> (without any further jasper setup) to compile and run JSPs:
> 
> annotations-api.jar 
> catalina.jar
> el-api.jar 
> jasper.jar 
> jasper-el.jar 
> jasper-jdt.jar 
> jsp-api.jar 
> servlet-api.jar
> tomcat-coyote.jar 
> tomcat-juli.jar 
> tomcat-juli-adapters.jar 
> 
> Regards,
> Matthias
> 
> -----Original Message-----
> From: olk [mailto:Oliver.Kolling@web.de] 
> Sent: Thursday, January 17, 2008 10:33 AM
> To: users@tomcat.apache.org
> Subject: Re: Tomcat 6 embedded use - problems with jsp - No Java
> compiler available
> 
> 
> Hi,
> 
> I found a first hint on my own - it is probably related to setting-up
> jasper
> correctly - but I hope someone can tell me how to set the parameter for
> jasper in embedded mode. What I did was:
> 
>  // Create a handler for jsps
> 		 Wrapper jspServlet = context.createWrapper();
> 		 jspServlet.setName("jsp");		 
> 	
> jspServlet.setServletClass("org.apache.jasper.servlet.JspServlet");
> 		 jspServlet.addInitParameter("fork", "false");
> 		 jspServlet.addInitParameter("xpoweredBy", "false");
> 		 jspServlet.setLoadOnStartup(2);
> 		 
> 		 context.addChild(jspServlet);
> 		 context.addServletMapping("*.jsp", "jsp");
> 		 context.addServletMapping("*.jspx", "jsp");
> 
> But it seams not enough for embedded mode. I think I have to set also
> classpath , compiler ,compilerSourceVM , compilerTargetVM. But I do not
> know
> where to point them in embedded mode ???
> 
> Is there somebody who can help me on this ?
> 
> Thx.
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Tomcat-6-embedded-use---problems-with-jsp---No-Jav
> a-compiler-available-tp14881179p14915285.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-6-embedded-use---problems-with-jsp---No-Java-compiler-available-tp14881179p15036105.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Tomcat 6 embedded use - problems with jsp - No Java compiler available

Posted by "Reich, Matthias" <ma...@siemens.com>.
Hi Oliver,

I would guess that a library is missing in your classpath.
I am also using Tomcat in embedded mode, and I had seen the same kind of
error because I missed to add el-api.jar to the classpath.
These are the tomcat libraries I have included and which are sufficient
(without any further jasper setup) to compile and run JSPs:

annotations-api.jar 
catalina.jar
el-api.jar 
jasper.jar 
jasper-el.jar 
jasper-jdt.jar 
jsp-api.jar 
servlet-api.jar
tomcat-coyote.jar 
tomcat-juli.jar 
tomcat-juli-adapters.jar 

Regards,
Matthias

-----Original Message-----
From: olk [mailto:Oliver.Kolling@web.de] 
Sent: Thursday, January 17, 2008 10:33 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat 6 embedded use - problems with jsp - No Java
compiler available


Hi,

I found a first hint on my own - it is probably related to setting-up
jasper
correctly - but I hope someone can tell me how to set the parameter for
jasper in embedded mode. What I did was:

 // Create a handler for jsps
		 Wrapper jspServlet = context.createWrapper();
		 jspServlet.setName("jsp");		 
	
jspServlet.setServletClass("org.apache.jasper.servlet.JspServlet");
		 jspServlet.addInitParameter("fork", "false");
		 jspServlet.addInitParameter("xpoweredBy", "false");
		 jspServlet.setLoadOnStartup(2);
		 
		 context.addChild(jspServlet);
		 context.addServletMapping("*.jsp", "jsp");
		 context.addServletMapping("*.jspx", "jsp");

But it seams not enough for embedded mode. I think I have to set also
classpath , compiler ,compilerSourceVM , compilerTargetVM. But I do not
know
where to point them in embedded mode ???

Is there somebody who can help me on this ?

Thx.


-- 
View this message in context:
http://www.nabble.com/Tomcat-6-embedded-use---problems-with-jsp---No-Jav
a-compiler-available-tp14881179p14915285.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


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


Re: Tomcat 6 embedded use - problems with jsp - No Java compiler available

Posted by olk <Ol...@web.de>.
Hi,

I found a first hint on my own - it is probably related to setting-up jasper
correctly - but I hope someone can tell me how to set the parameter for
jasper in embedded mode. What I did was:

 // Create a handler for jsps
		 Wrapper jspServlet = context.createWrapper();
		 jspServlet.setName("jsp");		 
		 jspServlet.setServletClass("org.apache.jasper.servlet.JspServlet");
		 jspServlet.addInitParameter("fork", "false");
		 jspServlet.addInitParameter("xpoweredBy", "false");
		 jspServlet.setLoadOnStartup(2);
		 
		 context.addChild(jspServlet);
		 context.addServletMapping("*.jsp", "jsp");
		 context.addServletMapping("*.jspx", "jsp");

But it seams not enough for embedded mode. I think I have to set also
classpath , compiler ,compilerSourceVM , compilerTargetVM. But I do not know
where to point them in embedded mode ???

Is there somebody who can help me on this ?

Thx.


-- 
View this message in context: http://www.nabble.com/Tomcat-6-embedded-use---problems-with-jsp---No-Java-compiler-available-tp14881179p14915285.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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