Re: Client authentication with X509 certificate (Apache web server+mod_jk+Tomcat4.1.24) not working
Hello, What a relief!! And I've seen that the patch for this bug is a one-liner... I will try to backport it to the stock 4.1.24 we were willing to use. Do you have an idea of the approx. release date for 4.1.25? Thank you very much for your help. Antonio Fiol Bill Barker wrote: It's a known problem. See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15790 for more details. It is fixed in the CVS, and so will work in 4.1.25. Antonio Fiol Bonnín [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have been struggling with a strange problem: Using Apache Web server (1.3.23 - 1.3.26, not tested others). Using mod_jk (EAPI version, recent download). On a Linux machine. Using tomcat 4.1.24 Both on solaris and on Linux. When Apache is configured with SSLClientVerify optional or SSLClientVerify require Mod_jk is correctly configured (see why I say that later). Tomcat is configured with an AJP13 context, and responding well. PROBLEM: Client certificate cannot be obtained from the application. PROBLEM: In fact, there is an IOException *before* calling the servlet. PROBLEM: When tomcat is reconstructing the certificate. I get: Insufficient data ...or... too big WORKAROUND: I found that the same configuration on Tomcat 4.1.9 is working perfectly. I have been studying the differences between 4.1.9 and 4.1.24 and I have seen that certificate handling is done in very different places in the code (it has moved). Does anybody have an idea of what can have broken this? I am willing to submit a patch and/or do more investigation, so that this problem id fixed on 4.1.25 when it comes out. Yours sincerely, Antonio Fiol smime.p7s Description: S/MIME Cryptographic Signature
RE: JNDI DataSource
Thanks Micheal. Actually, I did put the jar that contains the driver in $CATALINA_HOME/common/lib. So, I guess I'll just try what you recommended and if it works, then I think I'll switch to a different driver and test to see if this is a driver specific thing. Maybe no one tried that driver ever before. Thanks, Tarek Nabil -Original Message- From: Tam, Michael [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 9:18 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource You didn't mention about your jdbc jar file in your post and maybe you should check where did you put the jar file. In addition, you may want to try a simple jsp to use driver manager to obtain a connection to see if your jdbc lib is loaded. Cheers, Michael -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 10:57 AM To: Phillip Qin; Tomcat Users List Subject: RE: JNDI DataSource Hi Philip, I checked, and the URL thing is driver specific. For the driver I'm using, the format is jdbc:as400:machineName and that's what I'm using. The strange thing is the error message Cannot load JDBC driver class 'null'. Why does Tomcat see the dirver as null, although I have specified it in the ResourceParams. Thanks, Tarek Nabil -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 8:19 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource Replace your url with fully qualified url, in Oracle I use jdbc:oracle:thin:@myhost.myudomain.com:port:sid -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: June 12, 2003 1:09 PM To: 'Tomcat Users List' (E-mail) Subject: JNDI DataSource Hi, I'm trying to setup a JDBC DataSource on Tomcat 4.1.24. I performed the steps in the documentation: 1- Added this part to the GlobalNamingResources section of the server.xml Resource name=jdbc/as400 scope=Shareable type=javax.sql.DataSource auth=Container/ Resource name=UserDatabase scope=Shareable type=org.apache.catalina.UserDatabase auth=Container description=User database that can be updated and saved/ ResourceParams name=jdbc/as400 parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value8/value /parameter parameter nameurl/name valuejdbc:as400:AS400/value /parameter parameter namepassword/name valueaccess2k/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter namemaxIdle/name value4/value /parameter parameter nameusername/name valueDBA/value /parameter /ResourceParams ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams 2- I added this to my web.xml resource-ref description Resource reference to a factory for java.sql.Connection instances that talk to an AS400 database /description res-ref-name jdbc/as400 /res-ref-name res-type javax.sql.DataSource /res-type res-auth Container /res-auth /resource-ref 3- I put this in a JSP %@ page import=javax.naming.*, java.sql.*, javax.sql.* % % Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/as400); Connection conn = ds.getConnection(); conn.close(); % And Still, I get the following error when accessing the JSP type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Cannot load JDBC driver class 'null' at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643)
Re: Need to restart tomcat very frequently
Paridhi Bansal typed the following on 13:25 14/06/2003 -0500 In our case,high no. of concurrent requests is not requireqd. no multithreading is being used at servlet end. So i have put maxProcessors in server.xml to 30..however, whenevr i start tomcat, it starts with 9 java threads that increase to 24 within seconds..WHY is this so? This is normal for Tomcat, which uses many threads for its operations; it gets a bunch ready to handle incoming requests, for example. It's not relevant to your problem. when i open the applicaions frequently, tomcat starts behaving erratically..no. of threads is ususlly b/w 28-29..sometimes i get the applet displaying the empty table but no data, sometimes i am not able to save the data...sometimes, tomcat gives socket exception..WHY does it behaves like this?On restarting tomcat, things start working fine... It's hard to guess what's wrong with your application, although it's most certainly due to your application's coding. Are you writing thread-safe code, i.e. being careful with class variables and static variables so multiple threads accessing the application at the same time aren't getting their data confused? Where are the socket exceptions coming from, there may be a problem with your database related code. Kief - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FormAuthenticator, Implementation question
The method authenticate() of the FormAuthenticator class does a redirect after getting the requestURI (savedRequestURL) (line 293). I don't understand why you just restore the request ( restoreRequest() ) without a redirect. // Redirect the user to the original request URI (which will cause // the original request to be restored) requestURI = savedRequestURL(session); if (debug = 1) log(Redirecting to original ' + requestURI + '); if (requestURI == null) hres.sendError(HttpServletResponse.SC_BAD_REQUEST, sm.getString(authenticator.formlogin)); else hres.sendRedirect(hres.encodeRedirectURL(requestURI)); return (false); *** BITTE BEACHTEN *** Diese Nachricht (wie auch allfällige Anhänge dazu) beinhaltet möglicherweise vertrauliche oder gesetzlich geschützte Daten oder Informationen. Zum Empfang derselben ist (sind) ausschliesslich die genannte(n) Person(en) bestimmt. Falls Sie diese Nachricht irrtümlicherweise erreicht hat, sind Sie höflich gebeten, diese unter Ausschluss jeder Reproduktion zu zerstören und die absendende Person umgehend zu benachrichtigen. Vielen Dank für Ihre Hilfe. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NoClassDefFoundError (error500) ... with external package
Hi i have problem with ClassLoader imagine this situation i have two jar files (pack1, and pack2) first is used from jsp ... i've in pack1 f.e. one interface (MyInter) and one class (JarClassLoader extended from ClassLoader) pack1.jar i have defined as package headline; in the second pack2.jar i have class (Hmmm) which implements interface from pack1 it look's like import headline.*; public class Hmmm implements MyInter { ... ... ... } i want to load class (Hmmm) that implemented class from pack2.jar (dynamicaly by reading bytes from file and using defineClass) i used for it JarClassLoader but it failed on defineClass with throwing NoClassDefFoundError headline/MyInter not found structure of directory scheme -- MyJsp | -- myapp.jsp (this jsp imports pack1 and then class function to load class from pack2 byt JarClassLoader ) | -- WEB-INF | -- lib | -- pack1.jar (package headline) | -- pack2.jar when i use this code from standalone app it works but in jsp not ... thx for reply Anna HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: headline/MyInterf at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException: net/sourceforge/headlines/Headline at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536) at org.apache.jsp.java_jsp._jspService(java_jsp.java:77) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at
Re: NoClassDefFoundError (error500) ... with external package
On Sun, 15 Jun 2003 20:37, [EMAIL PROTECTED] wrote: net/sourceforge/headlines/Headline Do you have another .jar file hanging around with the above in it? Either in WEB-INF/lib or common/lib? NoClassDefFoundError basically means Tomcat is getting confused by multiple classes with the same name, not that it can't be found, the Def(inition) part is the important part... Regards, -- Jason Bainbridge http://jblinux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDI DataSource
Hi everyone, I just managed to get this working. Obviously, it doesn't work if I put the Resource and Resource-params tags inside the GlobalNamingResources element, even if I create another Resource entry inside the Context element. Someone once mentioned that maybe the tag inside the Context element should be the Resource-ref tag, not the Context tag, but I really didn't know the syntax for this one, so I couldn't try it. Now, it works only if I put both the Resource and Resource-params tags inside the Context element of my application. I find this rather limiting, because most of the time, I don't wanna create a Context element for my application. I think there must be some other way to do this, but I guess I don't know it. The wierdest thing is, I DIDN'T need to add a Resource-ref element in my web.xml What's this entry for anyway? One other question I have is, do we have some sort of documentation or a DTD for this server.xml file that we check for available elements and their attributes. Thanks a lot for your help. Tarek Nabil -Original Message- From: Tarek M. Nabil Sent: Sunday, June 15, 2003 12:45 PM To: 'Tam, Michael'; 'Tomcat Users List' Subject: RE: JNDI DataSource Thanks Micheal. Actually, I did put the jar that contains the driver in $CATALINA_HOME/common/lib. So, I guess I'll just try what you recommended and if it works, then I think I'll switch to a different driver and test to see if this is a driver specific thing. Maybe no one tried that driver ever before. Thanks, Tarek Nabil -Original Message- From: Tam, Michael [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 9:18 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource You didn't mention about your jdbc jar file in your post and maybe you should check where did you put the jar file. In addition, you may want to try a simple jsp to use driver manager to obtain a connection to see if your jdbc lib is loaded. Cheers, Michael -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 10:57 AM To: Phillip Qin; Tomcat Users List Subject: RE: JNDI DataSource Hi Philip, I checked, and the URL thing is driver specific. For the driver I'm using, the format is jdbc:as400:machineName and that's what I'm using. The strange thing is the error message Cannot load JDBC driver class 'null'. Why does Tomcat see the dirver as null, although I have specified it in the ResourceParams. Thanks, Tarek Nabil -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 8:19 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource Replace your url with fully qualified url, in Oracle I use jdbc:oracle:thin:@myhost.myudomain.com:port:sid -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: June 12, 2003 1:09 PM To: 'Tomcat Users List' (E-mail) Subject: JNDI DataSource Hi, I'm trying to setup a JDBC DataSource on Tomcat 4.1.24. I performed the steps in the documentation: 1- Added this part to the GlobalNamingResources section of the server.xml Resource name=jdbc/as400 scope=Shareable type=javax.sql.DataSource auth=Container/ Resource name=UserDatabase scope=Shareable type=org.apache.catalina.UserDatabase auth=Container description=User database that can be updated and saved/ ResourceParams name=jdbc/as400 parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value8/value /parameter parameter nameurl/name valuejdbc:as400:AS400/value /parameter parameter namepassword/name valueaccess2k/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter namemaxIdle/name value4/value /parameter parameter nameusername/name valueDBA/value /parameter /ResourceParams ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams 2- I added this to my web.xml resource-ref description Resource reference to a factory for java.sql.Connection instances that talk to an AS400 database /description res-ref-name jdbc/as400 /res-ref-name res-type javax.sql.DataSource /res-type res-auth Container /res-auth /resource-ref 3- I put this in a JSP %@ page import=javax.naming.*, java.sql.*, javax.sql.* % % Context initCtx = new
OFFTopic: Jsp vs velocity templates
Hi, I am wondering about the performance difference between Velocity templates and JSP. A test made by Rickard Öberg in Aug. 2001, was showing the difference being : JSP - 240-480ms Velocity - 50-70ms Since a lot has changed in tomcat and jsp. Has anyone any figures on what the difference is right now ? Is velocity still a lot faster ? Thanx, -reynir - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat 4.1.24 on windows xp and j2sdk1.4.1_01
Hi, Greetings, We have installed tomcat 4.1.24 on windows xp and j2sdk1.4.1_01 and since then we couldn't access any jsp file. jasper always fails with the following exception reports. Rgds, Sen Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] javac: invalid flag: C:\Program [javac] Usage: javac options source files [javac] where possible options include: [javac] -gGenerate all debugging info [javac] -g:none Generate no debugging info [javac] -g:{lines,vars,source}Generate only some debugging info [javac] -nowarn Generate no warnings [javac] -verbose Output messages about what the compiler is doing [javac] -deprecation Output source locations where deprecated APIs are used [javac] -classpath path Specify where to find user class files [javac] -sourcepath pathSpecify where to find input source files [javac] -bootclasspath path Override location of bootstrap class files [javac] -extdirs dirs Override location of installed extensions [javac] -d directorySpecify where to place generated class files [javac] -encoding encoding Specify character encoding used by source files [javac] -source release Provide source compatibility with specified release [javac] -target release Generate class files for specific VM version [javac] -help Print a synopsis of standard options at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav a:1014) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr ocessor.java:417) at org.apache.struts.action.RequestProcessor.processActionForward(RequestPr ocessor.java:390) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 271) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
Re: OFFTopic: Jsp vs velocity templates
I have not run benchmarks (or use velocity) but velocity will probably still be faster. Velocity will run faster on tomcat 3 than tomcat 4 or 5. This is mainly due to constraints imposed by the servlet specification that extra checks need to be done as well as certain assumptions (don't ask can't remember) don't hold for servlet spec 2.2 vs 2.3 and 2.4. Of course since 2001, computers speeds have increased so running the same benchmark on a newer computer might skew the results. Since the introduction of JSTL (and better support for EL in JSP2.0) - I'd be curious to see rewritten pages(to reflect enhancements made to both display models) and a new benchmark. -Tim Reynir Hübner wrote: Hi, I am wondering about the performance difference between Velocity templates and JSP. A test made by Rickard Öberg in Aug. 2001, was showing the difference being : JSP - 240-480ms Velocity - 50-70ms Since a lot has changed in tomcat and jsp. Has anyone any figures on what the difference is right now ? Is velocity still a lot faster ? Thanx, -reynir - 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: NoClassDefFoundError (error500) ... with external package
No ... i don't have any others jars ... and i didn't set classpath or other variables Thence i'm confused ... I'm attaching sample for better recognition Anna ### test.jsp ## %@ page language=java % %@ page import=java.util.*, java.io.*, java.net.*, java.text.*, java.lang.*, java.util.jar.*, headline.* % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleUntitled/title /head body % String szPath = removedpath\\MyJsp\\WEB-INF\\plugins; FileClassLoader c = new FileClassLoader(szPath); c.load(Hmmm, true); % /body /html MyInter.java # package headline; public interface MyInter { public void Test(); } ### FileClassLoader ### package headline; import java.io.*; public class FileClassLoader extends ClassLoader { private String basePath; public FileClassLoader(String basePath) { this.basePath = basePath; } public Class load(String typeName, boolean resolveIt) throws ClassNotFoundException { Class result = findLoadedClass(typeName); if (result != null) { return result; } byte typeData[] = getTypeFromBasePath(typeName); if (typeData == null) { throw new ClassNotFoundException(); } result = defineClass(typeName, typeData, 0, typeData.length); if (result == null) { throw new ClassFormatError(); } if (resolveIt) { resolveClass(result); } return result; } private byte[] getTypeFromBasePath(String typeName) { FileInputStream fis; String fileName = basePath + File.separatorChar + typeName.replace('.', File.separatorChar) + .class; try { fis = new FileInputStream(fileName); } catch (FileNotFoundException e) { return null; } BufferedInputStream bis = new BufferedInputStream(fis); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { int c = bis.read(); while (c != -1) { out.write(c); c = bis.read(); } } catch (IOException e) { return null; } return out.toByteArray(); } } Hmmm.java import headline.*; public class Hmmm implements MyInter{ public void Test(){ } } file listing ## -- MyJsp | -- test.jsp | -- WEB-INF | -- classes | | | -- headline | | | -- FileClassLoader.class | | | -- MyInter.class | -- plugins | -- Hmmm.class
Singleton across multiple contexts
Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol smime.p7s Description: S/MIME Cryptographic Signature
Re: tomcat 4.1.24 on windows xp and j2sdk1.4.1_01
On Sun, 15 Jun 2003 21:24, Senthivel U S wrote: Hi, Greetings, We have installed tomcat 4.1.24 on windows xp and j2sdk1.4.1_01 and since then we couldn't access any jsp file. jasper always fails with the following exception reports. G'day, Your path is getting chomped at the space, either try setting your environment variables (CATALINA_HOME, TOMCAT_HOME, JAVA_HOME) within double quotes eg. C:\Program Files\Apache Group\Tomcat 4.1.24 or moving Tomcat to a path without spaces. Regards, -- Jason Bainbridge http://jblinux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError (error500) ... with external package
I'm guessing you have headlines.jar installed from: http://sourceforge.net/projects/headlines/ Given the error: root cause javax.servlet.ServletException: net/sourceforge/headlines/Headline Are you sure you don't have that anywhere Tomcat would be accessing it? Regards, -- Jason Bainbridge http://jblinux.org On Sun, 15 Jun 2003 22:48, Anna wrote: No ... i don't have any others jars ... and i didn't set classpath or other variables Thence i'm confused ... I'm attaching sample for better recognition Anna ### test.jsp ## %@ page language=java % %@ page import=java.util.*, java.io.*, java.net.*, java.text.*, java.lang.*, java.util.jar.*, headline.* % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleUntitled/title /head body % String szPath = removedpath\\MyJsp\\WEB-INF\\plugins; FileClassLoader c = new FileClassLoader(szPath); c.load(Hmmm, true); % /body /html MyInter.java # package headline; public interface MyInter { public void Test(); } ### FileClassLoader ### package headline; import java.io.*; public class FileClassLoader extends ClassLoader { private String basePath; public FileClassLoader(String basePath) { this.basePath = basePath; } public Class load(String typeName, boolean resolveIt) throws ClassNotFoundException { Class result = findLoadedClass(typeName); if (result != null) { return result; } byte typeData[] = getTypeFromBasePath(typeName); if (typeData == null) { throw new ClassNotFoundException(); } result = defineClass(typeName, typeData, 0, typeData.length); if (result == null) { throw new ClassFormatError(); } if (resolveIt) { resolveClass(result); } return result; } private byte[] getTypeFromBasePath(String typeName) { FileInputStream fis; String fileName = basePath + File.separatorChar + typeName.replace('.', File.separatorChar) + .class; try { fis = new FileInputStream(fileName); } catch (FileNotFoundException e) { return null; } BufferedInputStream bis = new BufferedInputStream(fis); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { int c = bis.read(); while (c != -1) { out.write(c); c = bis.read(); } } catch (IOException e) { return null; } return out.toByteArray(); } } Hmmm.java import headline.*; public class Hmmm implements MyInter{ public void Test(){ } } file listing ## -- MyJsp -- test.jsp -- WEB-INF -- classes | -- headline | | -- FileClassLoader.class | | -- MyInter.class -- plugins -- Hmmm.class - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NoClassDefFoundError (error500) ... with external package
yes ... i tryed source from this project but i don't have any headlines.jar in classpaths/libpaths of tomcat and as you saw i attached listings of files and i tested this simple sample (if your want you can try it) which don't have any references to project from sourceforge and it makes me same error Anna ...
Re: Singleton across multiple contexts
Look in the archives and search for past Singleton discussions. http://marc.theaimsgroup.com/?l=tomcat-userw=2r=1s=singletonq=b http://marc.theaimsgroup.com/?l=tomcat-devw=2r=1s=singletonq=b Otherwise ... - EJB (???) - Use a custom JNDI Factory (see tomcat jndi docs) -Tim Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError (error500) ... with external package
On Mon, 16 Jun 2003 00:14, Anna wrote: yes ... i tryed source from this project but i don't have any headlines.jar in classpaths/libpaths of tomcat Sorry but I don't believe you. :) Otherwise where did that error come from? Just do a search for headlines.jar I'm sure you've missed it, either that or you have expanded it into your WEB-INF/classes directory. Regards, -- Jason Bainbridge http://jblinux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Singleton across multiple contexts
Hi Antonio, - Extract the component into a separate JVM, and connect to it via socket. This is what I'd do, but I'd also write a client class to get access. I suppose you could use RMI or something, but I'm not familiar with that. Whatever you're comfortable with, I guess. You could also spin off this class in it's own thread inside one of your classloaders. That way it would shutdown and start up with the server (or maybe that's a drawback...) and you wouldn't have to add the overhead of another VM. - Extract the component into another context, and connect to it via HTTP. yuck. This isn't for locking or something is it? I get the feeling you're trying to use a class for storing or accessing something the way most people use a database... On Sun, 2003-06-15 at 08:21, Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol -- Mike Johnson [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDI DataSource
Thanks Achal, that really helped. -Original Message- From: Prabhakar, Achal [mailto:[EMAIL PROTECTED] Sent: Sunday, June 15, 2003 8:36 PM To: Tarek M. Nabil Subject: RE: JNDI DataSource The server.xml elements and attributes are documented here: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/index.html Regards, -Achal -Original Message- From: Tarek M. Nabil To: Tomcat Users List Sent: 6/15/2003 8:04 AM Subject: RE: JNDI DataSource Hi everyone, I just managed to get this working. Obviously, it doesn't work if I put the Resource and Resource-params tags inside the GlobalNamingResources element, even if I create another Resource entry inside the Context element. Someone once mentioned that maybe the tag inside the Context element should be the Resource-ref tag, not the Context tag, but I really didn't know the syntax for this one, so I couldn't try it. Now, it works only if I put both the Resource and Resource-params tags inside the Context element of my application. I find this rather limiting, because most of the time, I don't wanna create a Context element for my application. I think there must be some other way to do this, but I guess I don't know it. The wierdest thing is, I DIDN'T need to add a Resource-ref element in my web.xml What's this entry for anyway? One other question I have is, do we have some sort of documentation or a DTD for this server.xml file that we check for available elements and their attributes. Thanks a lot for your help. Tarek Nabil -Original Message- From: Tarek M. Nabil Sent: Sunday, June 15, 2003 12:45 PM To: 'Tam, Michael'; 'Tomcat Users List' Subject: RE: JNDI DataSource Thanks Micheal. Actually, I did put the jar that contains the driver in $CATALINA_HOME/common/lib. So, I guess I'll just try what you recommended and if it works, then I think I'll switch to a different driver and test to see if this is a driver specific thing. Maybe no one tried that driver ever before. Thanks, Tarek Nabil -Original Message- From: Tam, Michael [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 9:18 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource You didn't mention about your jdbc jar file in your post and maybe you should check where did you put the jar file. In addition, you may want to try a simple jsp to use driver manager to obtain a connection to see if your jdbc lib is loaded. Cheers, Michael -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 10:57 AM To: Phillip Qin; Tomcat Users List Subject: RE: JNDI DataSource Hi Philip, I checked, and the URL thing is driver specific. For the driver I'm using, the format is jdbc:as400:machineName and that's what I'm using. The strange thing is the error message Cannot load JDBC driver class 'null'. Why does Tomcat see the dirver as null, although I have specified it in the ResourceParams. Thanks, Tarek Nabil -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 8:19 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource Replace your url with fully qualified url, in Oracle I use jdbc:oracle:thin:@myhost.myudomain.com:port:sid -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: June 12, 2003 1:09 PM To: 'Tomcat Users List' (E-mail) Subject: JNDI DataSource Hi, I'm trying to setup a JDBC DataSource on Tomcat 4.1.24. I performed the steps in the documentation: 1- Added this part to the GlobalNamingResources section of the server.xml Resource name=jdbc/as400 scope=Shareable type=javax.sql.DataSource auth=Container/ Resource name=UserDatabase scope=Shareable type=org.apache.catalina.UserDatabase auth=Container description=User database that can be updated and saved/ ResourceParams name=jdbc/as400 parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value8/value /parameter parameter nameurl/name valuejdbc:as400:AS400/value /parameter parameter namepassword/name valueaccess2k/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter namemaxIdle/name value4/value /parameter parameter nameusername/name valueDBA/value /parameter /ResourceParams ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams 2- I added this to my web.xml resource-ref description Resource reference to a factory for java.sql.Connection instances that talk to an AS400
Re: Singleton across multiple contexts
- Extract the component into a separate JVM, and connect to it via socket. This is what I'd do, but I'd also write a client class to get access. I suppose you could use RMI or something, but I'm not familiar with that. Whatever you're comfortable with, I guess. You could also spin off this class in it's own thread inside one of your classloaders. That way it would shutdown and start up with the server (or maybe that's a drawback...) and you wouldn't have to add the overhead of another VM. In fact, it *is* a thread. It starts and stops with the server. Everything was really beautiful until I had to split my app in four contexts. What I dislike is having to go out of the app to do app-internal calls. RMI, socket, CORBA, HTTP, ... I don't mind: I just dislike the idea. - Extract the component into another context, and connect to it via HTTP. yuck. This isn't for locking or something is it? Nope. ;-) I get the feeling you're trying to use a class for storing or accessing something the way most people use a database... I do have a database. Databases are supposed to store data, aren't they? ;-) Now seriously... My application includes a web interface to a kind of workflow system. This component is the workflow engine, which is in charge for automatic (background) state changes and actions. When my business/persistence logic changes a state, new potential tasks for this engine arise. So it has to be notified (=called) from any context that may change a state. On Sun, 2003-06-15 at 08:21, Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol smime.p7s Description: S/MIME Cryptographic Signature
RE: Singleton across multiple contexts
I have not followed this thread, but putting the class in common/lib or shared/lib should make it a singleton across contexts Filip -Original Message- From: Antonio Fiol Bonnín [mailto:[EMAIL PROTECTED] Sent: Sunday, June 15, 2003 10:52 AM To: Tomcat Users List Subject: Re: Singleton across multiple contexts - Extract the component into a separate JVM, and connect to it via socket. This is what I'd do, but I'd also write a client class to get access. I suppose you could use RMI or something, but I'm not familiar with that. Whatever you're comfortable with, I guess. You could also spin off this class in it's own thread inside one of your classloaders. That way it would shutdown and start up with the server (or maybe that's a drawback...) and you wouldn't have to add the overhead of another VM. In fact, it *is* a thread. It starts and stops with the server. Everything was really beautiful until I had to split my app in four contexts. What I dislike is having to go out of the app to do app-internal calls. RMI, socket, CORBA, HTTP, ... I don't mind: I just dislike the idea. - Extract the component into another context, and connect to it via HTTP. yuck. This isn't for locking or something is it? Nope. ;-) I get the feeling you're trying to use a class for storing or accessing something the way most people use a database... I do have a database. Databases are supposed to store data, aren't they? ;-) Now seriously... My application includes a web interface to a kind of workflow system. This component is the workflow engine, which is in charge for automatic (background) state changes and actions. When my business/persistence logic changes a state, new potential tasks for this engine arise. So it has to be notified (=called) from any context that may change a state. On Sun, 2003-06-15 at 08:21, Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Singleton across multiple contexts
This is the best I could find: -- Each application is loaded with sepperate classloaders, so as long as the servlets are in the same application and the singleton is in it's classpath too it works. -- My singleton has to work *across* applications. Any ideas? Thank you very much. Antonio Fiol Tim Funk wrote: Look in the archives and search for past Singleton discussions. http://marc.theaimsgroup.com/?l=tomcat-userw=2r=1s=singletonq=b http://marc.theaimsgroup.com/?l=tomcat-devw=2r=1s=singletonq=b Otherwise ... - EJB (???) - Use a custom JNDI Factory (see tomcat jndi docs) -Tim Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature
Re: Singleton across multiple contexts
Antonio, remove your email digital certificate. Most of us can not answer your question since the reply forcing us to have a digital certificate as well. -Dan - Original Message - From: Filip Hanik [EMAIL PROTECTED] Newsgroups: Tomcat Sent: Sunday, June 15, 2003 10:59 AM Subject: RE: Singleton across multiple contexts I have not followed this thread, but putting the class in common/lib or shared/lib should make it a singleton across contexts Filip -Original Message- From: Antonio Fiol Bonnín [mailto:[EMAIL PROTECTED] Sent: Sunday, June 15, 2003 10:52 AM To: Tomcat Users List Subject: Re: Singleton across multiple contexts - Extract the component into a separate JVM, and connect to it via socket. This is what I'd do, but I'd also write a client class to get access. I suppose you could use RMI or something, but I'm not familiar with that. Whatever you're comfortable with, I guess. You could also spin off this class in it's own thread inside one of your classloaders. That way it would shutdown and start up with the server (or maybe that's a drawback...) and you wouldn't have to add the overhead of another VM. In fact, it *is* a thread. It starts and stops with the server. Everything was really beautiful until I had to split my app in four contexts. What I dislike is having to go out of the app to do app-internal calls. RMI, socket, CORBA, HTTP, ... I don't mind: I just dislike the idea. - Extract the component into another context, and connect to it via HTTP. yuck. This isn't for locking or something is it? Nope. ;-) I get the feeling you're trying to use a class for storing or accessing something the way most people use a database... I do have a database. Databases are supposed to store data, aren't they? ;-) Now seriously... My application includes a web interface to a kind of workflow system. This component is the workflow engine, which is in charge for automatic (background) state changes and actions. When my business/persistence logic changes a state, new potential tasks for this engine arise. So it has to be notified (=called) from any context that may change a state. On Sun, 2003-06-15 at 08:21, Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError (error500) ... with external package
I forgot mention that i get error returned from tomcat when i tested it on headlines from sourceforge but i in first my mail described it on finction sample and attached error listing .. and i rewrited it to headline/MyInter i forgot rewrite the second ocurence ... in root case my mistake ... this new report ... from the new sample ... could you pls test sample too ... HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: headline/MyInter at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException: headline/MyInter at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:536) at org.apache.jsp.java_jsp._jspService(java_jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at
Re: Singleton across multiple contexts
This seems a good idea. Would it be possible to reload this class without trashing the whole Tomcat? I don't think so... At least, I cannot imagine how it would be done. I have just come across another possibility: Store the singleton instance in the system properties. What do you think of this? Is it calling for trouble? Antonio Fiol (This time w/o certificate) Filip Hanik wrote: I have not followed this thread, but putting the class in common/lib or shared/lib should make it a singleton across contexts Filip -Original Message- From: Antonio Fiol Bonnín [mailto:[EMAIL PROTECTED] Sent: Sunday, June 15, 2003 10:52 AM To: Tomcat Users List Subject: Re: Singleton across multiple contexts - Extract the component into a separate JVM, and connect to it via socket. This is what I'd do, but I'd also write a client class to get access. I suppose you could use RMI or something, but I'm not familiar with that. Whatever you're comfortable with, I guess. You could also spin off this class in it's own thread inside one of your classloaders. That way it would shutdown and start up with the server (or maybe that's a drawback...) and you wouldn't have to add the overhead of another VM. In fact, it *is* a thread. It starts and stops with the server. Everything was really beautiful until I had to split my app in four contexts. What I dislike is having to go out of the app to do app-internal calls. RMI, socket, CORBA, HTTP, ... I don't mind: I just dislike the idea. - Extract the component into another context, and connect to it via HTTP. yuck. This isn't for locking or something is it? Nope. ;-) I get the feeling you're trying to use a class for storing or accessing something the way most people use a database... I do have a database. Databases are supposed to store data, aren't they? ;-) Now seriously... My application includes a web interface to a kind of workflow system. This component is the workflow engine, which is in charge for automatic (background) state changes and actions. When my business/persistence logic changes a state, new potential tasks for this engine arise. So it has to be notified (=called) from any context that may change a state. On Sun, 2003-06-15 at 08:21, Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol - 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: Singleton across multiple contexts
On Sun, 2003-06-15 at 10:51, Antonio Fiol Bonnín wrote: What I dislike is having to go out of the app to do app-internal calls. RMI, socket, CORBA, HTTP, ... I don't mind: I just dislike the idea. With good reason. :-) I do have a database. Databases are supposed to store data, aren't they? ;-) Application or workflow state is data, isn't it? Now seriously... My application includes a web interface to a kind of workflow system. This component is the workflow engine, which is in charge for automatic (background) state changes and actions. When my business/persistence logic changes a state, new potential tasks for this engine arise. So it has to be notified (=called) from any context that may change a state. The Tomcat user's list isn't the best place to discuss the design of your application, but it seems there's no good way to use a singleton across webapps. (Not that I searched the archives...) Also, I guess you are relying on method synchronization/instantiation to ensure that work gets done just once. That's one way of locking logic (the easiest) but -- as you know -- it falls apart when you use multiple classloaders. But there are other ways of locking, external file locks or maybe database bits you can use to keep tack of state and future actions. The only other thing I can suggest is to consider your options carefully before continuing. I don't have a clear understanding of what you've already designed, but I'd avoid doing something hackish like sockets inside Tomcat at pretty much any cost. If it can't be avoided, then I guess you write it and debug the snot out of it. Heck, I'd probably choose poll a queue table every three seconds before writing socket layers. :-) Anyway, you seem to know what you're doing, so good luck to you. -- Mike Johnson [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Embedding Tomcat with Java App and JRE only
Hi folks, I have read a article that explains how to embed the Tomcat with java app in O'Reily website. I will try to do it for my java app. But I want to do one step further which use JRE instead of JDK. Does anybody know if I pre-compile all jsp files, is it possible to embed the Tomcat with JRE only? Thanks! Billy Ng - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat classpath not set at boot
I've done some more testing and it doesn't have anything to do with starting Tomcat at boot as I first thought. The problem is that my servlet tries to connect to the X server when run. I have no idea why it needs to connect to the X server (It's a servlet that EspressReport wrote to connect to a database and generate a report.), but anyway this seems to be the problem. In order to get my servlet to work I need to do 'xhost + localhost' before Tomcat is started. I'm starting Tomcat as root and root is not allowed to connect to screen :0 by default since my user name owns it. I think if I started Tomcat with my user name and not root it would work, however, for some reason I can't start Tomcat this way. When I start Tomcat as a normal user it starts fine and ps -ef shows the java processes started by Tomcat, but after about 3 seconds all the processes quit and Tomcat is no longer running. Anyone have any idea why this would happen? As root Tomcat continues to run. On Sat, 14 Jun 2003, Tim Funk wrote: Is it just your servlet that doesn't work, or all servlets? (and jsps) Are you using different userids when run from boot time vs command line? What happens if your startup command is moved to inittab? (Or other wacky equivalent) -Tim Chad Lemmen wrote: It's not a system CLASSPATH I have set. I put the jar files I want in the CLASSPATH in $CATALINA_HOME/shared/lib. Tomcat does recognize these if I start Tomcat manually, but not if I have Tomcat staring at boot time with the script in /etc/rc.d/init.d On Fri, 13 Jun 2003, Tim Funk wrote: Tomcat ignores system CLASSPATH at startup and creates its own. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html -Tim Chad Lemmen wrote: I've got Tomcat 4.1.24 starting at boot on my Linux box with a script in /etc/rc.d/init.d. The script looks like this #!/bin/sh JAVA_HOME=/usr/java export JAVA_HOME /opt/jakarta-tomcat-4.1.24/bin/startup.sh Tomcat is starting at boot and seems to work fine http://localhost:8080 brings up the default Tomcat home page. The only thing that doesn't seem to be working is my classpaths that I set in the catalina.sh file are not being set. If I start Tomcat from the command line my classpaths are being read and my servlet works, but when starting Tomcat at boot my classpaths don't seem to be set because when I try to run my servlet I get java.lang.NoClassDefFoundError I don't get this error when Tomcat is started from the command line. Why would starting it at boot time not use my user set classpaths? Here is the portion of catalina.sh that I added my classpath to. # Add on extra jar files to CLASSPATH if [ -n $JSSE_HOME ]; then CLASSPATH=$CLASSPATH:$JSSE_HOME/lib/jcert.jar:$JSSE_HOME/lib/jnet.jar: $JSSE_HOME/lib/jsse.jar fi CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar: /opt/EspressReport/lib/ReportAPIWithChart.jar: /opt/EspressReport/lib/ExportLib.jar I also tried adding the two jar files ReportAPIWithChart.jar and ExportLib.jar to CATALINA_HOME/shared/lib Both methods work and my classpaths are set and my servlet works, but only if Tomcat is started from the command line CATALINA_HOME/bin/startup.sh. Why doesn't this work when starting at boot? - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Singleton across multiple contexts
Place the jar (or class) in common/lib (or common/classes) and all will be ok. That is - until you need to make a change to your singleton class (or a class used by it) - in which case you will need to restart tomcat. (and not restart your webapp) -Tim Antonio Fiol Bonnín wrote: This is the best I could find: -- Each application is loaded with sepperate classloaders, so as long as the servlets are in the same application and the singleton is in it's classpath too it works. -- My singleton has to work *across* applications. Any ideas? Thank you very much. Antonio Fiol Tim Funk wrote: Look in the archives and search for past Singleton discussions. http://marc.theaimsgroup.com/?l=tomcat-userw=2r=1s=singletonq=b http://marc.theaimsgroup.com/?l=tomcat-devw=2r=1s=singletonq=b Otherwise ... - EJB (???) - Use a custom JNDI Factory (see tomcat jndi docs) -Tim Antonio Fiol Bonnín wrote: Hello, This question is probably not specific to Tomcat, but a Tomcat-specific answer could well suit my needs. I have an application which I have split in several different contexts. I have done so, to allow different kinds of access to the app, depending on the web server the requests are coming from. However, I need a common unique component that ties all the contexts together. There must be a *single* instance of this component, otherwise inconsistencies or duplicate work might arise. OTOH, it must be accessible from all the contexts. Calls to this component are very simple (calls to void methods) but moderately frequent. I have thought of several possibilities: - Extract the component into a separate JVM, and connect to it via socket. - Extract the component into another context, and connect to it via HTTP. --- I like none of those. - Create the instance from the first context needing it, and making it available to all of them. --- I like this best, but I have no idea of how to do that. Yours sincerely, Antonio Fiol - 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 classpath not set at boot
Ouch! wacky issues between java and X. The archives have talked about similar items and I am sure there are google links talking about use X with java. Otherwise - I am pretty clueless on the topic. -Tim Chad Lemmen wrote: I've done some more testing and it doesn't have anything to do with starting Tomcat at boot as I first thought. The problem is that my servlet tries to connect to the X server when run. I have no idea why it needs to connect to the X server (It's a servlet that EspressReport wrote to connect to a database and generate a report.), but anyway this seems to be the problem. In order to get my servlet to work I need to do 'xhost + localhost' before Tomcat is started. I'm starting Tomcat as root and root is not allowed to connect to screen :0 by default since my user name owns it. I think if I started Tomcat with my user name and not root it would work, however, for some reason I can't start Tomcat this way. When I start Tomcat as a normal user it starts fine and ps -ef shows the java processes started by Tomcat, but after about 3 seconds all the processes quit and Tomcat is no longer running. Anyone have any idea why this would happen? As root Tomcat continues to run. On Sat, 14 Jun 2003, Tim Funk wrote: Is it just your servlet that doesn't work, or all servlets? (and jsps) Are you using different userids when run from boot time vs command line? What happens if your startup command is moved to inittab? (Or other wacky equivalent) -Tim Chad Lemmen wrote: It's not a system CLASSPATH I have set. I put the jar files I want in the CLASSPATH in $CATALINA_HOME/shared/lib. Tomcat does recognize these if I start Tomcat manually, but not if I have Tomcat staring at boot time with the script in /etc/rc.d/init.d On Fri, 13 Jun 2003, Tim Funk wrote: Tomcat ignores system CLASSPATH at startup and creates its own. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html -Tim Chad Lemmen wrote: I've got Tomcat 4.1.24 starting at boot on my Linux box with a script in /etc/rc.d/init.d. The script looks like this #!/bin/sh JAVA_HOME=/usr/java export JAVA_HOME /opt/jakarta-tomcat-4.1.24/bin/startup.sh Tomcat is starting at boot and seems to work fine http://localhost:8080 brings up the default Tomcat home page. The only thing that doesn't seem to be working is my classpaths that I set in the catalina.sh file are not being set. If I start Tomcat from the command line my classpaths are being read and my servlet works, but when starting Tomcat at boot my classpaths don't seem to be set because when I try to run my servlet I get java.lang.NoClassDefFoundError I don't get this error when Tomcat is started from the command line. Why would starting it at boot time not use my user set classpaths? Here is the portion of catalina.sh that I added my classpath to. # Add on extra jar files to CLASSPATH if [ -n $JSSE_HOME ]; then CLASSPATH=$CLASSPATH:$JSSE_HOME/lib/jcert.jar:$JSSE_HOME/lib/jnet.jar: $JSSE_HOME/lib/jsse.jar fi CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar: /opt/EspressReport/lib/ReportAPIWithChart.jar: /opt/EspressReport/lib/ExportLib.jar I also tried adding the two jar files ReportAPIWithChart.jar and ExportLib.jar to CATALINA_HOME/shared/lib Both methods work and my classpaths are set and my servlet works, but only if Tomcat is started from the command line CATALINA_HOME/bin/startup.sh. Why doesn't this work when starting at boot? - 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] - 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 classpath not set at boot
It's something about running tomcat headless I think. http://sourceforge.net/forum/forum.php?thread_id=859094forum_id=192228 Try adding this to the tomcat startup scripts : -Djava.awt.headless=true (which you can only do with JDK1.4 or higher) . Tim Funk wrote: Ouch! wacky issues between java and X. The archives have talked about similar items and I am sure there are google links talking about use X with java. Otherwise - I am pretty clueless on the topic. -Tim Chad Lemmen wrote: I've done some more testing and it doesn't have anything to do with starting Tomcat at boot as I first thought. The problem is that my servlet tries to connect to the X server when run. I have no idea why it needs to connect to the X server (It's a servlet that EspressReport wrote to connect to a database and generate a report.), but anyway this seems to be the problem. In order to get my servlet to work I need to do 'xhost + localhost' before Tomcat is started. I'm starting Tomcat as root and root is not allowed to connect to screen :0 by default since my user name owns it. I think if I started Tomcat with my user name and not root it would work, however, for some reason I can't start Tomcat this way. When I start Tomcat as a normal user it starts fine and ps -ef shows the java processes started by Tomcat, but after about 3 seconds all the processes quit and Tomcat is no longer running. Anyone have any idea why this would happen? As root Tomcat continues to run. On Sat, 14 Jun 2003, Tim Funk wrote: Is it just your servlet that doesn't work, or all servlets? (and jsps) Are you using different userids when run from boot time vs command line? What happens if your startup command is moved to inittab? (Or other wacky equivalent) -Tim Chad Lemmen wrote: It's not a system CLASSPATH I have set. I put the jar files I want in the CLASSPATH in $CATALINA_HOME/shared/lib. Tomcat does recognize these if I start Tomcat manually, but not if I have Tomcat staring at boot time with the script in /etc/rc.d/init.d On Fri, 13 Jun 2003, Tim Funk wrote: Tomcat ignores system CLASSPATH at startup and creates its own. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html -Tim Chad Lemmen wrote: I've got Tomcat 4.1.24 starting at boot on my Linux box with a script in /etc/rc.d/init.d. The script looks like this #!/bin/sh JAVA_HOME=/usr/java export JAVA_HOME /opt/jakarta-tomcat-4.1.24/bin/startup.sh Tomcat is starting at boot and seems to work fine http://localhost:8080 brings up the default Tomcat home page. The only thing that doesn't seem to be working is my classpaths that I set in the catalina.sh file are not being set. If I start Tomcat from the command line my classpaths are being read and my servlet works, but when starting Tomcat at boot my classpaths don't seem to be set because when I try to run my servlet I get java.lang.NoClassDefFoundError I don't get this error when Tomcat is started from the command line. Why would starting it at boot time not use my user set classpaths? Here is the portion of catalina.sh that I added my classpath to. # Add on extra jar files to CLASSPATH if [ -n $JSSE_HOME ]; then CLASSPATH=$CLASSPATH:$JSSE_HOME/lib/jcert.jar:$JSSE_HOME/lib/jnet.jar: $JSSE_HOME/lib/jsse.jar fi CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar: /opt/EspressReport/lib/ReportAPIWithChart.jar: /opt/EspressReport/lib/ExportLib.jar I also tried adding the two jar files ReportAPIWithChart.jar and ExportLib.jar to CATALINA_HOME/shared/lib Both methods work and my classpaths are set and my servlet works, but only if Tomcat is started from the command line CATALINA_HOME/bin/startup.sh. Why doesn't this work when starting at boot? - 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] - 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: tomcat4 shutdown problem
John, I am using Redhat7.3. It still has that error. Does it any affect for the applications if this error exists? unplug John Turner wrote: AFAIK, it is a timing issue, only on Solaris. The port binding is released before the shutdown is completely finished, which throws the error. I'm pretty certain it can be ignored until it is fixed. John On Thu, 12 Jun 2003 07:21:08 -0400, Tim Funk [EMAIL PROTECTED] wrote: Looks like this bug report. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20663 Does anyone know what this is? -Tim unplug wrote: Hi all, I am using tomcat4.1.24 but there is an exception during shutdown. When I issue catalina.sh stop, below exception shown in the catalina.out. It seems a socket connection problem. I am using the default server.xml without any modification. Does anyone know what wrong with it? How to solve it? Does it affect the performance with that exception exist? Thanks, unplug Stopping service Tomcat-Standalone Jun 12, 2003 11:05:40 AM org.apache.tomcat.util.net.PoolTcpEndpoint closeServerS ocket SEVERE: Caught exception trying to unlock accept. java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:434) at java.net.Socket.connect(Socket.java:384) at java.net.Socket.init(Socket.java:291) at java.net.Socket.init(Socket.java:119) at org.apache.tomcat.util.net.PoolTcpEndpoint.closeServerSocket(PoolTcpE ndpoint.java:326) at org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoi nt.java:397) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java :529) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:619) at java.lang.Thread.run(Thread.java:536) Jun 12, 2003 11:05:40 AM org.apache.tomcat.util.net.PoolTcpEndpoint closeServerS ocket SEVERE: Caught exception trying to close socket. java.lang.NullPointerException at org.apache.tomcat.util.net.PoolTcpEndpoint.closeServerSocket(PoolTcpE ndpoint.java:338) at org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoi nt.java:397) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java :529) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:619) at java.lang.Thread.run(Thread.java:536) Jun 12, 2003 11:05:40 AM org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket WARNING: Reinitializing ServerSocket ~ - 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] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - 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: Embedding Tomcat with Java App and JRE only
Yes - Original Message - From: Kwok Ng [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 16, 2003 8:16 AM Subject: Embedding Tomcat with Java App and JRE only Hi folks, I have read a article that explains how to embed the Tomcat with java app in O'Reily website. I will try to do it for my java app. But I want to do one step further which use JRE instead of JDK. Does anybody know if I pre-compile all jsp files, is it possible to embed the Tomcat with JRE only? Thanks! Billy Ng - 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]
Environment variables
I am using 4.1.24 in Win 2000. I pass an environment variable to Tomcat by adding set JAVA_OPTS=-Dmy.variable.name=... to catalina.bat and all is fine when I start Tomcat from a script that calls bin/startup.bat. However, if I start Tomcat from the menu item that is automatically created during installation it does not find the environment variable. The target in the menu item shortcut is ..\java.exe -jar -Duser.dir=c:\jakarta-tomcat-4 c:\jakarta-tomcat-4\bin\bootstrap.jar start Does this not use catalina.bat? Do I need to set the environment variable at a different location? Thanks, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat classpath not set at boot
I added -Djava.awt.headless=true to catalina.sh and it fixed the problem. Thanks for your help. On Mon, 16 Jun 2003, Kwok Peng Tuck wrote: It's something about running tomcat headless I think. http://sourceforge.net/forum/forum.php?thread_id=859094forum_id=192228 Try adding this to the tomcat startup scripts : -Djava.awt.headless=true (which you can only do with JDK1.4 or higher) . Tim Funk wrote: Ouch! wacky issues between java and X. The archives have talked about similar items and I am sure there are google links talking about use X with java. Otherwise - I am pretty clueless on the topic. -Tim Chad Lemmen wrote: I've done some more testing and it doesn't have anything to do with starting Tomcat at boot as I first thought. The problem is that my servlet tries to connect to the X server when run. I have no idea why it needs to connect to the X server (It's a servlet that EspressReport wrote to connect to a database and generate a report.), but anyway this seems to be the problem. In order to get my servlet to work I need to do 'xhost + localhost' before Tomcat is started. I'm starting Tomcat as root and root is not allowed to connect to screen :0 by default since my user name owns it. I think if I started Tomcat with my user name and not root it would work, however, for some reason I can't start Tomcat this way. When I start Tomcat as a normal user it starts fine and ps -ef shows the java processes started by Tomcat, but after about 3 seconds all the processes quit and Tomcat is no longer running. Anyone have any idea why this would happen? As root Tomcat continues to run. On Sat, 14 Jun 2003, Tim Funk wrote: Is it just your servlet that doesn't work, or all servlets? (and jsps) Are you using different userids when run from boot time vs command line? What happens if your startup command is moved to inittab? (Or other wacky equivalent) -Tim Chad Lemmen wrote: It's not a system CLASSPATH I have set. I put the jar files I want in the CLASSPATH in $CATALINA_HOME/shared/lib. Tomcat does recognize these if I start Tomcat manually, but not if I have Tomcat staring at boot time with the script in /etc/rc.d/init.d On Fri, 13 Jun 2003, Tim Funk wrote: Tomcat ignores system CLASSPATH at startup and creates its own. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html -Tim Chad Lemmen wrote: I've got Tomcat 4.1.24 starting at boot on my Linux box with a script in /etc/rc.d/init.d. The script looks like this #!/bin/sh JAVA_HOME=/usr/java export JAVA_HOME /opt/jakarta-tomcat-4.1.24/bin/startup.sh Tomcat is starting at boot and seems to work fine http://localhost:8080 brings up the default Tomcat home page. The only thing that doesn't seem to be working is my classpaths that I set in the catalina.sh file are not being set. If I start Tomcat from the command line my classpaths are being read and my servlet works, but when starting Tomcat at boot my classpaths don't seem to be set because when I try to run my servlet I get java.lang.NoClassDefFoundError I don't get this error when Tomcat is started from the command line. Why would starting it at boot time not use my user set classpaths? Here is the portion of catalina.sh that I added my classpath to. # Add on extra jar files to CLASSPATH if [ -n $JSSE_HOME ]; then CLASSPATH=$CLASSPATH:$JSSE_HOME/lib/jcert.jar:$JSSE_HOME/lib/jnet.jar: $JSSE_HOME/lib/jsse.jar fi CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar: /opt/EspressReport/lib/ReportAPIWithChart.jar: /opt/EspressReport/lib/ExportLib.jar I also tried adding the two jar files ReportAPIWithChart.jar and ExportLib.jar to CATALINA_HOME/shared/lib Both methods work and my classpaths are set and my servlet works, but only if Tomcat is started from the command line CATALINA_HOME/bin/startup.sh. Why doesn't this work when starting at boot? - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.lang.reflect.InvocationTargetException
Title: java.lang.reflect.InvocationTargetException -Original Message- From: Chuk, Jasmine WM Sent: Friday, June 13, 2003 3:52 PM To: '[EMAIL PROTECTED]' Subject: java.lang.reflect.InvocationTargetException Dear all, I am trying to enable SSL Support with JSSE in tomcat, but it fails at the starting up of tomcat. Following what is guided at http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ssl-howto.html, here are the steps i have taken: 1) Download and Install JSSE: copy all there JAR files jcert.jar, jnet.jar, jsse.jar into the $JAVA_HOME/lib/ext. 2) Generate a new Certificate Keystore !-- command line starts C:\scm\oum\Web-infkeytool -genkey -alias tomcat -keyalg RSA Enter keystore password: changeit What is your first and last name? [Unknown]: What is the name of your organizational unit? [Unknown]: What is the name of your organization? [Unknown]: What is the name of your City or Locality? [Unknown]: What is the name of your State or Province? [Unknown]: What is the two-letter country code for this unit? [Unknown]: Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct? [no]: yes Enter key password for tomcat (RETURN if same as keystore password): -- command line ends -- 3) Edit the Http10Connector definition in Tomcat Configuration File to Http10Connector port=8443 secure=true keystore=C:\Documents and Settings\798454\ keypass=changeit clientAuth=false / where the C:\Documents and Settings\798454\ is the user home directory and hence the file .keystore resides. 4) Start up Tomcat run $TOMCAT_HOME\bin\startup.bat !-- command line starts 2003-06-13 15:44:39 - Http10Interceptor: Setting ssl socket factory 2003-06-13 15:44:39 - ServerXmlReader: Config=$TOMCAT_HOME\conf\server.xml 2003-06-13 15:44:39 - PathSetter: home=C:\scm\tomcat\jakarta-tomcat-3.3 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-12 7.0.0.1.xml 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-ad min.xml 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-ex amples.xml 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-on line.xml 2003-06-13 15:44:39 - AutoWebApp: Loaded from config: DEFAULT:/admin 2003-06-13 15:44:39 - AutoWebApp: Loaded from config: DEFAULT:/examples 2003-06-13 15:44:39 - AutoWebApp: Auto-Adding DEFAULT:/ 2003-06-13 15:44:39 - ContextManager: Tomcat configured and in stable state 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/admin 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/examples 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/online 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/ROOT EmbededTomcat: Init time 875 Guessed home=C:\scm\tomcat\jakarta-tomcat-3.3 java.lang.reflect.InvocationTargetException: org.apache.tomcat.core.TomcatExcept ion: Root cause - C:\Documents and Settings\798454\ (Access is denied) at org.apache.tomcat.modules.server.PoolTcpConnector.engineStart(Unknown Source) at org.apache.tomcat.core.ContextManager.start(Unknown Source) at org.apache.tomcat.startup.EmbededTomcat.start(Unknown Source) at org.apache.tomcat.startup.EmbededTomcat.execute1(Unknown Source) at org.apache.tomcat.startup.EmbededTomcat$1.run(Unknown Source) at org.apache.tomcat.util.compat.Jdk12Support$PrivilegedProxy.run(Unknow n Source) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tomcat.util.compat.Jdk12Support.doPrivileged(Unknown Sourc e) at org.apache.tomcat.startup.EmbededTomcat.execute(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at org.apache.tomcat.util.IntrospectionUtils.execute(Unknown Source) at org.apache.tomcat.startup.Main.execute(Unknown Source) at org.apache.tomcat.startup.Main.main(Unknown Source) -- command line ends -- Please advise why is that exception throws. Thanks in advance. Regards, Jasmine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to restart tomcat very frequently
Hi!! Thanx for the reply..Actually In my case, though it's a web-based application but it's still at testing stage..there's max 1 user at a time..so there's no question of multiple threads accesing the code at atime..moreover, the servlet too just has a single thread for processing.. besides this, the application works fine most of the time,...it's only some times when i keep on closing and opening the application again and again, or when it's kept open for very long, things go wrong..at this time, when i try to shutdown tomcat, then also it gives netsocket exception..i have to forcefully shut it down using killall java and then restart it..Restarting tomcat makes thing start working fine again.. Paridhi - Original Message - From: Kief Morris [EMAIL PROTECTED] Date: Sun, 15 Jun 2003 12:58:09 +0100 To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Need to restart tomcat very frequently Paridhi Bansal typed the following on 13:25 14/06/2003 -0500 In our case,high no. of concurrent requests is not requireqd. no multithreading is being used at servlet end. So i have put maxProcessors in server.xml to 30..however, whenevr i start tomcat, it starts with 9 java threads that increase to 24 within seconds..WHY is this so? This is normal for Tomcat, which uses many threads for its operations; it gets a bunch ready to handle incoming requests, for example. It's not relevant to your problem. when i open the applicaions frequently, tomcat starts behaving erratically..no. of threads is ususlly b/w 28-29..sometimes i get the applet displaying the empty table but no data, sometimes i am not able to save the data...sometimes, tomcat gives socket exception..WHY does it behaves like this?On restarting tomcat, things start working fine... It's hard to guess what's wrong with your application, although it's most certainly due to your application's coding. Are you writing thread-safe code, i.e. being careful with class variables and static variables so multiple threads accessing the application at the same time aren't getting their data confused? Where are the socket exceptions coming from, there may be a problem with your database related code. Kief - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetExceptionThe keystore needs to be the full path to the keystore. In your case you need something like keystore=c:\documents and settings\798454\.keystore. Chuk, Jasmine WM [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -Original Message- From: Chuk, Jasmine WM Sent: Friday, June 13, 2003 3:52 PM To: '[EMAIL PROTECTED]' Subject:java.lang.reflect.InvocationTargetException Dear all, I am trying to enable SSL Support with JSSE in tomcat, but it fails at the starting up of tomcat. Following what is guided at http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ssl-howto.html, here are the steps i have taken: 1) Download and Install JSSE: copy all there JAR files jcert.jar, jnet.jar, jsse.jar into the $JAVA_HOME/lib/ext. 2) Generate a new Certificate Keystore !-- command line starts C:\scm\oum\Web-infkeytool -genkey -alias tomcat -keyalg RSA Enter keystore password: changeit What is your first and last name? [Unknown]: What is the name of your organizational unit? [Unknown]: What is the name of your organization? [Unknown]: What is the name of your City or Locality? [Unknown]: What is the name of your State or Province? [Unknown]: What is the two-letter country code for this unit? [Unknown]: Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct? [no]: yes Enter key password for tomcat (RETURN if same as keystore password): -- command line ends -- 3) Edit the Http10Connector definition in Tomcat Configuration File to Http10Connector port=8443 secure=true keystore=C:\Documents and Settings\798454\ keypass=changeit clientAuth=false / where the C:\Documents and Settings\798454\ is the user home directory and hence the file .keystore resides. 4) Start up Tomcat run $TOMCAT_HOME\bin\startup.bat !-- command line starts 2003-06-13 15:44:39 - Http10Interceptor: Setting ssl socket factory 2003-06-13 15:44:39 - ServerXmlReader: Config=$TOMCAT_HOME\conf\server.xml 2003-06-13 15:44:39 - PathSetter: home=C:\scm\tomcat\jakarta-tomcat-3.3 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-12 7.0.0.1.xml 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-ad min.xml 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-ex amples.xml 2003-06-13 15:44:39 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-on line.xml 2003-06-13 15:44:39 - AutoWebApp: Loaded from config: DEFAULT:/admin 2003-06-13 15:44:39 - AutoWebApp: Loaded from config: DEFAULT:/examples 2003-06-13 15:44:39 - AutoWebApp: Auto-Adding DEFAULT:/ 2003-06-13 15:44:39 - ContextManager: Tomcat configured and in stable state 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/admin 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/examples 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/online 2003-06-13 15:44:39 - ContextManager: Adding DEFAULT:/ROOT EmbededTomcat: Init time 875 Guessed home=C:\scm\tomcat\jakarta-tomcat-3.3 java.lang.reflect.InvocationTargetException: org.apache.tomcat.core.TomcatExcept ion: Root cause - C:\Documents and Settings\798454\ (Access is denied) at org.apache.tomcat.modules.server.PoolTcpConnector.engineStart(Unknown Source) at org.apache.tomcat.core.ContextManager.start(Unknown Source) at org.apache.tomcat.startup.EmbededTomcat.start(Unknown Source) at org.apache.tomcat.startup.EmbededTomcat.execute1(Unknown Source) at org.apache.tomcat.startup.EmbededTomcat$1.run(Unknown Source) at org.apache.tomcat.util.compat.Jdk12Support$PrivilegedProxy.run(Unknow n Source) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tomcat.util.compat.Jdk12Support.doPrivileged(Unknown Sourc e) at org.apache.tomcat.startup.EmbededTomcat.execute(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at org.apache.tomcat.util.IntrospectionUtils.execute(Unknown Source) at org.apache.tomcat.startup.Main.execute(Unknown Source) at org.apache.tomcat.startup.Main.main(Unknown Source) -- command line ends -- Please advise why is that exception throws. Thanks in advance. Regards, Jasmine -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]