Jdbc on tomcat problem
Hi all,
I'm experiencing a unusual problem in
Apache Tomcat/4.1
sdk:1.4.1_03-b02
Linux 2.4.20-8 i386
I've got an application running on commons-DBCP
everything seems ok:
- libs in the commons/lib folder
- datasource in the context:
<Resource name="jdbc/devel4_minePooledDS" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/devel4_minePooledDS">
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@10.10.45.4:1521:orlx</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30000</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>500</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>30</value>
</parameter>
<parameter>
<name>password</name>
<value>mine</value>
</parameter>
<parameter>
<name>username</name>
<value>mine</value>
</parameter>
</ResourceParams>
- enabled in web.xml:
<resource-ref>
<description>Resource for DB connections</description>
<res-ref-name>jdbc/devel4_minePooledDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
- used in this way:
InitialContext initCtx = new InitialContext();
DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/devel4_minePooledDS");
Connection conn = ds.getConnection();
- the application simply doesnt start with the following errors, not so helpful, to be honest:
2004-05-04 09:46:06 StandardWrapperValve[action]: Allocate exception for servlet action
javax.servlet.ServletException: Servlet.init() for servlet action threw exception
at org.apache.catalina.core.StandardWrapper.loadServlet(Unknown Source)
at org.apache.catalina.core.StandardWrapper.allocate(Unknown Source)
at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
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 -----
java.lang.StackOverflowError
at gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.acceptElement(ValidationConsumer.java:1795)
at gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.acceptElement(ValidationConsumer.java:1795)
at gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.acceptElement(ValidationConsumer.java:1795)
at gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.acceptElement(ValidationConsumer.java:1795)
at gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.acceptElement(ValidationConsumer.java:1795)
at gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.acceptElement(ValidationConsumer.java:1795)
I didn't find anything similar
any helop will be appreciated
thanks in advance
jc
Very worrisome.
Everything you posted looks right to me.
I'd forward those errors to the Tomcat mailing lists. They look like serious problems with Tomcat on Linux.
Similar Messages
-
These resets appear to coincide with a clearing of the cached queries for the DSN from memory, breaking all my sub queries that try to use the initial cached one. I am grasping at straws to discover the reset culprit, the DSN tests always show OK, there is not packet loss at the switch level. If anyone has some suggestions, I am all ears!
The resets are completely random and under no load. My sql 2008 r2 box is set to unlimited connections.
An example of a DSN setup is :
Maintain Connections [x]
String Format [ ]
Max Pooled Statements 100
Timeout 20 Interval 7
Query Timeout 0
Login Timeout 30
CLOB [ ]
BLOB [ ]
Long Text Buffer 64000
Blob Buffer 64000
Validate Connection [ ]
I am running the following :
CF Enterprise 10,0,13,287689
Tomcat 7.0.23.0
Ubuntu 1204 x64
Java VM 20.4-b02
Java 1.6 (Sun Microsystems Inc)
I have seen it suggested to uncheck the maintain connections advanced options but this doesn't seem like a good approach to the problem and will cause more stress on the sql box IMHO.
I have also seen it suggested to enable Validate Connection but documentation on this is a bit sparse...
Here are more examples of the initial reset error and then the subsequent cache related errors :
Database Error Information:
Native Error Code: 0
SQL State: 08S01
Query Error: [Macromedia][SQLServer JDBC Driver]A problem occurred when attempting to contact the server (Server returned: Connection reset). Please ensure that the server parameters passed to the driver are correct and that the server is running. Also ensure that the maximum number of connections have not been exceeded for this server.
Custom Error Code: 08S01
Database Error Information:
Native Error Code: 0
SQL State: n/a
Query Error:
Query Of Queries runtime error.
Table named GlobalDetails was not found in memory. The name is misspelled or the table is not defined.
Custom Error Code: n/a
Thanks in advance to anyone who has a suggestion.Hi, could DBA check MS SQL Server connection logs???
May be server has some limits (for example sessions, memory and e.t.c.) -
Sender JDBC Commn channel problem - Channel is not reading any data.
Hi,
I am referring to the following blog as i have exactly the same problem:
[Blog|Sender JDBC Commn channel problem;
I communication channel monitoring i am getting the following logs -
6/21/10 7:19:07 PM Processing started
6/21/10 7:19:07 PM Retry interval started. Length: 86400.0 seconds
Here in the channel the poling interval is 86400 seconds.
Now according to this blog the solution to my issue is "Check whether anything is locked in "Locking adapter" in VA? If there is then just release the lock and restart the comm channel. Note: In "locking adapter" the name will be something like $XIDBAD.JDBC2XI."
Mine is a PI7.1 system and i am not able to find any thing like this in NWA.
Can some one please help me on this?
Thanks & Regards,
Anshultry;
Goto NWA -> Availability and Performance Management -> Resource Monitoring -> Locks -
I don't know where the problem originate, the only thing in my memory is that the program worked very well on my PC yesterday, but today, without even slightest change, it doesn't work anymore. As to debug it, I simplified the codes to the least, but it still refuse to work. I was beaten down by this problem totally, and cannot make out any solution for it, so, I come here, hoping to find a warrior to kill this damned bug for me.
My program is a Servlet, but for the purpose of debugging, I have recode it to an Application/Servlet. When run as a application, I can get the result expected, but as a Servlet, :-(, maybe you should see it by yourself. My server software is Tomcat 4.1.15, and the JDK version is 1.4.0. To excute this program, you should add Data Source "Test" to ODBC.
///////////////////////code begins/////////////////////////
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class Ex extends HttpServlet
int ErrorType = 0;
String err = new String("");
public static void main(String args[]) throws Exception{
Ex cEx = new Ex();
cEx.init();
System.out.println(cEx.ErrorType);
public void init() {
String url = "jdbc:odbc:Test";
ErrorType = 3; //passed
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
ErrorType = 1; //trapped in Class.forName
try{
Connection c = DriverManager.getConnection(url);
} catch (SQLException e) {
e.printStackTrace();
ErrorType = 2; //trapped in DriverManager.getConnection
err = e.getMessage();
public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException {
res.setContentType("text/html; charset=GB2312");
PrintWriter out = res.getWriter();
out.println("Success " + "<p>" + ErrorType + "<p>" +err);
out.close();
//////////////////////////code ends///////////////////////////////
The result from the Servlet tell me that the problem occurred within the connection process, I don't know who should be responsible to this - Tomcat or JDBC?If you could print the exception that you got then that would help :) In the mean time, I could make a guess. It is unlikely that your application server (in this case, Tomcat) is blocking connections from your servlet. So the problem is either with JDBC directly or with the underlying datasource. It seems unlikely that it is JDBC given that you have stated that the code has not changed and it works in application form.
My guess would be that you are coming up against some sort of security constraint (eg: your DBMS is letting you log in from one IP but not another?, your Java plug-in security policy is disallowing the connection?). It's hard to say.
But if it works as an application but not via a servlet then you could try putting this in your java.policy file, which is located in the directory where your plug-ins are installed (eg: "C:\Program Files\Java\<version>\lib\security\") on Windows systems;
permission java.net.SocketPermission "bend xp:1099", "listen,connect,accept";
Try that, see if it works :)
Ben -
MySQL connection pooling (tomcat) problem
Hi all i just started learning servlets and i want to make a program in order to understand database connection pooling in tomcat.My problem is that when i run the servlet i created i get this error :
java.lang.NullPointerException org.DB.TestDB2.doGet(TestDB2.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
And that from tomcat log from netbeans :
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
.I configured tomcat server.xml file like this :
<Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true"> <Resource name="jdbc/phonebook_db" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="*******" password="********" removeAbandoned="true" removeAbandonedTimeout="120" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/test_phonebook_db?autoReconnect=true"/> </Context>
This is the resource reference i have in my web app web.xml file :
<resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/phonebook_db</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
And this is my servlet class :
package org.DB; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import javax.naming.*; import javax.sql.*; public class TestDB2 extends HttpServlet { private Connection conn ; private Statement stat ; private ResultSet rs ; private int counter; private Object rsValue; public void init() { try { InitialContext ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/phonebook_db"); conn = ds.getConnection(); } catch(Exception e) { e.printStackTrace(); } } public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { try { stat = conn.createStatement(); rs = stat.executeQuery("SELECT * FROM phones_table"); } catch (SQLException sqle) { sqle.printStackTrace(); } response.setContentType("text/html; charset=utf-8"); PrintWriter out = response.getWriter(); String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n"; out.println(docType +"<HTML>\n" + "<HEAD><TITLE>PhoneBook entries</TITLE></HEAD>\n"); counter = 0; try { while (rs.next()) { out.println("<h4>Entry no. " + (++counter) + "</h4>"); out.println("<table width=\"75%\" border=\"1\">"); out.println("<tr>\n"+ "<td width=\21%\"><b>LastName:</b></td>\n"+ "<td width=\"79%\">"); out.println((((rsValue = rs.getObject("LASTNAME"))==null || rs.wasNull())? "":(rsValue.toString()))); out.println("</td>\n</tr>\n" + "<tr>\n"+ "<td width=\21%\"><b>FirstName:</b></td>\n"+ "<td width=\"79%\">"); out.println((((rsValue = rs.getObject("FIRSTNAME"))==null || rs.wasNull())? "":(rsValue.toString()))); out.println("</td>\n"+ "</tr>\n"+ "<td width=\21%\"><b>Phone:</b></td>\n"+ "<td width=\"79%\">"); out.println((((rsValue = rs.getObject("PHONE"))==null || rs.wasNull())? "":(rsValue.toString()))); out.println("</td>\n" + "</tr>\n" + "</table>\n"+ "<br>\n<br>"); } } catch (SQLException sqle) { sqle.printStackTrace(); } out.println("</body>\n"+ "</html>"); } public void destroy() { try { rs.close(); stat.close(); conn.close(); } catch (SQLException sqle) { sqle.printStackTrace(); } } }{code} Any suggestions?Thank you for your answer.Yes my servlet class is something more worse than horrible(i don't use the database connection correct i don't use the MVC pattern i use out.println() ) but i just tried to take a ready example and try to understand .So i write this servlet myself as a starting point :
package org.DB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.sql.*;
public class DBServlet extends HttpServlet {
private Connection conn ;
private Statement stat ;
private ResultSet rs ;
private int counter;
String driver = "com.mysql.jdbc.Driver";
String dbURL = "jdbc:mysql://localhost:3306/phonebookdb?user=**********&password=************";
@Override
public void init() {
try {
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(dbURL);
}catch(Exception e) {
e.printStackTrace();
System.err.print("Unable to make connection ");
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet DBServlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet DBServlet at " + request.getContextPath () + "</h1>");
out.println("<br /><br /><br />");
if(conn!=null)
out.println("conn object : "+conn);
out.println("</body>");
out.println("</html>");
} catch(Exception sq) {
System.out.println("Exception" + sq.getMessage());
out.close();
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
public void destroy() {
try {
conn.close();
} catch (SQLException sqle) {
sqle.printStackTrace();
@Override
public String getServletInfo() {
return "A Simple Servlet";
}And it work for now.
Edited by: pavlos555 on Oct 21, 2008 10:21 AM -
Hi everybody,
I really need your expertise and help!!!
We had a server using resin, then they decided to move the application to Tomcat.
The server admin moved every thing by basically coping the JSP and JAVA files over.
Then he stopped working on it and they gave it to me :-(
and of course I have no expereince with this (No clue)
I managed to get the connection to the database with help from the web.
My problem is that I have two packages (mdx and sto) Both on the same level under classes folder.
(They CANNOT see each other) convertFunctions.java Class is in mdx package
******************Part of the error ********************
# javac convertFunctions.java
convertFunctions.java:3: package sto does not exist
import sto.*;
^
convertFunctions.java:12: package javax.mail does not exist
import javax.mail.*;
^
convertFunctions.java:13: package javax.mail.internet does not exist
import javax.mail.internet.*;
^
When I run the page on the we I get this error
"Error: HTTP Status 500 -" (It cannot see the methods inside the class)
convertMenus is inside convertFunctions
******************Part of the error ********************
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: Unable to compile class for JSP
An error occurred at line: 26 in the jsp file: /includes/admin_left_nav.jsp
Generated servlet error:
The method convertMenus(String, String) is undefined for the type convertFunctions
I can post any code you want.
Note that the same application/code is working great on resin.
Please help; I cannot explain how much I need your help
Any help would be greatly appreciated
Thank you in advanceI did what asked me to do then stop/start tomcat. It did not work.
I noticed that most of the errors are from changes I made to the classes: convertFunctions.java and UploadFile.java
I made the changes using (JDeveloper) on my windows machine and SSH (FTP) files to the SUN server.
Here is how I set the CLASSPATH on the sun box:
set CLASSPATH .:/usr/jakarta-tomcat-5.5.9/common/lib/servlet-api.jar:
/usr/jakarta-tomcat-5.5.9/common/lib/jsp-api.jar:
/usr/jakarta-tomcat-5.5.9/common/lib/servlet.jar $CLASSPATH
Here is my classpath after I tried to change it (No difference)
CLASSPATH=.://export/home/oracle/oracle/product/10.2.0/db_1/jdbc/lib:/usr/jakarta-tomcat-5.5.9/common/lib:/usr/jakarta-tomcat-5.5.9/server/lib:/lib:/usr/jakarta-tomcat-5.5.9/shared/lib:/usr/jakarta-tomcat-5.5.9/server/lib/servlet.jar:../../.:/usr/jakarta-tomcat-5.5.9/server/lib/classes12.jar
I really appreciate your help
Thank you in advance -
Netbeans + MySQL + Tomcat (problem with: not a known entity type)
I try to create WebApplication with Stripes in netbeans, but I have problem with connect to DB.
I have this code:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpaPU");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Person p = new Person();
p.setFirstName("name1");
p.setLastName("name2");
try
em.persist(p);
} catch(Exception e)
System.out.println(e.toString());
em.getTransaction().commit();
em.close();
emf.close();But in try{..} is em.persist(p); ant it prints into console this error: "java.lang.IllegalArgumentException: Object: db_entity.Person@13c7c35 is not a known entity type."
I do not know where is problem. Could you help me, please?
This is my persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="jpaPU" transaction-type="RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<properties>
<property name="toplink.jdbc.user" value="root"/>
<property name="toplink.jdbc.password" value="adminadmin"/>
<property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/test"/>
<property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="toplink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>When I run my application I can see in console:
[TopLink Info]: 2008.11.15 09:01:13.265--ServerSession(4794542)--TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
[TopLink Info]: 2008.11.15 09:01:13.578--ServerSession(4794542)--file:/D:/Workspace/NetBeansProjects/jpa/build/web/WEB-INF/classes/-jpaPU login successful..so, I hope persistence.xml is good
This is my class Person.java:
@Entity
public class Person implements Serializable {
@Id
@GeneratedValue
private Long id;
private String firstName;
private String lastName;
public void setId(Long id) { this.id = id; }
public Long getId() { return id; }
public String getFirstName() { return firstName; }
public void setFirstName(String firstName) { this.firstName = firstName; }
public String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }Please, help me.I had the same "is not a known entity type" error when running under a development environment Eclipse/Tomcat using Toplink. But the almost same code and configuration worked when running under Eclipse as a stand-alone Java app.
Eventually I figured out (actually trial and error), that I had checked the toplink-essentials.jar libraries to be exported under: Eclipse Project/Java Build Path/Order and Export. I was messing around with libraries. Unchecking the export option there fixed the problem.
While its unlikely that this could have been your exact problem, I would check the library order and export configurations. Looking at other message boards about this problem, many seemed to have been caused or fixed by playing with their libraries. -
JDBC Connection Driver Problem for Oracle in a J2EE servlet/class
Hi,
I am having a big problem with setting up a JDBC connection with my oracle database, I have been trying to fix it for about 6 hours now with no joy, I have read that many threads about JDBC, class paths etc.. that i dont know which way is up any more!!
Here is the issue:
(Please bare in mind that I am new to this when posting replies)
I have a Web Application set up as a project in the netbeans IDE. I have a servlet which creates a new object call dbaseFunc which is a public class I have wrote and within this class is a function called getAppConfigCon(). The code for this function is below:
public Connection getAppConfigCon()
Connection con = null;
try
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","cavdev", "password");
catch (SQLException e)
e.printStackTrace();
catch (ClassNotFoundException e)
e.printStackTrace(System.out);
return con;
The database is Oracle XE and is installed on the same machine I am developing on, the database is up and I can connect to it via the netbeans IDE database interface after telling it where the driver is (C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip). Obviously this is just IDE functionality and allows you to browse the database objects from netbeans however I now need to know how to tell the jre where the drivers are, right??
Well like I said multiple forums led me down the classpath route and I have a system environment variable called CLASSPATH set up with the oracle jdbc driver specified as its value, when i run the set command from the command line ( I am running Windows XP Pro) I can see the class path entry in the output as follows:
CLASSPATH=C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip
When I try to run my web app it doesnt assign the connection object with a value, i.e. when i was debugging my con object was null after calling the method mentioned above. After some time debugging i found a ClassNotFoundException was being thrown when the following command was executed:
Class.forName("oracle.jdbc.driver.OracleDriver");
Which I understand is because their is a problem with the class path but what is the problem??? The IDE likes the driver so why doesnt the jre.
I am runnin jdk and jre 1.5, an Oracle XE Database using the netbeans environment.
Some one please help me, I have spent far to much time on this rather than actually working on my project!!!!
Thanks
KeithWell After 10.5 hrs I actually sorted this myself, the two problems that were throwing me were this:
1. Netbeans does not stop the tomcat server when it finishes running the app, you either have to stop the server from the menu or exit netbeans, until the server restarts it will not pick up on any driver files you add to common/lib
2. You are very right Kiros tomcat does not do .zip files!!!!~~~###
In order to sort this I had to add the oracle driver as a package to my project using the netbeans ide Project > Libraries > New Jar file, this allowed me to access the oracle classes. Then I had to set the server up to deal with the drivers as well, this meant adding the .jar file (not the latest .zip as it wont work) to the bundled tomcat common lib directory and restart the server via the ide (using the start/stop bat files in the tomcat conf directory doesnt work for some reason when its bundled with netbeans!)
Thanks for the help guys but in the end it took 10 hrs a lot of reading and 2 bottles of lucozade to keep the brain goin.
Keith -
Hi,
I yust tried out,
- downloaded and installed the latest Tomcat
- downloaded and installed jstl.jar and standard.jar to ...\common\lib\
- copied my.war to ...\webapps\
the JDBC access is to a DB2/400 on an AS/400.
and run without any problem.
Just FYICopying WAR to <tomcat>/webapps, AFAIK, is not enougth.
You must "deploy" with Tomcat's manager.
Also,
Did you copy jt400.jar to <tomcat>/commons/lib ?
Did you register your data source in Tomcat's admin?
Did you create a resource link from application's context datasource to global datasource?
Regards. -
TOMCAT problem on REDHAT 9,PLEASE HELP
Hello, i am new to redhat and i installed tomcat 4.0.1 and it worked properly, i used tomcat for studying issues so i used to start it and stop it many times
now when i use mozilla and try to request the server using http://localhost:8080/ ,mozilla status bar shows "Transfering data from localhost" and loops for ever
so please help meI think this is not problem of redhat just check reinstalling tomcat.
-
Viewing Excel Files using Tomcat - Problem with caching
Hi all,
A small part of an application I'm writing has links to Excel files for users to view/download. I'm currently using Tomcat v5 as the web/app server and have some very simple code (an example is shown below) which calls the excel file.
<%@ page contentType = "application/vnd.ms-excel" %>
<%
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.sendRedirect("file1.xls");
%>
This all works except but I'm having one big problem.
The xls file (file1.xls) is updated via a share on the server so each month, the xls file is overwritten with the same name but with different contents. I'm finding that when an update is made to the xls file and the user then attempts to view the new file in the browser they recieve only the old xls file. It's caching the xls file and I don't want it to. How can I fix this so that it automatically gives the user the new updated file.
The only way I've managed to get Tomcat to do this is to delete the work directory and delete the file from my IE temp folder and then restart Tomcat - this is a bit much!
Any help would be greatly appreciated.
Thanks.I'd a problem with caching a few years back, for a servlet request which returned an SVG file.
As a workaround, I ended up putting appending "#" and a timestamp / random number after it. The browser assuming each request was new, and didn't use the cache.
Eg.
http://myserver/returnSVG.do#1234567
where 1234567 is a timestamp / random.
Not sure whether you can do this on a file based URL... but maybe worth a shot...
regards,
Owen -
Hi,
my problem is that after installing apache-tomcat-5.5.17.exe in xp, When i write http://localhost:8080/ in internet explorer after starting tomcat then it shows following error:
error
requested url could not retrieved
While trying to retrieve the URL: http://localhost:8080/
The following error was encountered:
Connection Failed
The system returned:
(111) Connection refusedThe remote host or network may be down. Please try the request again.
Your cache administrator is root. But when i type my ip insted of locahost then its working good.
Suppose
http://192.168.1.6:8080 then it is working.
what's the problem of my tomcat.
Is there anybody can help me.
With regards
BinaFirst try using http://127.0.0.1:8080. (127.0.0.1 is the ip address of localhost).
If that works then you need to update your host file to include an entry for localhost. You'll need to consult the help files, documentation or internet to determine the location of the host file for your operating system. -
Hi,
I worte a Servlet project using JBuilder 7 and TOmcat 4. THis is basically what i am doing...
I am getting an image from database and saving it to a folder in tomcat and then displaying it on a browser.
This application is used by multiple users...
I am saving the Image in Tom-cat...C:\JBuilder7\jakarta-tomcat-4.0.3\webapps\examples\Image1.jpeg
I am also displaying the image from that folder. The problem is when i run the application,
I am seeing the same Image on the screen..Its creating the different Image file, but the image is the same.
If i do a refresh on the page then it displays the new saved Image...
Also, If i save the image on my local and then display it from my local it changes the images as I
click on a Image list...
Following is how it works when i save it and display it from my local, but if i run my application from
another computer i am not able to see any of the images....Because its on my local.
fos = new FileOutputStream("C:/Image1.jpeg");
<img src="file:///C|/Image1.jpeg" height="855" name="myimage" align="middle" style="position:absolute;">;
And this is how i am doing when i am saving to the tomcat....I am able to display it on another computer
but would not change the image...
fos = new FileOutputStream("../webapps/examples/Image1.jpeg");
<img src="../Image1.jpeg" height="855" name="myimage" align="middle" style="position:absolute;">;
Can some one please tell me what could be the Problem....
Any help will be greatly appreciated....Thanks...The browser caches images so that it doesn't have to always download the same image for different pages.
You could:
1: Save the new image with a different name and dynamically change the name in the html.
2: Try setting the response headers to prevent the browser from caching the images.
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0); -
JDBC adapter configuration problem while design
Hi,
I am connecting SAP TO THIRD PARTY using RFC and JDBC,which is using a stored procedure.
I have mapped in such a way that
table = is mapped with the stored procedure name.
isinput = true.
type = char.
But If i look into the monitor its showing a problem with DATATYPE,which i have mentioned is char.The metioned below is log.
Can any one help me,what changes I have to make.
com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'STORED_PROCEDURE_NAME' (structure 'Statement'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'MaterialNumber' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)</SAP:AdditionalText>
<SAP:ApplicationFaultMessage namespace="" />
With Regards,
KishoreJ.hi kishore,
<i>Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'MaterialNumber'</i>
As the error implies, you have missed defining the TYPE attribute while for the field MATERIAL NUMBER. Assign a valid type to it , and it should work fine.
From the online help,
<i>The attribute type=<SQL-Datatype> , which describes the valid SQL data type, is mandatory for all parameter types (IN, OUT, INOUT).</i>
<i>The following SQL data types are supported:
INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output),CLOB (input and output), CURSOR (output; only in conjunction with the Oracle JDBC driver).</i>
Also, check this blog for any help,
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
Regards,
Bhavesh -
I am using a Receive Step to start a BPM with some DB Records, the Receive Step gets the resultset with some row elements but I notice that the message namespace is missing
<ns0:mt_avisoEst xmlns:ns0="urn:sap-dms:DMS_SAP_01">
</ns0:mt_avisoEst>
this is causing me problems with further mappings in the BPM, I am not using any message mapping for JDBC -> BPM. What am I doing wrong?
Thanks in advance.Dear Ruben,
In Integration Directory.
In JDBC Communciation channel .
Under the head of Processing parameters,
Give your namespace in <b>Document Namespace</b>
regards
Mahesh.M
Maybe you are looking for
-
I am trying to register my Appliances and when I try to click on "Save" or "Submit" I am unable on my MacBook pro. I have tried different browsers yet still same problem. Can anyone shed some light on this please.
-
Hi all I would know the current directory in my application with the employement of ora_ffi and I meet some problem like the return code not give the good result. I have whrite this code and I would know where is the error : PACKAGE BODY pkg_get_dire
-
Projector not being outputted by iMac
I am trying to connect a projector to my iMac (2011) and the video will not output. Is this simply because there is no cables that work with the Thunderbolt yet?
-
Dear All, In foreign currency valuation - i have one query. When we run the foreign currency valuation in SAP system posts one entry - that's for Exchange rate gain or loss, but why there is a reversal entry posted on next day. What entry is posted o
-
Upgrading a database from 8.1.7.2 to 10gR2 on another machine
Hello all, We have database DB1 (in version 8.1.7.2) on MACH1 (AIX 4.3) and I'd like to move this database to another machine called MACH2 (AIX 5.3) as Oracle10gR2 version (Oracle8.1.7.4 and Oracle10gR2 bianries are already installed on MACH2). MACH1