Java Servlet Setup Apache/Tomcat
How do I setup a CLASSPATH to a file called serverhub.jar in a folder. (ex. c:\javaclient/serverhub.jar)
Then I need to name the Servlet "hub" and give it a class name of com.peregrine.hub.HubServlet
Then I need to give it initialization arguments
servers=servername:6000
default=servername
threads=500
Can someone tell me where to setup these items for a tomcat jserver and an apache http server. I already have the jserver and apache server up and running.
You set this up under the TOMCAT_HOME/webapps/"servlet context"/WEB_INF directory. This directory should contain a classes directory, which contains your servlet class. It should also contain a lib directory, where you put the jar files. Finally, it should contain a web.xml file. This XML file is where you specify the servlet name, servlet class and initialization parameters.
You can follow the examples located in TOMCAT_HOME/webapps/examples or see http://jakarta.apache.org/tomcat/tomcat-3.2-doc/appdev/index.html
Similar Messages
-
Could not see Java tab on Apache Tomcat 5.5.20 Properties in CCM
Hi,
After uninstalling and reinstalling BusinessObjects Edge 3.1, I can no longer see Java tab on Apache Tomcat 5.5.20 Properties in Central Configuration Manager (CCM). I can only see 2 tabs namely Properties and Dependency. Therefore, I could not start my Tomcat because I could not change Java maximum memory pool from 1024 to 768 in the Java tab.
Please help.
HapizorrHi Denis,
Yes, it works. Thank you.
Hapizorr -
Obtaining client certificate in servlet using apache + tomcat
Hi,
I'm porting a webapplication from Javawebserver to Apache/1.3.6 (Win32) mod_jk mod_ssl/2.2.6 OpenSSL/0.9.2b
The application needs to get the client certificate hash code.
Using Javawebserver I used
request.getAttribute ("javax.net.ssl.cipher_suite");
request.getAttribute("javax.net.ssl.peer_certificates");
etc
How do I set up the apache webserver so that I can read the client certificate and what is the attribute called?
I've tried this in the httpd.conf:
SSLOptions +ExportCertData
And the attribute:
"SSL_CLIENT_CERT"
Like it says in the Tomcat documentation.
I'm not sure if I need to set up Tomcat as well..
Any help would be greatly appriciated!
Sincerely,
AM HjemaasYup use ajp13 not ajp12 or mod_webapp
refer to http://www.galatea.com/flashguides/apache-tomcat-24-win32.xml on setting up..
THIS IS IMPORTANT!!!
use Apache mod_jk.dll diretive:
JkEnvVar Apache_Env_Var FORWARD_ALIAS
this will send a apache environment variable (http://myapache/cgi-bin/printenv.pl to see whats available) to Tomcat
JkEnvVar SSL_CLIENT_CERT SSL_CLIENT_CERT
Then in Tomcat servlet use request.getAttribute("SSL_CLIENT_CERT") to get the cert in PEM format
Hope this helps
Jay -
How can i use my helloworld servlet in apache-tomcat-mod_jk?
hi
i copied
helloworld.java helloworld.class
to
jakarta-tomcat-3.3.1/webapps/examples/WEB-INF/classes
i can use example servlets in that directory by accessing localhost/examples/servlets
and click links..(but if i type them in browser address bar, they dont' work either)
what setting am i missing?
thank youi didn't touch web.xml server.xml at all..
i got this with logs files
/usr/local/apache/logs/error_log
[Thu Jul 25 14:14:00 2002] [notice] Apache/1.3.26 (Unix) PHP/4.1.2 mod_jk/1.1.0 configured -- resuming normal operations
[Thu Jul 25 14:14:00 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Thu Jul 25 14:19:19 2002] [notice] caught SIGTERM, shutting down
[root@beautifulmind logs]#
[root@beautifulmind logs]# cat mod_jk.log
how does the link to jsp/servelt works and, not direct typing at address bar?
mod_jk.conf
<IfModule !mod_jk.c>
LoadModule jk_module libexec/mod_jk.so
</IfModule>
JkWorkersFile "/usr/local/jakarta-tomcat-3.3.1/conf/jk/workers.properties"
JkLogFile "/usr/local/jakarta-tomcat-3.3.1/logs/mod_jk.log"
JkLogLevel emerg
<Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/examples">
Options Indexes FollowSymLinks
</Directory>
JkMount /admin ajp13
JkMount /admin/* ajp13
JkMount /examples ajp13
JkMount /examples/* ajp13
#added by eugene
JkMount /examples/servlet/* ajp13
#added by eugene
httpd.conf
Include /usr/local/jakarta-tomcat-3.3.1/conf/auto/mod_jk.con -
Servlet mapping with Apache + Tomcat
I'm trying to set up my servlet with apache + Tomcat(3.2.3), and i'm using mod_jk as the Tomcat-Apache plug-in.
The HelloWorld servlet that comes with the examples app worked fine at: http://localhost/examples/servlet/HelloWorldExample,
but how do I change the configurations, so that it can be invoked at:
http://localhost/examples/HelloWorldExample ?
It appears to me that '/servlet/' is the default prefix for Tomcat's RequestInterceptor, there is no way to get around that.
Any insights will be greatly appreciated, thanks!
Elainehi
Try this:
add below code in web.xml file in examples/WEB-INF
F directory
<servlet-mapping>
<servlet-name>
HelloWorldExample
</servlet-name>
<url-pattern>
/HelloWorldExample
</url-pattern>
</servlet-mapping>
Thanks for the reply, the web.xml is already set up this way, in fact, I'm able to invoke the servlet through tomcat(running on port 8080): http://localhost:8080/examples/HelloWorldExample,
tomcat reads the web.xml without any problems.
The problem comes from Apache(port 80), http://localhost:80/examples/HelloWorldExample wouldn't work, only http://localhost:80/examples/servlet/HelloWorldExample works.
It appears to me that when requests are relayed from Apache to tomcat, you need to tell tomcat that you intend to invoke a servlet by prefixing '/servlet/', if you look in the server.xml, it has
<RequestInterceptor
className="org.apache.tomcat.request.InvokerInterceptor"
debug="0" prefix="/servlet/" />
I've tried to change this to something else, it didn't seem to make any difference. -
Apache Tomcat goes down on starting Java application, Oracle error
Hello all
I am running a Java application on Apache Tomcat 5.5. I use Oracle 10g Express Edition as the back-end for my application. I deploy my application using theTomcat manager and it works fine.
However, when I try to access the home page of the application, my Tomcat server goes down. The stdout logs of Apache Tomcat display the following message:
Exception message: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified.
What could the possible reasons be for this to happen? And how can I workaround or fix this?
Thanks
SwethaThis looks like a problem that XE has with some recently altered locales, i.e. Russian. You can work around the problem by making sure that the Java locale (Locale.setDefault()) is supported by XE before the JDBC connect call. For example, use Locale.setDefault( Locale.US ). After connect, you may explicitly set session NLS parameters using ALTER SESSION. You can also restore the Java locale.
-- Sergiusz -
Problem connecting oracle database to jsp pages using Apache Tomcat server 8.0
Well...I tried too many things..googled so many times..but still could not find solution to my problem.
I use windows 8 Enterprise Edition(if this has to do something with the problem)
Oracle 11.2.0
Apache Tomcat server 8.0
JDK 1.7
My oracle is installed in the D: drive and tomcat in c:. i copied the ojdbc6.jar file from oracle to lib directory of tomcat server.
Then i set CLASSPATH in environment variables as "C:\Program Files\Apache Software Foundation\Tomcat 8.0\lib\ojdbc6.jar" in system variables
My path variable is set as "C:\Program Files\Java\jdk1.7.0_02\bin".
My program is as follows in notepad:
<%@ page import="java.sql.*" %>
<html>
<body>
<%
Connection conn;
Statement st;
ResultSet rs;
try{
new oracle.jdbc.driver.OracleDriver();
String dbURL="jdbc:odbc:oracle:thin:@localhost:1521:XE";
String userId="system";
String pwd="moon";
conn=DriverManager.getConnection(dbURL,userId,pwd);
st=conn.createStatement();
rs= st.executeQuery("SELECT * FROM login");
while(rs.next())
System.out.println(rs.getString(1)+""+rs.getString(2));
catch(Exception e){}
%>
</body>
</html>
I get too many errors then
eroors
org.apache.jasper.JasperException: An exception occurred processing JSP page /page2.jsp at line 14
11: String userId="system";
12: String pwd="moon";
13:
14: conn=DriverManager.getConnection(dbURL,userId,pwd);
15: st=conn.createStatement();
16:
17: rs= st.executeQuery("SELECT * FROM login");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:905)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:834)
org.apache.jsp.page2_jsp._jspService(page2_jsp.java:102)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Nothing solved this problem.>> Nothing solved this problem.
Can't fix a problem 'till an actual problem is identified.
>> ODBC Driver Manager ... Data source name not found
That appears to be ODBC drivers looking for a DSN (Data Set Name). If it wants a DSN, the DSN has to be specified in the code, and the DSN has to be configured in the windows host ODBC applet. So that is at least two squirrels to get in the right tree before moving forward. A ...host:...[port:]SID|service name are some of the bits needed in a jdbc connect string, and that is in no way related to DSNs. A Whole Different Animal. If it wants a DSN that might be what needs to go in the URL bit.
And ODBC setups can be confusing, especially if an x64 OS is in the mix- if that is the case there are two different ODBC configuration applets, one for x64 the other for x86, and if one gets as far as talking to an actual database it might toss an architecture error. Only way to fix that "problem" is *delete* the ODBC DSN and then run the correct (maybe the x86) ODBC config utility, and set up the DSN. Again. -
I don't understand the following error on apache tomcat
Good afternoon!
I am using tomcat 6.0.13.When i try to perform my servlet, the following exception is gone off :
exception
javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:595)
root cause
java.lang.NoClassDefFoundError: mypackage/Transportadora (wrong name: Transportadora)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:595)
Would be this a problem in the definition of the class?
web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Transportadora </display-name>
<description>
Projeto Transportadora
</description>
<servlet>
<servlet-name>Transportadora</servlet-name>
<servlet-class>mypackage.Transportadora</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Transportadora</servlet-name>
<url-pattern>/transp</url-pattern>
</servlet-mapping>
</web-app>
A great one I hug and grateful for the attention!
Message was edited by:
tarssa
Message was edited by:
tarssa
Message was edited by:
tarssajava.lang.NoClassDefFoundError: mypackage/Transportadora (wrong name: Transportadora) You need to make sure all your classes are in the classpath and/or you need to make sure you're calling the class by its correct name.
-
Hi All,
I got the following error message in catalina.log file while accessing on in my website at online
1. My Project is created using Netbeans with tomcat 5.5.23 and jdk_1.5.0_10
2. I am created "admin" folder in my project with as myproj --> "admin"
3. myproj --> web-inf/classes/all packages with its realated folder names.
4. Please read this , the out of "admin " folder have some jsp files that are use the <jsp:useBean> property so it call correctly with specified classes function in web-inf folder classes package
5. Note: But the inside of "admin" folder have some jsp files while executing these files all the files are correctly running on my localsystem welled.
6. But the same files are uploaded and checking on my site this will throw the exception as follows
the useBean class attribute in invalid and also the catalina.log file containg the following message,
7. But all the files with it's corresponding places in website those files are also executing correctly but not in after uploading online please help to reply to bring the solution.
Dec 8, 2008 12:48:06 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.5.0_10/jre/lib/i386/server:/usr/java/jdk1.5.0_10/jre/lib/i386:/usr/java/jdk1.5.0_10/jre/../lib/i386
Dec 8, 2008 12:48:06 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 580 ms
Dec 8, 2008 12:48:06 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 8, 2008 12:48:06 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
Dec 8, 2008 12:48:06 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Dec 8, 2008 12:48:08 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Dec 8, 2008 12:48:08 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ''.
Dec 8, 2008 12:48:08 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
Dec 8, 2008 12:48:08 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
Dec 8, 2008 12:48:08 AM org.apache.axis.configuration.EngineConfigurationFactoryServlet getServerEngineConfig
SEVERE: Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
Dec 8, 2008 12:48:09 AM org.apache.axis.configuration.EngineConfigurationFactoryServlet getServerEngineConfig
SEVERE: Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
Dec 8, 2008 12:48:09 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:21109
Dec 8, 2008 12:48:09 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/45 config=null
Dec 8, 2008 12:48:09 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Dec 8, 2008 12:48:09 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3085 ms
Dec 8, 2008 12:49:58 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /TestBean.jsp(7,3) The value for the useBean class attribute sam.model.Test is invalid.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1175)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1117)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2220)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
at org.apache.jasper.compiler.Generator.generate(Generator.java:3322)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Dec 8, 2008 12:50:08 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /TestBean.jsp(7,3) The value for the useBean class attribute sam.model.Test is invalid.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1175)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1117)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2220)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
at org.apache.jasper.compiler.Generator.generate(Generator.java:3322)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)vijay_raga wrote:
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /TestBean.jsp(7,3) The value for the useBean class attribute sam.model.Test is invalid.It means that either the mentioned class cannot be found (i.e. missing in classpath), or that its construction (i.e. new Test()) failed. -
Apache Tomcat error re: port 8080
Hello.
Our environment:
RoboHelp Server 8.0
Apache Tomcat 6.0.26
Windows Server 2008 enterprise without Hyper-V SP2 (32-bit virtual machine)
RoboHelp 8.0.2.208
Our help system is periodically non-responsive. The Apache logs (extract below) indicate that there is an application using port 8080. We (my IT support and I) discovered that RDP (Windows Remote Desktop) had been changed from port 3389 (its default) to port 8080. The server is dedicated to our help system; there isn't anyone touching it so we were a bit confused. We reset the RDP port back to 3389 and restarted the server (full server restart) and everything worked as it should. A couple of days later...the same thing...and then a few times in one day. Research indicates there may be some Windows or Apache bug related to ports being reset to 8080, but not a lot of detail or suggestion for resolution or work around.
Has anyone experienced this port issue?
I am not familiar with Apache...is there another port that it can use and still run the RoboServer?
Any thoughts or suggestions re: how to proceed?
TIA,
Michelle
From Catalina log:
Sep 13, 2010 9:42:34 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\W indows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\
Sep 13, 2010 9:42:34 AM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1014)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:680)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFac tory.java:50)
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
... 12 more
Sep 13, 2010 9:42:34 AM org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:680)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Sep 13, 2010 9:42:34 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 606 ms
Sep 13, 2010 9:42:34 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Sep 13, 2010 9:42:34 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.26The default port with RH Server is 8080 as this is the standard port for all web services. Having said that, I suspect you can change the port to another. I've never used anything other than the default. it sounds like if you have another web services accessing the same port that either it or RH Server needs to be changed.
The RoboColum(n)
@robocolumn
Colum McAndrew -
Tomcat 6 Calling a Java Servlet from a JSP Page
Below is a very simple JSP Page that calls a Java Servlet. The question is given Tomcat security constraints, is it possible to call a servlet from a JSP and get the correct output without getting an error message? If so, how would you code the web.xml file?
c:\apache-tomcat-6.0.18
Under conf
catalina
localhost
HelloWorldExample.xml is directly under localhost
The application would have this directory structure:
webapps
HelloWorldExample
hello.jsp is directly under HelloWorldExample
Under HelloWorldExample
src
WEB-INF
classes
Under classes
jservlets
HelloWorld.java is in src folder
HelloWorld.class is in jservlets folder
HelloWorldExample.xml
<Context path="/HelloWorldExample" docBase="HelloWorldExample" debug="0"
reloadable="true" crossContext="true">
</Context>**************************
hello.jsp
<HTML>
<HEAD>
<TITLE>Hello</TITLE>
</HEAD>
<BODY>
<FONT SIZE="4">
<P>
Please enter your name:
<FORM
METHOD="Post"
ACTION="servlet/jservlets.HelloWorld">
<TABLE BORDER="3" CELLPADDING="1" WIDTH="100%" ALIGN="CENTER">
<TR>
<TD><B>Name:</B></TD>
<TD><INPUT TYPE="text" NAME="Name" VALUE="" SIZE="65"> </TD>
</TR>
</TABLE>
<P>
<INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>
</FONT>
</BODY>
</HTML>******************
HelloWorld.java
package jservlets;
import java.io.*;
import java.util.Date;
import java.util.*;
import java.text.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet
PrintWriter out;
PrintWriter err;
String strName;
public void displayMessage(HttpServletRequest request, HttpServletResponse response)
throws Exception
try
if (!strName.equals("") && strName != null)
out.println("Hello " + strName + "" + "<P>");
out.println("Hello World" + "<P>");
else
out.println("Hello World" + "<P>");
catch (Exception e)
out.println("Exception: Could not display message." + "<P>");
err.println (e.getMessage () ) ;
out.println("<P>");
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
try
response.setContentType("text/html");
out = response.getWriter();
err = response.getWriter();
strName = request.getParameter("Name").trim();
out.println("<html><head><title>");
out.println("</title></head><body>");
out.println("<FORM");
out.println("METHOD=POST");
out.println("ACTION=http://localhost:8080/HelloWorldExample/hello.jsp>");
out.println("<TABLE ALIGN='RIGHT'>");
out.println("<TR>");
out.println("<TD>");
out.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Hello World Page\";>");
out.println("</INPUT>");
out.println("</TD>");
out.println("</TR>");
out.println("</TABLE>");
out.println("</FORM>");
out.println("<BR CLEAR='all'>");
out.println("<P>");
displayMessage(request, response);
out.close();
out.println("</body></html>");
catch(Throwable e)
e.printStackTrace();
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
doPost(request, response);
web.xml
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>jservlets.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping> ******************************
HelloWorld.java can be compiled by using javac.
Once compiled, HelloWorld.class would be moved to the jservlets folder.
FYI, coding the above url-pattern results in:
HTTP Status 404
The requested resource (/HelloWorldExample/servlet/jservlets.HelloWorld) is not available
The following url-pattern in the web.xml file permits the servlet to be executed but results in a null pointer exception:
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/ </url-pattern>
</servlet-mapping> **************************************************
RobinThis problem was resolved.
In hello.jsp
ACTION="servlet/jservlets.HelloWorld">
was replaced with
ACTION="servlet/HelloWorld">
Robin -
Java servlets and Tomcat server
Hi friends
i am using Sun One forte Community edition . i am trying to make a hello world servlet .
there are 2 Files one is Index.html , HelloWorld.java (Servlet)
I call this servlet from the index.html file.
evertime i call it it gives me and error of Apache tomcat file not found .The tomcat server is inbuilt with the Sun One studio.
the directory structure is
-----HOME
-------WEB_FOLDER
----------Index.html
----------WEB-INF
-------------CLASSES
-----------------myServlet (package)
---------------------HelloWorld.java
-------------LIB
The problem is I am not getting how to write the path of servlet in index.html to call the helloWorld servlet.Make this entry in your server.xml file located in tomcat_dir\conf.
<Context path="/abc"
docBase="webapps/abc"
crossContext="true"
debug="0"
reloadable="true"
trusted="false">
</Context>
Suppose i want to develop my servlets in another folder Let it be "XYZ".Then your package statement must be, 'package xyz;'. Place all your servlets in webapps/abc/WEB_INF/classes/xyz dir.
Place all your Jsp(s) and Htmls in webapps/abc/pqrs dir.
Now they all come under one context 'abc'.
Sudha -
Help with error (apache tomcat + java )
hi all ! Im having an issue with my program.
Im using jasper report to generate some reports from the program... everything seems to work except for this (making the program unstable at some point). When the report is generated and loaded as a pdf I get this error in the log.
java.lang.IllegalStateException
at org.apache.coyote.Response.reset(Response.java:296)
at org.apache.catalina.connector.Response.reset(Response.java:642)
at org.apache.catalina.connector.Response.reset(Response.java:908)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:355)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:211)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:736)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
The code Im using to generate the pdf is this one.
File file = new File("C:\\Reportes\\", reporte +""+ datNac +".pdf");
String contentType = getServletContext().getMimeType(reporte+ "" +datNac+ ".pdf");
System.out.println("antes BufferedOutputStream");
BufferedOutputStream output = null;
output = new BufferedOutputStream(response.getOutputStream());
BufferedInputStream inputFile = null;
inputFile = new BufferedInputStream(new FileInputStream(file));
response.reset();
response.setContentType(contentType);
response.setContentLength((int) file.length());
response.setHeader("Content-disposition",
"attachment; filename=\"" +file.getName()+ "\"");
System.out.println("BufferedOutputStream");
byte[] buffer = new byte[10240];
for (int length; (length = inputFile.read(buffer)) != -1;) {
output.write(buffer, 0, length);
inputFile.close();
output.close();Any help is appreciated.
Thanks!
Edited by: juanmanuelsanchez on Aug 4, 2009 11:17 AM
Edited by: juanmanuelsanchez on Aug 4, 2009 11:18 AM
Edited by: juanmanuelsanchez on Aug 4, 2009 11:19 AMjuanmanuelsanchez wrote:
java.lang.IllegalStateException
at org.apache.coyote.Response.reset(Response.java:296)The response is already committed and thus cannot be reset anymore.
output = new BufferedOutputStream(response.getOutputStream());
response.reset();At least you should obtain the outputstream AFTER the reset. If that doesn't fix, then check everything in the chain before this code. -
Web service - eclipse - apache/tomcat - soap - java
Hi!
I want to develop a web service. I use eclipse as java ide, and apache as web server. I could not get the information how to develop a web service with my ide and web server. I want to use soap too.
Anyone will you please help/instruct me to develop a web service.
Thanks for all...bump
Can any one help me here?
I have an application that uses SOAP and JNLP. Clients with Java 1.4.2 everything works fine but under Java1.5 the SOAP calls take forever to complete (each is about 4 seconds and there are often a lot of SOAP calls)
My webserver is Tomcat 5.5.12
I'm not sure of my soap version, but i believe it is 2.3 (.1? how can i find out)
I have Java 1.5 and 1.4 installed and Tomcat uses Java 1.5 - I compile my classes for Java 1.4 but I really want Java 5 to work.
My soap services are deployed and correctly displayed with the SOAP admin page.
What kind of java 5 soap incomptability might i have found here? can anyone help me.
B.t.w. from my local computer this problem doesn't happen - Java 1.5 works correctly - it is only when it is on a different computer (even on the intranet) that i have problems.
Any ideas
Thanks
Martin -
Apache Tomcat 4 error - cant fine a servlet
Hi,
I have a web.xml file that defines classes and url patterns fine. For some reason though, which I cant work out, even when I add the following to web.xml, Tomcat says it cant find the requested resourse.
http://localhost:8080/servlet/SimpleShoppingBasket
<servlet>
<servlet-name>SimpleShoppingBasket</servlet-name>
<servlet-class>SimpleShoppingBasket</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SimpleShoppingBasket</servlet-name>
<url-pattern>/servlet/SimpleShoppingBasket</url-pattern>
</servlet-mapping>
The error displayed is:
HTTP Status 404 - /servlet/SimpleShoppingBasket
type Status report
message /servlet/SimpleShoppingBasket
description The requested resource (/servlet/SimpleShoppingBasket) is not available.
Apache Tomcat/5.5.17
Every other servlet I have runs fine except this one. I have checked the spelling of the class and it is correct. I am nearing my wits end!
Please help! What could be wrong? Is there a cache that I can delete somewhere maybe?Try putting the servlet class into a package. There could be access problems with it being in the "unnamed" package
Check the tomcat logs for any errors that servlet may be creating ([TOMCAT]/logs directory)
Also is your web app installed in the ROOT directory or in its own context?
If in its own context then the url would be http://localhost:8080/mycontext/servlet/SimpleShoppingBasket
What do the other (working) servlet definitions look like?
How are they different from this one?
Maybe you are looking for
-
Can't find remote control code for Samsung BD-P2550
I am trying to configure my verizon fios remote to control my Samsung BD-P2550 using the DVD button on the remote. None of the suggested codes work nor does search for the code using the remote and the fast forward button for infinite attempts, PLE
-
In trying to reduce my CPU load, I compressed the Activity Monitor. Before I can use the compressed file, I mistakenly deleted it and now when I try to open it, I get the dreaded spinning wheel. After a long wait, I forced quit. What happened and how
-
Safari Crashes after loading the website.
Safari loads the website and gives a error message. It stops working. Please help me with a solution.
-
Am I missing some fundamental thing? "Save" button on LC NOT saving
I am using a Mackie Logic control and today an annoying bug has returned in Logic Pro 8.0.2 The "save" button DOES NOT SAVE.. the light on the LC flickers when you press the save button, but until you press "apple-S" the light will remain on, and the
-
Downloading a Manual in PDF.
I was directed here from Apple Store, to get a Manual Downloaded in PDF regarding my Macbook if it will install Lion. They had down it is Article HE39, Views-88539679, Last modified, 4/20/2009. They sent me to your website said you could download to