calling native code
Hi, I am using tomcat 4.1.24 and want to use native c-code with JNI. I have a shared library installed in an oracle subdirectory that is added to the LD_LIBRARY_PATH when Apache is started (apachectl) but when I restart tomcat this directory is no longer in it which leads to a java.lang.UnsatisfiedLinkError: error. Where can I modify the LD_LIBRARY_PATH within tomcat ? When I restart Apache, the LD_LIBRARY_PATH is correct but I get a ClassDefNotFound exeception for the class that calls the c-interface (IprShellInterface.class package com.mot.sps.ipr.common). I have installed that class in CATALINA_HOME/common/classes/com/mot/sps/ipr/common/IprShellInterface.class. I called that class successfully before but now I seemed to have run into a deadlock. Can anyone help? Thanks Astrid
Re: calling native code
Hi, I just found out that setting the LD_LIBRARY_PATH var on the shell suffices. When I restart tomcat it takes it from there (working on Solaris 8). Still do not know why I had the ClassDefNotFound exeception after I restarted Apache though. It seems that I always have to go in order 1) Apache and then 2) Tomcat as far as starting is concerned ?! Thanks. Astrid Peter Guyatt wrote: Hi there, What OS are you using ? If windows just copy the dll to the windows/system32 directory or solaris to the use/lib directory. That way you dont have to specify the location of the library Thanks Pete -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: 05 April 2004 13:13 To: [EMAIL PROTECTED] Subject: calling native code Hi, I am using tomcat 4.1.24 and want to use native c-code with JNI. I have a shared library installed in an oracle subdirectory that is added to the LD_LIBRARY_PATH when Apache is started (apachectl) but when I restart tomcat this directory is no longer in it which leads to a java.lang.UnsatisfiedLinkError: error. Where can I modify the LD_LIBRARY_PATH within tomcat ? When I restart Apache, the LD_LIBRARY_PATH is correct but I get a ClassDefNotFound exeception for the class that calls the c-interface (IprShellInterface.class package com.mot.sps.ipr.common). I have installed that class in CATALINA_HOME/common/classes/com/mot/sps/ipr/common/IprShellInterface.class. I called that class successfully before but now I seemed to have run into a deadlock. Can anyone help? Thanks Astrid - 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: problems starting/stopping tomcat
Thanks. We rebooted the machine and until now (I keep my fingers crossed) it works again. Tomcat must have not shut down properly leaving me in a deadlock. Astrid Shapira, Yoav wrote: Howdy, Use netstat to see the status of ports. Tomcat uses at least two ports at runtime: the SHUTDOWN port (8005 by default) and the actual user connector ports (8080 and 8009 by default for tomcat 4.1.x). What likely happened was: - Your first tomcat instance (ports 8005 and 8080) did not shut down properly, most likely because you had non-daemon threads still running - When you changed to port 8081 and tried to start, you got the error because tomcat was still listening on port 8005 for shutdown. You need to change both ports, or better yet, fix the cause for tomcat not shutting down properly ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Saturday, September 13, 2003 4:33 AM To: [EMAIL PROTECTED] Subject: problems starting/stopping tomcat Hi , I use tomcat 4.1.24, jdk 1.4.0 and Apache 1.3 on Solaris 8. After having developed and successfully run many servlets I now receive a port 8080 already in use problem after I try to start tomcat. Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Sep 13, 2003 10:20:57 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Sep 13, 2003 10:21:00 AM org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint .jav a:280 ) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) I did not change any configuration and I do not think that the ports are in use by any other processes (Apache uses a different port). Could it be that while doing shutdown-startup sequences a process has been left hanging (?). When I replaced port 8080 by 8081 I was able to start tomcat but when I called a servlet it said 8005 (port for shutdown) in use ?! When I replaced also 8005 for test purposes the servlet hangs and I could not see any error being logged (catalina.out, web appl log files, Apache log ...). My question: how do I get more info about what ports tomcat still uses for what ? Any hint would be appreciated. Thanks. Astrid This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.lang.UnsatisfiedLinkError
Hi, I have three different web applications installed and running in three different modes (e.g. test, training ) but basically based on the same code otherwise. In all of them I use a native c library to call shell commands. When I test one web app everything works fine. When I switch to another web application I eventually receive the following error: root cause java.lang.UnsatisfiedLinkError: Native Library /home/oraedt/app/oracle/product/9iAS_1.0.2.2/lib/libIprShellInterface.so already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1444) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1404) at java.lang.Runtime.loadLibrary0(Runtime.java:772) at java.lang.System.loadLibrary(System.java:832) I installed the shared library libIprShellInterface.so into the databases lib directory which is included in the library path and where it is - normally - found. Does anyone know why I receive this error and how I can solve this problem? Thanks. Astrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.UnsatisfiedLinkError
Hi, Where do I set the java.library.path property for different webapps? Thanks. Astrid Astrid Wagner wrote: Hi, I have three different web applications installed and running in three different modes (e.g. test, training ) but basically based on the same code otherwise. In all of them I use a native c library to call shell commands. When I test one web app everything works fine. When I switch to another web application I eventually receive the following error: root cause java.lang.UnsatisfiedLinkError: Native Library /home/oraedt/app/oracle/product/9iAS_1.0.2.2/lib/libIprShellInterface.so already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1444) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1404) at java.lang.Runtime.loadLibrary0(Runtime.java:772) at java.lang.System.loadLibrary(System.java:832) I installed the shared library libIprShellInterface.so into the databases lib directory which is included in the library path and where it is - normally - found. Does anyone know why I receive this error and how I can solve this problem? Thanks. Astrid - 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: java.lang.UnsatisfiedLinkError
Thanks for the hint. But I do not quite understand the proposal: the shared libraries state should be reinitialized. How do I do that? Then: Something which could help is to avoid putting classes which would be referenced by a shared static field in the web application classloader, and put them in the shared classloader instead (the JARs should be put in the lib folder, and classes should be put in the classes folder). ?? Maybe you can tell me what this means in my example. My webapps use the class IprShellInterface which is in a shared library the following way: String shellResponse = IprShellInterface.executeCommand(...); Here a snippet from IprShellInterface.java: static { System.out.println([EMAIL PROTECTED]: The library path is set to: + System.getProperty(java.library.path)); try { System.loadLibrary(IprShellInterface); System.out.println([EMAIL PROTECTED]: Done loading library IprShellInterface); } catch (Exception e) { System.out.println([EMAIL PROTECTED]: Exception loading library IprShellInterface ... ); System.out.println(e.getMessage()); } public static String executeCommand(...) I compile the class into the shared library libIprShellInterface.so and right now install it in lib of the DB installation (included in the java.library.path variable). This means that all webapps take the same. If that is the reason for the problem wouldn't it be a solution to install it into the different webapps lib directories: ./webapps/iprweb-iprdev1/WEB-INF/lib/libIprShellInterface.so ./webapps/iprweb-iprdev2/WEB-INF/lib/libIprShellInterface.so ./webapps/iprweb-iprdev3/WEB-INF/lib/libIprShellInterface.so and have the java.library.path path be set individually for the webapps. Or is there only one for all applications? Where do I set the library path anyway? Sorry I just have too little info about how this works ... Thanks Astrid Tim Funk wrote: See the RELEASE NOTES under the section of shared libraries ... http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/RELEASE-NOTES-4.1.txt?rev=1.79content-type=text/vnd.viewcvs-markup -Tim Astrid Wagner wrote: Hi, Where do I set the java.library.path property for different webapps? Thanks. Astrid Astrid Wagner wrote: Hi, I have three different web applications installed and running in three different modes (e.g. test, training ) but basically based on the same code otherwise. In all of them I use a native c library to call shell commands. When I test one web app everything works fine. When I switch to another web application I eventually receive the following error: root cause java.lang.UnsatisfiedLinkError: Native Library /home/oraedt/app/oracle/product/9iAS_1.0.2.2/lib/libIprShellInterface.so already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1444) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1404) at java.lang.Runtime.loadLibrary0(Runtime.java:772) at java.lang.System.loadLibrary(System.java:832) I installed the shared library libIprShellInterface.so into the databases lib directory which is included in the library path and where it is - normally - found. Does anyone know why I receive this error and how I can solve this problem? Thanks. Astrid - 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: problems starting/stopping tomcat
Hi, Not again !! I ran into the same problem: SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:280) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.java:1117) at org.apache.catalina.core.StandardService.initialize(StandardService.java:579) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2246) not being able to get a clean state. Can you tell me how to look for status of ports and how I can kill those processes keeping thoses port occupied because I can not see tomcat process. netstat | grep 8080 returns nothing (I get sth. for 8005) but that is not why it fails??! I do not want to boot everytime I run into that problem .. Thanks Astrid Shapira, Yoav wrote: Howdy, I'm glad you're OK for now ;) Tomcat shuts down properly under normal circumstances. The only times when it doesn't is when webapps start non-daemon threads and don't terminate them properly. Sometimes your webapp doesn't do this directly but a 3rd party library used by your webapp does. Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:08 AM To: Tomcat Users List Subject: Re: problems starting/stopping tomcat Thanks. We rebooted the machine and until now (I keep my fingers crossed) it works again. Tomcat must have not shut down properly leaving me in a deadlock. Astrid Shapira, Yoav wrote: Howdy, Use netstat to see the status of ports. Tomcat uses at least two ports at runtime: the SHUTDOWN port (8005 by default) and the actual user connector ports (8080 and 8009 by default for tomcat 4.1.x). What likely happened was: - Your first tomcat instance (ports 8005 and 8080) did not shut down properly, most likely because you had non-daemon threads still running - When you changed to port 8081 and tried to start, you got the error because tomcat was still listening on port 8005 for shutdown. You need to change both ports, or better yet, fix the cause for tomcat not shutting down properly ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Saturday, September 13, 2003 4:33 AM To: [EMAIL PROTECTED] Subject: problems starting/stopping tomcat Hi , I use tomcat 4.1.24, jdk 1.4.0 and Apache 1.3 on Solaris 8. After having developed and successfully run many servlets I now receive a port 8080 already in use problem after I try to start tomcat. Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Sep 13, 2003 10:20:57 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Sep 13, 2003 10:21:00 AM org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoi nt .jav a:280 ) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) I did not change any configuration and I do not think that the ports are in use by any other processes (Apache uses a different port). Could it be that while doing shutdown-startup sequences a process has been left hanging (?). When I replaced port 8080 by 8081 I was able to start tomcat but when I called a servlet it said 8005 (port for shutdown) in use ?! When I replaced also 8005 for test purposes the servlet hangs and I could not see any error being logged (catalina.out, web appl log files, Apache log ...). My question: how do I get more info about what ports tomcat still uses for what ? Any hint would be appreciated. Thanks. Astrid This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended
Re: problems starting/stopping tomcat
Thanks for the quick response. Shapira, Yoav wrote: Howdy, Several things to do: Try to start tomcat from the console (use catalina.sh run instead of catalina.sh start) and when you run into this condition again, use CTRL-BREAK to send a SIGQUIT to the JVM so that you can an output of what your threads are doing. I ran catalina.sh run and run into this condition over and over. I do not know when/how I should terminate it since it prints out the message and finishes itself quickly. Should I look for java thread processes? Don't start non-daemon threads in your webapp. Alternatively, if you do, make sure they properly handle interruptions and quit. If you're not sure where they're coming from, do the above SIGQUIT approach to see. I am not aware of non-deamon threads. Maybe the problem has sth. to do with native calls I use but they are terminated I guess ... Thanks Astrid As another alternative, though dirty and potentially very bad if there's more than one webapp on the server: write a ServletContextListener that does System.exit(n) at the end of its contextDestroyed method ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:56 PM To: Tomcat Users List Subject: Re: problems starting/stopping tomcat Hi, Not again !! I ran into the same problem: SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint .jav a:280) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.ja va:1 117) at org.apache.catalina.core.StandardService.initialize(StandardService.jav a:57 9) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java: 2246 ) not being able to get a clean state. Can you tell me how to look for status of ports and how I can kill those processes keeping thoses port occupied because I can not see tomcat process. netstat | grep 8080 returns nothing (I get sth. for 8005) but that is not why it fails??! I do not want to boot everytime I run into that problem .. Thanks Astrid Shapira, Yoav wrote: Howdy, I'm glad you're OK for now ;) Tomcat shuts down properly under normal circumstances. The only times when it doesn't is when webapps start non-daemon threads and don't terminate them properly. Sometimes your webapp doesn't do this directly but a 3rd party library used by your webapp does. Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:08 AM To: Tomcat Users List Subject: Re: problems starting/stopping tomcat Thanks. We rebooted the machine and until now (I keep my fingers crossed) it works again. Tomcat must have not shut down properly leaving me in a deadlock. Astrid Shapira, Yoav wrote: Howdy, Use netstat to see the status of ports. Tomcat uses at least two ports at runtime: the SHUTDOWN port (8005 by default) and the actual user connector ports (8080 and 8009 by default for tomcat 4.1.x). What likely happened was: - Your first tomcat instance (ports 8005 and 8080) did not shut down properly, most likely because you had non-daemon threads still running - When you changed to port 8081 and tried to start, you got the error because tomcat was still listening on port 8005 for shutdown. You need to change both ports, or better yet, fix the cause for tomcat not shutting down properly ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Saturday, September 13, 2003 4:33 AM To: [EMAIL PROTECTED] Subject: problems starting/stopping tomcat Hi , I use tomcat 4.1.24, jdk 1.4.0 and Apache 1.3 on Solaris 8. After having developed and successfully run many servlets I now receive a port 8080 already in use problem after I try to start tomcat. Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Sep 13, 2003 10:20:57 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Sep 13, 2003 10:21:00 AM org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndp oi nt .jav a:280 ) at org.apache.coyote.http11.Http11Protocol.init
Re: problems starting/stopping tomcat
Hi, I killed some processes related to native c calls I submit and now I can start/stop TC so this time it could have been some non-terminated processes (due to network problem). The question now is: I may have some situations like that e.g due to a network problem a native call can not be finished etc. How do I avoid running into such severe problems: do I have to implement sth. like a timeout in the c programm to guarantee it will quit ?! Thanks for your help. Astrid Astrid Wagner wrote: Thanks for the quick response. Shapira, Yoav wrote: Howdy, Several things to do: Try to start tomcat from the console (use catalina.sh run instead of catalina.sh start) and when you run into this condition again, use CTRL-BREAK to send a SIGQUIT to the JVM so that you can an output of what your threads are doing. I ran catalina.sh run and run into this condition over and over. I do not know when/how I should terminate it since it prints out the message and finishes itself quickly. Should I look for java thread processes? Don't start non-daemon threads in your webapp. Alternatively, if you do, make sure they properly handle interruptions and quit. If you're not sure where they're coming from, do the above SIGQUIT approach to see. I am not aware of non-deamon threads. Maybe the problem has sth. to do with native calls I use but they are terminated I guess ... Thanks Astrid As another alternative, though dirty and potentially very bad if there's more than one webapp on the server: write a ServletContextListener that does System.exit(n) at the end of its contextDestroyed method ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:56 PM To: Tomcat Users List Subject: Re: problems starting/stopping tomcat Hi, Not again !! I ran into the same problem: SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoin t .jav a:280) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.j a va:1 117) at org.apache.catalina.core.StandardService.initialize(StandardService.ja v a:57 9) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java : 2246 ) not being able to get a clean state. Can you tell me how to look for status of ports and how I can kill those processes keeping thoses port occupied because I can not see tomcat process. netstat | grep 8080 returns nothing (I get sth. for 8005) but that is not why it fails??! I do not want to boot everytime I run into that problem .. Thanks Astrid Shapira, Yoav wrote: Howdy, I'm glad you're OK for now ;) Tomcat shuts down properly under normal circumstances. The only times when it doesn't is when webapps start non-daemon threads and don't terminate them properly. Sometimes your webapp doesn't do this directly but a 3rd party library used by your webapp does. Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:08 AM To: Tomcat Users List Subject: Re: problems starting/stopping tomcat Thanks. We rebooted the machine and until now (I keep my fingers crossed) it works again. Tomcat must have not shut down properly leaving me in a deadlock. Astrid Shapira, Yoav wrote: Howdy, Use netstat to see the status of ports. Tomcat uses at least two ports at runtime: the SHUTDOWN port (8005 by default) and the actual user connector ports (8080 and 8009 by default for tomcat 4.1.x). What likely happened was: - Your first tomcat instance (ports 8005 and 8080) did not shut down properly, most likely because you had non-daemon threads still running - When you changed to port 8081 and tried to start, you got the error because tomcat was still listening on port 8005 for shutdown. You need to change both ports, or better yet, fix the cause for tomcat not shutting down properly ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Saturday, September 13, 2003 4:33 AM To: [EMAIL PROTECTED] Subject: problems starting/stopping tomcat Hi , I use tomcat 4.1.24, jdk 1.4.0 and Apache 1.3 on Solaris 8. After having developed and successfully run many servlets I now receive a port 8080 already in use problem after I try to start tomcat. Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Sep 13, 2003 10:20
problems starting/stopping tomcat
Hi , I use tomcat 4.1.24, jdk 1.4.0 and Apache 1.3 on Solaris 8. After having developed and successfully run many servlets I now receive a port 8080 already in use problem after I try to start tomcat. Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Sep 13, 2003 10:20:54 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Sep 13, 2003 10:20:57 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Sep 13, 2003 10:21:00 AM org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:280 ) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) I did not change any configuration and I do not think that the ports are in use by any other processes (Apache uses a different port). Could it be that while doing shutdown-startup sequences a process has been left hanging (?). When I replaced port 8080 by 8081 I was able to start tomcat but when I called a servlet it said 8005 (port for shutdown) in use ?! When I replaced also 8005 for test purposes the servlet hangs and I could not see any error being logged (catalina.out, web appl log files, Apache log ...). My question: how do I get more info about what ports tomcat still uses for what ? Any hint would be appreciated. Thanks. Astrid
how to run web application in different modes like test, production
Hi all, I have a web application that runs -depending on the content of a property file - in different modes. But the application can only run in either one of these modes at a time. I want to be able to run the web application in serveral modes at the same time (e.g to test different DBs, email flows etc). What is the best way to accomplish that ? Thanks for you ideas. Astrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ant question: compile native code
Hi, I want to use ant to compile some native C code (part of my web application). Before searching around: can someone tell me how I have to modify my build.xml (for my web application) to make it automatically compile the C code and create the header file (via javah jni ...) or where to look? Thanks. Astrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat connection/port problem
Hi, I use tomcat 4.1.24, jdk 1.4.0 and Apache 1.3 on Solaris 8. I am able to run a servlet with my configuration but when I submit in this first page I receive an errror. The catalina.out log file simply says: Jul 24, 2003 8:53:58 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Jul 24, 2003 8:53:58 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Jul 24, 2003 8:54:01 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Jul 24, 2003 8:54:04 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.24 Jul 24, 2003 8:54:31 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Jul 24, 2003 8:54:32 AM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jul 24, 2003 8:54:32 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=44/437 config=/home/oraedt/app/oracle/product/9iAS_1.0.2.2/jaka rta-tomcat-4.1.24/conf/jk2.properties [EMAIL PROTECTED](): empty constructor: // this is printout from my code [EMAIL PROTECTED]() start: // this is printout from my code [EMAIL PROTECTED]() before getting system.mode: // this is printout from my code Stopping service Tomcat-Standalone The mod_jk printout says this : [Thu Jul 24 09:01:26 2003] [jk_ajp_common.c (642)]: sending to ajp13 #79 [Thu Jul 24 09:01:27 2003] [jk_ajp_common.c (681)]: ERROR: can't receive the response mes sage from tomcat, network problems or tomcat is down. ... I remember having seen some port 8080 in use problem error message but not in the above test. Apache is configured to run on a different port (7778) and server.xml has: Service name=Tomcat-Standalone !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true / !-- Note : To disable connection timeouts, set connectionTimeout value to -1 -- !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ /Service Do I have to use a different connector? Why does the problem occur not right away if it is a port problem? The error comes when I try to read an external java resource bundle (.properties file) even though this may not have sth. to do with the error because the resource bundle is successfully found prior to the error. Thanks for your help. BTW: Is it advisable to use the above configuration since we have an quite old version of Apache? E.g Has anyone experienced mayor problems running relativly new versions of tomcat with an old 1.3 Apache version?? Astrid
Re: tomcat connection/port problem
Yes you are rigth. The resource property was not found in in the resource file that's why it crashed. I simply thought I would get some java error (and not only that tomcat was shut down) that would have made it easier for me to debug. Sorry for the confusion. Astrid Ralph Einfeldt wrote: What makes you so shure that you have a port problem ? I think that you are searching in the wrong direction. As I understand the log message mod_jk complains about not getting an answer from tomcat after it successfully sent a request to tomcat. At this point I cann't imagine a port problem (with that the request would have failed, not the response) This can have several causes: - tomcat is down (e.g. jvm crash) - the thread is not responding at all (deadlock) - the thread is not responding quick enough (it take to long to create the response) - ... -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 9:25 AM To: [EMAIL PROTECTED] Subject: tomcat connection/port problem [Thu Jul 24 09:01:26 2003] [jk_ajp_common.c (642)]: sending to ajp13 #79 [Thu Jul 24 09:01:27 2003] [jk_ajp_common.c (681)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down. ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem finding css
Hi, I am using Apache 1.3 with tomcat 4.1.24. When I use netscape 7 to run my web application everything works fine. When I use e.g netscape 4 the style sheets can not be found. How do I have to configure Apache/tomcat ? In the html page the source is refered to as: link href=/main.css rel=stylesheet type=text/css Right now I have in http.conf: VirtualHost * DocumentRoot /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webapps/iprweb ServerName upolu.sps.mot.com JkMount /iprweb/* ajp13 /VirtualHost Alias /html/ /home/minerva/servers/upolu/ipr_files/static_html/ The main.css is installed in /home/minerva/servers/upolu/ipr_files/static_html. Thanks for any hint .. Astrid
Re: problem finding css
No I forgot to state that http.conf has also: DocumentRoot /home/minerva/servers/upolu//ipr_files/static_html otherwise it wouldn't find it in any case. I assume the main.css is looked up in /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webapps/iprweb because of my: VirtualHost * DocumentRoot /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webapps/iprweb ServerName upolu.sps.mot.com JkMount /iprweb/* ajp13 /VirtualHost directive. Somehow new netscape versions seem to go to the next DocumentRoot to find a resource when not found in first because as stated before it works with netscape 7. My problem is therefore: How do I tell Apache to take main.css from the global DocumentRoot in http.conf and only the web application from the one in the VirtualHost directive. Static text as well as web should use the same machine/port number. I guess I have to read about the VirtualHost tag more. Thanks anyway. Astrid Ralph Einfeldt wrote: I would expect that you have to use link href=/html/main.css ... to get the file. Otherwise the alias directive won't match. -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 12:35 PM To: [EMAIL PROTECTED] Subject: problem finding css link href=/main.css rel=stylesheet type=text/css Alias /html/ /home/minerva/servers/upolu/ipr_files/static_html/ The main.css is installed in /home/minerva/servers/upolu/ipr_files/static_html. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem finding css
For my purposes it was wrong to use the VirtualHost directive because my web appl. runs on same host /port. I just left the JkMount directive and it works with old and new netscape version. The mapping to the web appl. doc root is done by workers.properties and server.xml and I thought I have to do this in httpd.conf Thanks. Astrid Astrid Wagner wrote: No I forgot to state that http.conf has also: DocumentRoot /home/minerva/servers/upolu//ipr_files/static_html otherwise it wouldn't find it in any case. I assume the main.css is looked up in /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webap ps/iprweb because of my: VirtualHost * DocumentRoot /home/oraedt/app/oracle/product/9iAS_1.0.2.2/jakarta-tomcat-4.1.24/webap ps/iprweb ServerName upolu.sps.mot.com JkMount /iprweb/* ajp13 /VirtualHost directive. Somehow new netscape versions seem to go to the next DocumentRoot to find a resource when not found in first because as stated before it works with netscape 7. My problem is therefore: How do I tell Apache to take main.css from the global DocumentRoot in http.conf and only the web application from the one in the VirtualHost directive. Static text as well as web should use the same machine/port number. I guess I have to read about the VirtualHost tag more. Thanks anyway. Astrid Ralph Einfeldt wrote: I would expect that you have to use link href=/html/main.css ... to get the file. Otherwise the alias directive won't match. -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 12:35 PM To: [EMAIL PROTECTED] Subject: problem finding css link href=/main.css rel=stylesheet type=text/css Alias /html/ /home/minerva/servers/upolu/ipr_files/static_html/ The main.css is installed in /home/minerva/servers/upolu/ipr_files/static_html. - 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]
running as diff. account
Hi, This may be off topic but maybe someone else had this requirement: I need to call a system call running in a different account than the account the web application runs: E.g All web applications etc. run as accountA but my web application needs to call a rsh command (via native interface) run as accountB. Thanks a lot. Astrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: running as diff. account
Hi, Can you detail the second solution a little bit: I can create a shell sript with my rsh system command in it and owned by accountB but it will still run as accountA when called by a servlet, won't it. I am no unix expert, maybe you have an example. Thanks Astrid Ralph Einfeldt wrote: There are a couple of solutions that allow you to achive that. Which solution is best, depends on your requirements. Some solutions that require a wrapper script: - script that calls rsh by super or sudo or something like that - script that is owned by accountB and has the setuid bit set and calls the rsh command directly -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 3:44 PM To: [EMAIL PROTECTED] Subject: running as diff. account E.g All web applications etc. run as accountA but my web application needs to call a rsh command (via native interface) run as accountB. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: running as diff. account
John Turner wrote: You're right, file ownership has nothing to do with run privileges. Can you clarify what you need? Is accountB the only account allowed to use rsh? Or are you saying that you want to use rsh to login into a remote host as accountB, but accountA will launch rsh? OK. We allow a certain account accountB to be able to rsh on users machine with the user's account so for example we can check their proper installation etc. Therefore what I want to do is for example have accountB run rsh -l userA userAmachine 'ls /home/userA/someDir' The .rhosts file of the users allow that access. But tomcat as well as all DB related things run as a different account accountA. So how can I get accountB to run the rsh command? I hope I did not confuse you too much ?! Astrid If the latter, then use the -l command-line option to rsh to specify the remote host account name to use, just as you would with ssh. John Astrid Wagner wrote: Hi, Can you detail the second solution a little bit: I can create a shell sript with my rsh system command in it and owned by accountB but it will still run as accountA when called by a servlet, won't it. I am no unix expert, maybe you have an example. Thanks Astrid Ralph Einfeldt wrote: There are a couple of solutions that allow you to achive that. Which solution is best, depends on your requirements. Some solutions that require a wrapper script: - script that calls rsh by super or sudo or something like that - script that is owned by accountB and has the setuid bit set and calls the rsh command directly -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 3:44 PM To: [EMAIL PROTECTED] Subject: running as diff. account E.g All web applications etc. run as accountA but my web application needs to call a rsh command (via native interface) run as accountB. - 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]
which mod_jk.so to use with Apache 1.3
Hi, I try to connect tomcat 4.1.24 to an existing Apache 1.3 installation (Solaris 8). To do so I read I need mod_jk.so and I found a download page http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.2/bin/solaris8/ but below it says to get * mod_jk2-1.3-eapi.so is for Apache 1.3.x with mod_ssl * mod_jk2-1.3-noeapi.so is for Apache 1.3.x without mod_ssl and they are not listed above. Has anyone done sth. similar and can tell me what to use if my plans aren't impossible (due to old Apache version) at all? Thanks. Astrid
Re: I'm officially lost with mod_jk
Hi Werner, Sorry to link into your conversation: It seems that you went through the problems I am about to have (connecting tomcat 4 to Apache 1.3: Solaris 8). Since I haven't gotten a response to a previous email: Where did you get mod_jk ? Why did you have to compile it and can you give more info on what steps you took to do so. Thanks. Astrid Werner van Mook wrote: Gute Morgen Simon, I've compiled the mod_jk myself. it was easy. But I still have problems. I will so you what I have. In httpd.conf : LoadModule jk_module modules/mod_jk.so # MY OWN STUFF HERE IfModule mod_jk.so AddModule mod_jk.c JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /etc/httpd/logs/mod_jk.log JkLogLevelinfo JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T /IfModule In workers.properties : #Define 1 real worker using ajp13 worker.list=ajp13 #Set properties for worker1(ajp13) worker.ajp13.type=ajp13 worker.ajp13.host=www.connecties.com worker.ajp13.port=8009 In server.xml : on a line after Server portt=8005 .. Listener className=org.apache.ajp.tomcat4.config.ApacheConfig modJk=/etc/httpd/modules/mod_jk.so / on a line just after Host name=www.connecties.com . Listener className=org.apache.ajp.tomcat4.config.ApacheConfig append=true forwardAll=false modJk=/etc/httpd/modules/mod_jk.so / And the last part of my server.xml is : !-- Define an Apache-Connector Service -- !-- Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=0/ Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=0 Logger className=org.apache.catalina.logger.FileLogger prefix=apache_log. suffix=.txt timestamp=true/ Realm className=org.apache.catalina.realm.MemoryRealm / Host name=www.connecties.com Context path= docBase=/home/sites/home/web crossContext=true debug=0 reloadable=false trusted=false /Context /Host /Engine /Service The output of the apache error log is : [Wed Jul 16 09:16:27 2003] [error] (25)Inappropriate ioctl for device: Error while opening the workers, jk will not work [Wed Jul 16 09:16:28 2003] [error] (25)Inappropriate ioctl for device: Error while opening the workers, jk will not work [Wed Jul 16 09:16:29 2003] [notice] Apache/1.3.20 Sun Cobalt (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b PHP/4.0.3pl1 mod_auth_pam_external/0.1 FrontPage/4.0.4.3 mod_perl/1.25 configured -- resuming no rmal operations [Wed Jul 16 09:16:29 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) This will probably say enough (for some). It tells me that jk will not work. But I don't understand why. Anybody ? On Tuesday, July 15, 2003, at 11:29 PM, Simon Pabst wrote: Seems you're not the only one with that problem on Apache/mod_jk/Tomcat on a cobalt machine: http://www.zeffie.com/cobalt/developers/0208/162839.html Best is propably if you (or they if you don't have permissions to do that) compile mod_jk on that machine and don't use a downloaded binary. How to do that: http://list.cobalt.com/pipermail/cobalt-developers/2003-March/ 038938.html Good luck :-) At 21:03 15.07.2003 +0200, you wrote: HI, I have hired a sun microsystems cobalt machine. It comes pre configured with all kinds of internet software and a special edition of redhat. It is stripped on all sides to give maximum speed and maximum disk space. One of the settings is that you can't do anything with apache apart from restarting it with the httpd command. Or restarting the complete box.. By now I'm trying to figure out if it is possible to have Apache2 on it. But I am depending on the goodwill of my provider for it. Some how I think that having Apache 2 solves some of my problems. We'll see. Kind regards Werner van Mook On Tuesday, July 15, 2003, at 06:58 PM, Simon Pabst wrote: hmm ok, the Apache you are using, did it come in a package or did you built from source? Apache 1.3.20 should have apachectl in the same directory as httpd (i.e. /path/to/apache_1.3.20/bin/apachectl) At 18:47 15.07.2003 +0200, you wrote: Yes I tried to use it but to no avail. unfortunately. Regards Werner van Mook On Tuesday, July 15, 2003, at 06:38 PM, Simon Pabst wrote: did you even try my suggestion? http://www.mail-archive.com/[EMAIL PROTECTED]/ msg97619.html Werner van Mook Java Lead Developer / Trainer Connecties Voor Internet Werner van Mook Java Lead Developer / Trainer Connecties Voor Internet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
deploying with ant
Hi, I am trying to install my web application into a tomcat web installation. I thought ant install is the right thing to do and it successfully performed but I can not see any of my web part within the tomcat installation and neither can I call one of my servlets. I thought I would see my application under the webapps directory but I did not. Do I have to make a ant deploy? The documentation does not say so but how do I get the web application to the tomcat installation? Thanks. Astrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
web.xml question
Hi, This is an (hopefully) easy question: I run my new web application but do not seem to get the servlet to run. I can run a simple index.html page (machine:port/my-web-appl/index.html) within my web application installation so $CATALINA_HOME/webapps/my-web-appl/index.html is found. But when I try to call a servlet having simply in web.xml: !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd /web-app_2_3.dtd web-app servlet servlet-nameRegEntryPage/servlet-name servlet-classcom.mot.sps.ipr.ipConsumer.registration.RegEntryPage/servlet-class /servlet /web-app and by calling it in the browser with machine:port/my-web-appl/RegEntryPage it fails. Has someone a quick answer? The log file simply says: Mapping contextPath='/iprweb' with requestURI='/iprweb/RegEntryPage' and relativeURI='/RegEntryPage' 2003-07-14 17:00:40 StandardContext[/iprweb]: Trying exact match 2003-07-14 17:00:40 StandardContext[/iprweb]: Trying prefix match 2003-07-14 17:00:40 StandardContext[/iprweb]: Trying extension match 2003-07-14 17:00:40 StandardContext[/iprweb]: Trying default match 2003-07-14 17:00:40 StandardContext[/iprweb]: Mapped to servlet 'default' with servlet path '/RegEntryPage' and path info 'null' and update=true Thanks. Astrid
ldap authentication with tomcat
Hi, I am new to the subject: How can I enforce ldap authentication for certain resources using tomcat - similar to the Directory toProtectResourcePath Options FollowSymLinks AllowOverride None AuthType Basic AuthName Authentication AuthLDAPURL ldap://ldapUrl require valid-user /Directory for apache in order to be able to get user information via e.g. getRemoteUser() etc. ? And by the way: Where is a valuable description of the configuration with server.xml and web.xml? Thanks. Astrid