Loading custom classes doesn't work
Greetings, I'm trying to compile a very simple example of a custom JavaBeans class to be used on a JSP page; The class compiles correctly and goes to my web application classes directory (webapps/example/WEB-INF/classes). Here is the bean code (very simple): /* * UserBean.java * * Created on May 4, 2004, 5:33 AM */ public class UserBean { private String _name; private String _age; private String _weight; public UserBean() { // Empty on purpose } public void setName(String name_) { _name = name_; } public void setAge(String age_) { _age = age_; } public void setWeight(String weight_) { _weight = weight_; } public String getName() { return _name; } public String getAge() { return _age; }; public String getWeight() { return _weight; } } I try to import it on my JSP page like this: [EMAIL PROTECTED] contentType=text/html% [EMAIL PROTECTED] session=true% [EMAIL PROTECTED] errorPage=error/index.jsp % [EMAIL PROTECTED] import=java.util.Vector% [EMAIL PROTECTED] import=UserBean% But when i try to load the page I get the following error: StandardWrapperValve[indice]: Servlet.service() for servlet indice threw exception org.apache.jasper.JasperException: Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:348) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:455) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:300) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) If i took out that command my page gets compiled correctly, even if I use expression and other JSP tricks. I'm using: RedHat 9, 2.4.20-28.9 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03) Sun jwsdp-1.3 Any ideas? Thanks in advance, JV. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading custom classes doesn't work
You must put your custom class inside a package. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, May 09, 2004 8:21 AM To: [EMAIL PROTECTED] Subject: Loading custom classes doesn't work Greetings, I'm trying to compile a very simple example of a custom JavaBeans class to be used on a JSP page; The class compiles correctly and goes to my web application classes directory (webapps/example/WEB-INF/classes). Here is the bean code (very simple): /* * UserBean.java * * Created on May 4, 2004, 5:33 AM */ public class UserBean { private String _name; private String _age; private String _weight; public UserBean() { // Empty on purpose } public void setName(String name_) { _name = name_; } public void setAge(String age_) { _age = age_; } public void setWeight(String weight_) { _weight = weight_; } public String getName() { return _name; } public String getAge() { return _age; }; public String getWeight() { return _weight; } } I try to import it on my JSP page like this: [EMAIL PROTECTED] contentType=text/html% [EMAIL PROTECTED] session=true% [EMAIL PROTECTED] errorPage=error/index.jsp % [EMAIL PROTECTED] import=java.util.Vector% [EMAIL PROTECTED] import=UserBean% But when i try to load the page I get the following error: StandardWrapperValve[indice]: Servlet.service() for servlet indice threw exception org.apache.jasper.JasperException: Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. at org.apache.jasper.compiler.DefaultErrorHandler.javacError(Defa ultErrorHandler.java:128) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDis patcher.java:348) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:455) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:555) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:300) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:293) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) If i took out that command my page gets compiled correctly, even if I use expression and other JSP tricks. I'm using: RedHat 9, 2.4.20-28.9 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03) Sun jwsdp-1.3 Any ideas? Thanks in advance, JV. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading custom classes doesn't work
Hello Mark, Yup, tried that and now it works. Thanks, JV. --- Mark Thomas [EMAIL PROTECTED] wrote: You must put your custom class inside a package. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, May 09, 2004 8:21 AM To: [EMAIL PROTECTED] Subject: Loading custom classes doesn't work Greetings, I'm trying to compile a very simple example of a custom JavaBeans class to be used on a JSP page; The class compiles correctly and goes to my web application classes directory (webapps/example/WEB-INF/classes). Here is the bean code (very simple): /* * UserBean.java * * Created on May 4, 2004, 5:33 AM */ public class UserBean { private String _name; private String _age; private String _weight; public UserBean() { // Empty on purpose } public void setName(String name_) { _name = name_; } public void setAge(String age_) { _age = age_; } public void setWeight(String weight_) { _weight = weight_; } public String getName() { return _name; } public String getAge() { return _age; }; public String getWeight() { return _weight; } } I try to import it on my JSP page like this: [EMAIL PROTECTED] contentType=text/html% [EMAIL PROTECTED] session=true% [EMAIL PROTECTED] errorPage=error/index.jsp % [EMAIL PROTECTED] import=java.util.Vector% [EMAIL PROTECTED] import=UserBean% But when i try to load the page I get the following error: StandardWrapperValve[indice]: Servlet.service() for servlet indice threw exception org.apache.jasper.JasperException: Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. at org.apache.jasper.compiler.DefaultErrorHandler.javacError(Defa ultErrorHandler.java:128) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDis patcher.java:348) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:455) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:555) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:300) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:293) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) If i took out that command my page gets compiled correctly, even if I use expression and other JSP tricks. I'm using: RedHat 9, 2.4.20-28.9 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03) Sun jwsdp-1.3 Any ideas? Thanks in advance, JV. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tag output only on page bottom in v. 4+
.jsp jsptags.com pagination tags could display on top bottom of page in v. 3.x. I call a Java executable to display the content. It will work if the call is replaced with the data. Tks for any info. ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot access certian jar files in common/lib
TAO Linux (Redhat clone) Tomcat 5.0.19 JDK 1.4.2 I have a problem that bugging me to death. I have 4 applications that are loaded along with some static files in ROOT. In each of my applications I use a globalresource to do database connections. The jar is in common/lib. I also use iText in several of the apps and the jar for it is also in common/lib . Now for the weird part. I wanted to use the file upload to push some files to the server. I looked into the code for the manager to get some ideas as well as the api. After writing the class I found that the upload.jar was in server/lib. So I moved it to common/lib and made sure there were no other copies. Really strange is that the manager app still works fine but none of my apps can find the classes from the upload jar.(Yes, many many restarts) For now I have a copy of the jar in the app and all is working fine but why would my app not be able to find the classes when the manager app can? Just another question for the twilight zone. Doug
RE: Tomcat 5 JK2 and IIS 5
Well to tell the complete truth, at my site here we used this open source JK2 IIS installer to do all the nitty gritty for us! http://www.shiftomat.com/opensource/ It doesn't use the latest version of JK2, but I don't see why a simple dll upgrade shouldn't fix that :) This is the easiest way I've seen to install JK2... Otherwise I know of no other way to help you at the moment... shane.. -Original Message- From: Raymond Blum [mailto:[EMAIL PROTECTED] Sent: Friday, 7 May 2004 8:23 PM To: Tomcat Users List Subject: Re: Tomcat 5 JK2 and IIS 5 Yes, I am running the ajp connectors at 8009, the 8018 is where Tomcat is listening for HTTP requests instead of the default of 8080 I do have the entry you describe below ---Raymond On May 7, 2004, at 3:59 AM, Shane Linley wrote: From memory, Tomcat runs the default ajp13 connector off of port 8009 not 8080 which is the default HTTP connector port. You worker2.properties file should specify to use port 8009 for your ajp13 connector and not 8018. In your server.xml file look for an entry similar to: !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / to see what port your ajp13 connector is listening on. Regards, Shane. -Original Message- From: Raymond Blum [mailto:[EMAIL PROTECTED] Sent: Friday, 7 May 2004 12:00 PM To: Tomcat Users List Subject: Tomcat 5 JK2 and IIS 5 Hi I am struggling to get IIS 5.0 to pass off JSP and servlet context requests to tomcat 5.0.19 under Windows 2000.I have downloaded and installed what I believe to be a usable copy of isapi_redirector2,dll and have configured the virtual directory Jakarta under one of the web servers in my IIS server. Tomcat is running at 8018, not 8080 I can get to XXX.XXX.XXX.XXX:8018/servlet-examples/ just fine I map /servlet-examples/* to tomcat in workers2.properties and then I try the following XXX.XXX.XXX.XXX/servlet-examples which yields the response The servlet container is temporary unavailable or being upgraded (I have found that this message seems to come from mod_jk and it only is received in response to one of my mapped server paths, so I assume that the URI mapping is being successfully interpreted and that the problem is in my Tomcat and/or workers configuration) I portscan the machine at XXX.XXX.XXX.XXX and port 8009 is open so I assume that tomcat is there and listening. Any tips greatly appreciated! I have searched the archives and googled this a dozen ways. ---Raymond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDIRealm strangeness
Hi, What happens on failed connections IS driver specific, but it should NOT BY DEFAULT switch to using a non SSL connection, for the sake of security if nothing else. The connection should tried to be established, if it fails then it should send back the appropriate naming exception. That said drivers do accept configuration properties to modify their behaviour, so technically anything is possible, based on your drivers documentation. I have never used OpenLDAP so its error logs don't really mean all that much to me, but having done similar things in the past you should look up your error codes in the OpenLDAP documentation (but its probably the OpenSSL doco) as to what the error codes really mean to work out what the problem is. I'm referring specifically to this line (as id does match up to the Request: 1 cancelled) message that the LDAP client driver reports. May 7 20:03:56 localhost slapd[6346]: connection_read(11): TLS accept error error=-1 id=0, closing Thats all I have! Good luck. Regards, Shane. P.S. The anal retentive part of me still wants you to specify the ldap connection as ldaps://server:636 but that is completely besides the point! :) -Original Message- From: Chong Yu Meng [mailto:[EMAIL PROTECTED] Sent: Friday, 7 May 2004 8:17 PM To: Tomcat Users List Subject: Re: JNDIRealm strangeness Hi Shane ! Thanks for the description and advice! I managed to finally turn on OpenLDAP logging (a pain in Fedora Core 1), and set the loglevel to 256. Here's what I get. When the Tomcat server starts up, the connection errors seem to be related to port 636 : May 7 19:51:50 localhost slapd[6049]: conn=4 fd=11 ACCEPT from IP=127.0.0.1:32892 (IP=0.0.0.0:636) May 7 19:51:50 localhost slapd[6049]: conn=4 fd=11 closed May 7 19:51:50 localhost slapd[6049]: conn=5 fd=11 ACCEPT from IP=127.0.0.1:32894 (IP=0.0.0.0:389) May 7 19:51:50 localhost slapd[6049]: conn=5 op=0 BIND dn= method=128 May 7 19:51:50 localhost slapd[6049]: conn=5 op=0 RESULT tag=97 err=0 text= May 7 19:52:02 localhost slapd[6049]: conn=6 fd=12 ACCEPT from IP=127.0.0.1:32895 (IP=0.0.0.0:636) May 7 19:52:02 localhost slapd[6049]: conn=6 fd=12 closed May 7 19:52:02 localhost slapd[6049]: conn=7 fd=12 ACCEPT from IP=127.0.0.1:32897 (IP=0.0.0.0:389) May 7 19:52:02 localhost slapd[6049]: conn=7 op=0 BIND dn= method=128 May 7 19:52:02 localhost slapd[6049]: conn=7 op=0 RESULT tag=97 err=0 text= Bumping up loglevel to 4095, I get these details for the errors on port 636: May 7 20:03:56 localhost slapd[6346]: connection_read(11): TLS accept error error=-1 id=0, closing May 7 20:03:56 localhost slapd[6346]: connection_closing: readying conn=0 sd=11 for close May 7 20:03:56 localhost slapd[6346]: connection_close: conn=0 sd=11 Seems to indicate that there is something wrong with my SSL/TLS connection. But my JNDIRealm still works ! Users can still authenticate successfully. Does the connection fallback to port 389 if a connection on 636 is not possible? Thanks for the help, Shane ! If you have any further suggestions, I would really appreciate it ! Regards, pascal chong Shane Linley wrote: Hi, Knowledge on configuring JNDIRealms security: zip! Knowledge on the JNDI LDAP interface: guru! The root cause: javax.naming.CommunicationException, refers to there being an underlying network problem with communicating between the LDAP client, and the LDAP server. The message received from the ldap driver: Request: 1 cancelled is the reason as to why this error occured. As can be seen its not very helpful. (I've been spoilt on receiving error codes from servers and detailed messages and such). You appear to be using the Sun JNDI LDAP reference implementation, which I found to not always offer the best error messages. I cant remember if it has any extra logging capabilities (from memory it doesn't) to try and wring more information out of the driver, however the key to solving the problem may lie elsewhere. I would recommended turning on the detailed debugging in your LDAP server to determine what error it is trying to communicate back to the LDAP driver (and if the server is successfully contacted in this first instance), by of course inspecting its logs. This approach I have had to use a number of times on less than helpful LDAP drivers that don't seem to think good error messages are needed. You are trying to use a secure SSL connection to the LDAP server, but it does not appear to be SSL related as you normally get a specific SSL error back when it is SSL related, usually ugly and unhelpful. Regards, Shane. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 JK2 and IIS 5
Thanks, I will try it, The install2iis,.js that Jakarta puts out bombs trying to find the web server root dir. ---Raymond On May 9, 2004, at 7:48 PM, Shane Linley wrote: Well to tell the complete truth, at my site here we used this open source JK2 IIS installer to do all the nitty gritty for us! http://www.shiftomat.com/opensource/ It doesn't use the latest version of JK2, but I don't see why a simple dll upgrade shouldn't fix that :) This is the easiest way I've seen to install JK2... Otherwise I know of no other way to help you at the moment... shane.. -Original Message- From: Raymond Blum [mailto:[EMAIL PROTECTED] Sent: Friday, 7 May 2004 8:23 PM To: Tomcat Users List Subject: Re: Tomcat 5 JK2 and IIS 5 Yes, I am running the ajp connectors at 8009, the 8018 is where Tomcat is listening for HTTP requests instead of the default of 8080 I do have the entry you describe below ---Raymond On May 7, 2004, at 3:59 AM, Shane Linley wrote: From memory, Tomcat runs the default ajp13 connector off of port 8009 not 8080 which is the default HTTP connector port. You worker2.properties file should specify to use port 8009 for your ajp13 connector and not 8018. In your server.xml file look for an entry similar to: !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / to see what port your ajp13 connector is listening on. Regards, Shane. -Original Message- From: Raymond Blum [mailto:[EMAIL PROTECTED] Sent: Friday, 7 May 2004 12:00 PM To: Tomcat Users List Subject: Tomcat 5 JK2 and IIS 5 Hi I am struggling to get IIS 5.0 to pass off JSP and servlet context requests to tomcat 5.0.19 under Windows 2000.I have downloaded and installed what I believe to be a usable copy of isapi_redirector2,dll and have configured the virtual directory Jakarta under one of the web servers in my IIS server. Tomcat is running at 8018, not 8080 I can get to XXX.XXX.XXX.XXX:8018/servlet-examples/ just fine I map /servlet-examples/* to tomcat in workers2.properties and then I try the following XXX.XXX.XXX.XXX/servlet-examples which yields the response The servlet container is temporary unavailable or being upgraded (I have found that this message seems to come from mod_jk and it only is received in response to one of my mapped server paths, so I assume that the URI mapping is being successfully interpreted and that the problem is in my Tomcat and/or workers configuration) I portscan the machine at XXX.XXX.XXX.XXX and port 8009 is open so I assume that tomcat is there and listening. Any tips greatly appreciated! I have searched the archives and googled this a dozen ways. ---Raymond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDIRealm strangeness
Hi Shane ! Thanks for your help! After experimenting over the weekend, I think that this is probably a bug in the Tomcat code. I checked and corrected some problems in my OpenLDAP setup, and verified that SSL/TLS connections can be made successfully to it using ldapsearch. When I tried starting up Tomcat again, it gave me the same error. I think Tomcat may not be able to establish an encrypted connection to OpenLDAP. Unencrypted connections on port 389 seem to be ok. Incidentally, I'm also anal retentive (that, I am told, is a national characteristic of my country), and I tried ldaps://, but Tomcat will throw a parse error and will not accept the JNDI Realm parameters. They may have fixed it in the just-released 5.0.24, though. Thanks for your help, again ! I'm not on any specific timetable, so I don't need to fix this soon. I'll direct my question to the Tomcat developers and see if they are aware of the issue. Regards, pascal chong Shane Linley wrote: Hi, What happens on failed connections IS driver specific, but it should NOT BY DEFAULT switch to using a non SSL connection, for the sake of security if nothing else. The connection should tried to be established, if it fails then it should send back the appropriate naming exception. That said drivers do accept configuration properties to modify their behaviour, so technically anything is possible, based on your drivers documentation. I have never used OpenLDAP so its error logs don't really mean all that much to me, but having done similar things in the past you should look up your error codes in the OpenLDAP documentation (but its probably the OpenSSL doco) as to what the error codes really mean to work out what the problem is. I'm referring specifically to this line (as id does match up to the Request: 1 cancelled) message that the LDAP client driver reports. May 7 20:03:56 localhost slapd[6346]: connection_read(11): TLS accept error error=-1 id=0, closing Thats all I have! Good luck. Regards, Shane. P.S. The anal retentive part of me still wants you to specify the ldap connection as ldaps://server:636 but that is completely besides the point! :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Apache Tomcat 5.0.24 Stable released
The Tomcat Team announces the immediate availability of Apache Tomcat 5.0.24 Stable. Please refer to the changelog for the list of changes. Downloads: Binaries: http://jakarta.apache.org/site/binindex.cgi Sources: http://jakarta.apache.org/site/sourceindex.cgi The Apache Tomcat Team - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]