Rookie Problem:Connection Pool Class not found
Hi All,
I'm new to java (3 days now!) and I was writing some sample JSP code to learn about Connection Pooling using Sun Server 8... My goal here is to hopefully learn how to use Connection pooling so I can develop a DAO class that uses good design patterens. It appears that that my J2EE server is not finding my db providers connection pooling class. If this is my problem where should I add this reference? I was looking at the Admin Console and did not see a way to add it there?
Someone please send me down the right path :)
I think my error is...."Wrong class name or classpath for Datasource Object : {0}
java.lang.ClassNotFoundException: com.ibm.db2.jdbc.DB2ConnectionPoolDataSource" (see below for trace)
Thanks in advance for the help and tips
John
My test JSP source code......
<%/* JMM This page was created on 9/1/2004
The purpose of this page is to test and learn basic JSP Connection Snytax and flow
control */%>
<%/* **********Begin JSP Page Directives********** */%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="javax.sql.*"%>
<%@page import="java.sql.*"%>
<%@page import="javax.naming.*"%>
<%@page import="java.util.Hashtable"%>
<%/* ********** End JSP Page Directive ********** */%>
<%! String pageName = "Johns Test JSP Page";
String jndi_ereporting_nm = "jdbc/F0654TE1";
%>
<html>
<head><title><%=pageName%></title></head>
<body>
<%-- <jsp:useBean id="beanInstanceName" scope="session" class="beanPackage.BeanClassName" /> --%>
<%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
Importing the follwoing Libs<br>
<br>import javax.sql.*;
<br>import java.sql.*;
<br>import javax.naming.*;
<br>import java.util.Hashtable;
<br>
<br>Attempting to connnect to F0654TE1 using JNDI Lookup....
<br>
<%
DataSource ds = null;
Connection con = null;
Context ctx = null;
Hashtable env = null;
long nStartTime, nStopTime, nElapsedTime;
// Set up environment for creating InitialContext object
//humm.. whats stored in here ....what are these used for?
out.println("Context.INITIAL_CONTEXT_FACTORY=" + Context.INITIAL_CONTEXT_FACTORY + "<br>");
out.println("Context.PROVIDER_URL=" + Context.PROVIDER_URL + "<br>");
InitialContext ic = new InitialContext();
ds = (DataSource) ic.lookup(jndi_ereporting_nm);
out.println("open connection....<br>");
con = ds.getConnection();
out.println("connection has been opened!!!....<br>");
con.close();
out.println("connection has been closed!!!....<br>");
%>
<br>
<br>Finished attempting to connnect to F0654TE1 using JNDI....
</body>
</html>
Errror Log file.....
[#|2004-09-02T10:08:42.951-0400|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5099 : Wrong class name or classpath for Datasource Object : {0}
java.lang.ClassNotFoundException: com.ibm.db2.jdbc.DB2ConnectionPoolDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:198)
at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:65)
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:70)
at com.sun.enterprise.resource.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:63)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:501)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:176)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:314)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:260)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:244)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:137)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:194)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:94)
at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:68)
at org.apache.jsp.jsp.jndi_005fdb_005ftest_jsp._jspService(jndi_005fdb_005ftest_jsp.java:102)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
at java.lang.Thread.run(Thread.java:534)
|#]
[#|2004-09-02T10:08:42.961-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5038:Unexpected exception while creating resource|#]
[#|2004-09-02T10:08:42.961-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5117 : Failed to obtain/create connection. Reason : Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2ConnectionPoolDataSource|#]
[#|2004-09-02T10:08:42.961-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2ConnectionPoolDataSource]|#]
[#|2004-09-02T10:08:43.131-0400|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=11;|StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2ConnectionPoolDataSource
at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:72)
at org.apache.jsp.jsp.jndi_005fdb_005ftest_jsp._jspService(jndi_005fdb_005ftest_jsp.java:102)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
at java.lang.Thread.run(Thread.java:534)
|#]
Sorry this is not the way i usually handle db connectivity, i think you need to set up a name in your server.xml file (this is for tomcat based applicatin servers) which is then referenced in your jsp file. I have had a quick google and found this.
http://manual.evolutionhosting.com/evochunk/ch19s04.html
You menttioned that you wanted to devolp really good design patterns, how big is your project going to be, if it is going to be a large project then you may want to look at
http://www.hibernate.org
Similar Messages
-
Class Not Found Exception After Connecting From a JDeveloper
Hi,
I am following the tutorial on SOA and started to experience problems in deployments (all but the console, including em) after the connection to the remote weblogic (10.3.5) from JDeveloper. I would know if the connection modifies the WLS environment. Unfortunately I did not note the message before wiping the setup, but found many entries on Google referring to some ADF library. I followed the suggestion to apply the adf runtime to the WLS install but this not helped.
By the way, I would just understand if the remote connection from a JDeveloper adds some configuration which is then eventually not found in the target WLS.
Thanks
Fabio D'Alfonso
http://www.fabiodalfonso.comCan you check the log files of soa_server1, which are located in the <domain-home>/servers/<server-name>/logs.
There are probably some occurences of class not found exceptions.
When you are using the node manager to start your environment you have to make sure that StartScriptEnabled is set
to true in the nodemanager.properties file (located in the directory: <wl-home>/common/nodemanager
In the section "Starting the SOA environment" here - http://middlewaremagic.com/weblogic/?p=6040
an example is presented -
Class not found error over HTTPS connection
Problem: Facing problem in downloading signed JAR file over HTTPS connection.
While downloading the jar file over a https connection, i get a certificate with following message
" Do you want to accept the certificate from web site <server name> for the purpose of exchanging encrypted information? "
If i accept the ceritificate immediately without any delay, all goes fine. The jar file gets downloaded and the applet runs withoput any problem. But if we accept the certificate after some delay say after one or two minutes i get "Class not found error"
Has anybody come across any such issue ?
Thanks in advance.
RohitI got the same error. I believe the ssl connection has a short timeout.
But I don't think this is a bug because there is no sense in letting a ssl connection open in the initial state before accepting the server's certificate. -
Class not found problem in Tomcat Web app
Hi,
I created a Web Service using JWSDP. I want to invoke a Web service method from my servlet. It works fine on Win NT Workstation, but on Windows 2000 it gives class not found error because it fails to pick up the jars that come with the pack in common\lib directory. I copied the jars to all possible lib paths as below, but looks like there's something wrong with the class loader. This problem comes in all our win2k machines. Does anyone have any clue about this.
/WEB-INF/lib/*.jar of your web application
$CATALINA_HOME/common/endorsed/*.jar
$CATALINA_HOME/common/lib/*.jar
$CATALINA_HOME/shared/lib/*.jar
Thanks in advance,
Sriram.If it can't find servlet.jar in the Tomcat dir, you should do what I did. I copied servlet.jar to C:\j2sdk1.4.0_01\jre\lib\ext\servlet.jar
Then I added that to my CLASSPATH, and it finally found servlet.jar (it never found it in the Tomcat folder where it was). -
Facing class not found problem
Hi guys i am using c3-00 ,LAST day i just update my software version to 8.60 ,i really enjoyed the new update but i will face new problem, every application cant opened:it shows app error the details shown JAVA CLASS NOT FOUND ,and i try to reset my phone but the secuirty code also cahanged so i am really upsad with simley sad .any one please help me this is my no 9940922030.My mail id is [email protected]
Hi,
If you have not changed security code before, default code is 12345.
Try reset factory settings and if it does not help, please try to reupdate your phone with Nokia Suite.
At last maybe it is best you visit to the nearest Nokia Care Point ni your area.
Br
mahayv -
Installation problem on redhat 6.0, class not found
I have followed the instructions for installing oracle 8i. When i run runIns.sh I get the following error message:
class not found: oracle.sysman.oii.oiic.OiicInstaller
Does anyone know what this means? and what do i have to do?<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by am():
probably you don't use jre116_v5. Install it and alter all symlinks to the old jre/jdk.
Note: Don't use any jdk at all or any jre which is newer than jre116_v5!<HR></BLOCKQUOTE>
Thanks for the reply, but, yes, I've already done that.
null -
Class not found in applet using 2 jar files
I have an applet which has been working for years as a stand alone or connecting directly to a derby database on my home server. I have just changed it to connect to MySQL on my ISP server via AJAX and PHP.
I am now getting a class not found error in my browser, probably because I'm stuffing up the class path.
The HTML I am using to call the applet is:
<applet code="AMJApp.class"
codebase="http://www.interactived.com/JMTalpha"
archive="AMJ014.jar,plugin.jar"
width="500"height="500"
MAYSCRIPT style="border-width:0;"
name="jsap" id="jsap"></applet>The AMJ014.jar contains the applet and supporting class files.
The error message is strange to me because it refers to a class I noticed on another web page but which has nothing to do with my applet. Anyway, the message in full is:
load: class NervousText.class not found.
java.lang.ClassNotFoundException: NervousText.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: NervousText.class
java.lang.UnsupportedClassVersionError: AMJApp : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
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 sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.access$100(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.UnsupportedClassVersionError: AMJApp : Unsupported major.minor version 51.0Thanks again.
The page code is:
<html>
<head>
<title>Applet to JavaScript to PHP</title>
</head>
<body>
<script type="text/javascript">
function updateWebPage(myArg)
document.getElementById("txt1").innerHTML=myArg;
if (myArg=="")
document.getElementById("cbxItem").innerHTML="";
return;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=function()
if (xmlhttp.readyState==4 && xmlhttp.status==200)
document.getElementById("cbxItem").innerHTML=xmlhttp.responseText;
xmlhttp.open("GET","putitem.php?id="+myArg,true);
xmlhttp.send();
</script>
<form>
<table border=1 align='center' cellpadding=0 cellspacing=0 >
<tr><td style='text-align:center; background-color:#C0C0C0'>Compiled Java Applet</td></tr>
<tr><td><applet code="AMJApp.class" codebase="http://www.interactived.com/JMTalpha" archive="AMJ014.jar" width="500"height="500" MAYSCRIPT style="border-width:0;" name="jsap" id="jsap"></applet> </td></tr>
<tr><td style='text-align:center; background-color:#C0C0C0'>HTML Textbox filled by JavaScript</td></tr>
<tr><td><textarea style='width:500px; height:50px' name='txt1' id='txt1'>Query goes here</textarea></td></tr>
<tr><td style='text-align:center; background-color:#C0C0C0'>HTML diagnostic messages rendered by PHP script</td></tr>
<tr><td><div id="cbxItem">PHP info will populate this space</div></td></tr>
</table>
</form>
</body>
</html>The URL of the problem page is:
http://www.interactived.com/JMTalpha/AMJTest.htm
The code in the page is based on the following test page, which works:
http://www.interactived.com/test5Applet.htm
And the Applet, before I made any changes can be seen at this address:
http://www.interactived.com/jartest0906.htm
Thanks again for you interest.
Edited by: 886473 on 21-Sep-2011 00:47 -
Class not found error while executing jar file
I have written a java code in which i am connecting to database....when i run the class file using......java class_filename it works........
but when i run the jar file using .......java -jar jar_name ...yi gives me the error as 'Class not found'......
can anybody help me please......
Thanks and Regards,
Siddheshthat class is part of jar file.....in classpath i have included zip files for jdbc ...to get databse connection.....and the jar being executed ................still it gives the error ClassDefnotfound which i think is due to database connection problem.....the exception is raised while.....
Class.ForName("Driver_name").newInstance();/ This driver is present in zip files that i have added in classpath....
above statement doesn,t giv error while i execute the class file............but exception while executing jar file only..
Thnaks and regards,
siddhesh -
Class not found error for COM.ibm.db2.jdbc.app.DB2Driver
i have written this code:
import java.io.*;
import java.sql.*;
public class tryjdbc
{ public static void main (String args[])
{ try
{ Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"); }
catch (java.lang.ClassNotFoundException e)
{ System.out.print(e.getMessage()); }
and once i try to run it, it gives out a class not found exception error.
I haven't changed anything with the classpath since I don't think the problem is with the classpath. I have read in the IBM Developer Kit for Java documentaton that the AS/400 Developer Kit for Java automatically adds the db2_class.jar file to the classpath. So why do I get a class not found exception error?I was using Web Spehere 4.0.3 and trying to connect to a database on DB2 7.2. I was just following a tutorial and trying to get a handle on Web Sphere. I am running all of these on a Windows 2000 Operating System. Here are some of my observations :
a. db2java.zip packaged under %DB2ROOT%\SQLLIB\JAVA, does not work.
b. CLASSPATH needs to be set to %DB2ROOT%\sqllib\java12\db2java.zip
c. Include this as one of the packages in the package defined in
WebSphere, using the Java Perspective.
d. Ensure that case sensitivity is respected. All though the package
shows up as COM.ibm.db2.jdbc.app.DB2Driver, for some reason, it
will only accept com.ibm.db2.jdbc.app.DB2Driver.
With these settings, I was able to connect to a db2 database.
I am a little puzzled on the following. I did not include java.io package, but still it could print the messages. Did anybody have a similar experience
Thanks for this posting. -
Interesting Class Not Found Exception on Client Side of RMI
I am having trouble getting my client to start up using RMI. I am running my server on a linux platform and everything seems to be starting up just fine. Here is how I start the server:
WEBSITE=/home/ian/html
SOFTWARE=/home/ian/software
java -ea \
-cp $WEBSITE/BNS/classes/ \
-Djava.rmi.server.codebase=http://1.paturi.usher.ucsdsys.net/BNS/classes/ \
-Djava.security.policy=/home/ian/software/BNS/RMI.policy \
-DPREP=$SOFTWARE/prepped \
-DARCH=$SOFTWARE/output \
BNS.plumbing.Server $WEBSITE is my Apache Server home folder, which is running. However, now I move to a Windows machine and run IE or Firefox. I navigate to the Apache server and it comes up. Yet, when I try to logon to a client it tells me that the client is not inited.
Opening the Java Console reveals this error:
load: class BNS.plumbing.Client.class not found.
java.lang.ClassNotFoundException: BNS.plumbing.Client.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
BNS.plumbing.Client is not a Stub method. I have a ClientLiason class which provides the stub and it does not seem to have problem there. Also, when I simply navigate to [http://1.paturi.usher.ucsdsys.net/BNS/classes/BNS/plumbing/] the Client.class file is clearly there waiting to be used.
Here is what I run when starting server side to get the RMIRegistry (which has been started without a problem):
SessionHost sh = new SessionHost();
System.err.println("created an instance of "+ sh.getClass()+" as server");
Registry reg= LocateRegistry.getRegistry();
System.out.println(reg);
reg.rebind(Constants.serviceName, sh);
System.out.println(reg);
System.err.println(Constants.serviceName+" server ready.");I have played around with the Registry reg=LocateRegistry.getRegistry() line in particular. I have tried passing in "localhost" and "1.paturi.usher.ucsdsys.net" but all to no avail. Then latter is linux machine that I am using. It is a cluster server at UCSD. In order to access it I must first ssh into a UCSD machine and from there ssh into my machine (this is because it is not a full-fledged ip address, but part of UCSD's domain). I think this might have something to do with the trouble I have accessing the class file when I tried to get at them through a browser directed to my Apache Server.
I am not the greatest network guy, I know a lot more about programming and I am at my wits end here. I have searched everything I can think of, with little success. If anybody has any ideas or can even point me in the right direction it would be greatly appreciated.
Thanks!
IanI think your codebase annotation is being lost because Client.class is on the CLASSPATH of the Registry. There are two solutions:
1. Start the rmiregistry command in a directory other than the root of the package structure, e.g. /.
2. Use LocateRegistry.createRegistry() instead of getRegistry() in the server, and don't start the rmiregistry command at all. -
Class not found with jms cache sync
hi. when i try to use the remote command manager in my live environment only i get a class not found exception for my initial context factory. using a debugger i discovered this is actually hiding a linkage error. so i confirmed that my resin and java versions and all my jars are the same between live and stage, where this works no problem. but still doesn't work in production. any ideas what else i should look at? here's a stack trace
Exception [TOPLINK-22101] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.RemoteCommandManagerException
Exception Description: Could not obtain JNDI context with properties {java.naming.provider.url=tcp://10.10.6.73:3035, java.naming.factory.initial=org.exolab.jms.jndi.InitialContextFactory , java.naming.security.principal=tcp://10.10.6.73:3035, dedicated.connection=true, java.naming.security.credentials=tcp://10.10.6.73:3035}
Internal Exception: javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextFactory ]
at oracle.toplink.exceptions.RemoteCommandManagerException.errorObtainingContext(RemoteCommandManagerException.java:42)
at oracle.toplink.remotecommand.TransportManager.getContext(TransportManager.java:194)
at oracle.toplink.remotecommand.TransportManager.getRemoteHostContext(TransportManager.java:385)
at oracle.toplink.remotecommand.jms.JMSTopicTransportManager.getRemoteHostContext(JMSTopicTransportManager.java:270)
at oracle.toplink.remotecommand.jms.JMSTopicTransportManager.getTopicConnectionFactory(JMSTopicTransportManager.java:204)
at oracle.toplink.remotecommand.jms.JMSTopicTransportManager.createJMSTopicRemoteConnection(JMSTopicTransportManager.java:84)
at oracle.toplink.remotecommand.jms.JMSTopicTransportManager.createLocalConnection(JMSTopicTransportManager.java:106)
at oracle.toplink.remotecommand.jms.JMSTopicDiscoveryManager.startDiscovery(JMSTopicDiscoveryManager.java:44)
at oracle.toplink.remotecommand.RemoteCommandManager.initialize(RemoteCommandManager.java:132)
at oracle.toplink.publicinterface.DatabaseSession.login(DatabaseSession.java:509)I would guess the problem is related to the application's class-loader visibility. Verify that your application can access the class org.exolab.jms.jndi.InitialContextFactory forio to launching the TopLink session. If it cannot then you may need to address the container's access to this library.
Doug -
Class Not Found Error during provisioning
Hello,
I am running on jboss-4.0.3-SP1, OIM 9.0.3 latest patch. I am new to this implementation and just rebuilt the dev environment. I am checking the provisioning of the resources and ran into a class not found error.
The error says:
2011-10-19 10:23:17,111 DEBUG [XELLERATE.ADAPTERS] Class/Method: tcADPClassLoader/findClass entered.
2011-10-19 10:23:17,111 DEBUG [XELLERATE.ADAPTERS] Class/Method: tcADPClassLoader:findClass - Data: loading class - Value: com.jscape.inet.ssh.SshException
2011-10-19 10:23:17,112 ERROR [XELLERATE.SERVER] Error encountered in save of Data Object com.thortech.xl.dataobj.tcScheduleItem
2011-10-19 10:23:17,112 ERROR [XELLERATE.SERVER] Class/Method: tcDataObj/save encounter some problems: com/jscape/inet/ssh/SshException
java.lang.*NoClassDefFoundError*: com/jscape/inet/ssh/SshException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpFAPROVISIONING.implementation(*adpFAPROVISIONING.java:92*)
at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
xxxxxxxxxxxxx
When I looked at the process task named "FA Provisioning", line 92, I see this reference:
90:
91: //Initialize persistant object "INIT"
92: clsINIT = Class.forName("*com.cpsg_inc.oim.unix.SSHCommandExecutor*");
93: maoConstructorArgs = new Object[]{};
94: masConParamTypes = new Class[]{};
95: moCons = clsINIT.getConstructor(masConParamTypes);
96: INITconsObj = moCons.newInstance(maoConstructorArgs);
xxxxxxxxxxx
When I open the adapter task named iNIT Connection (this is the first task in the FA Provisioning process task Adapter), API Source: JavaTaskJar:cpsgUnix.jar
Application API: com.cpsg_inc.oim.unix.SSHCommandExecutor
Constructors: 0 public com.cpsg_inc.oim.unix.SSHCommandExecutor()
Methods: 9 public void com.thortech.xl.integration.tenetssh.helper.SSHPrvosioning.SSHInit(...)
xxxxxxxxxxxx
Then I made sure the jar file named cpsgUnix.jar is present in the OIM_HOME/JavaTasks directory.
But still I have the error.
What am I missing?
thanks
KhanhThanks everyone for your input.
I added the sshfactory.jar file in the JavaTask folder and it worked.
Thanks again.
Khanh -
Jdbc.app.DB2Driver ? class not found
in my code i have a string
private static String COM_IBM_DB2_JDBC_APP_DB2DRIVER = COM.ibm.db2.jdbc.app.DB2Driver;and my connection code
Connection conn;
Class.forName(COM_IBM_DB2_JDBC_APP_DB2DRIVER).newInstance();
conn = DriverManager.getConnection(JDBC_DB2 + SERVER, USERID, PWD);when i run my code i get this error
java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2DriverClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:241)
at java.lang.ClassLoader.loadClass(ClassLoader.java:516)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:460)
at java.lang.ClassLoader.loadClass(ClassLoader.java:448)
at java.lang.Class.forName0(Native Method)
at main(testCon.java(Compiled Code))
i am not sure why i get the error. im my CLASSPATH i have
C:\SQLLIB\java\db2java.zip;
where the driver is.
any suggestions on what else i am missing?? thanks in advance
annieI had the same problem. But I was compiling and running code at command line on Windows XP.
My db2java.zip was located here C:\Program Files\some_folder\SQLLIB\java\ and jxl.jar was located somewhare else.
In order to keep all these files in one place, I created a folder "D:/classes" and added db2java.zip and jxl.jar to it.
Then set the classpath like this set CLASSPATH=D:\classes\jxl.jar;D:\classes\db2java.zip;.
Now everything works fine. No more class not found errors. -
Oracle.forms.webutil.ole.OleFunctions class not found
Hi all,
I am getting oracle.forms.webutil.ole.OleFunctions class not found at design time in Forms Builder 10gR2 as well as at run time when working with webutil. Webutil is properly configured. I am using file uploading and downloading and it is working fine. but when I m working with CLIENT_OLE2, it is giving class not found exception. Can someone please help me to identify the problem.
Thanks in advance
Bilalhi
Forms [32 Bit] Version 10.1.2.0.2 (Production in this version the webutil is already installed but u have to sign jars and there is also some modifications
in formsweb.cfg.
please check this.
How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
Solution
Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
here are steps to get a small test form running, using WebUtil 1.06.
Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
Feel free to copy this note to a text editor, and do a global find/replace on
[OraHome] with your actual value (no trailing slash). Then it is easy to
copy/paste actual commands to be executed from the note copy.
1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
2) Copy or move jacob.jar and jacob.dll
[JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
cd [JacobStage]
copy jacob.jar [OraHome]\forms\java\.
copy jacob.dll [OraHome]\forms\webutil\.
The Jacob staging area is no longer needed, and may be deleted.
3) Sign frmwebutil.jar and jacob.jar
Open a DOS command prompt.
Add [OraHome]\jdk\bin to the PATH:
set PATH=[OraHome]\jdk\bin;%PATH%
Sign the files, and check the output for success:
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
you may skip this step. Otherwise,
Create a schema to hold the WebUtil stored code, and privileges needed to
connect and create a stored package. Schema name "WEBUTIL" is recommended
for no reason other than consistency over the user base.
Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
out the EXIT statement, to be able to see whether the objects were created witout
errors.
Start SQL*Plus as SYSTEM, and issue:
CREATE USER webutil IDENTIFIED BY [password]
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp;
GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
CONNECT webutil/[password]@[connectstring]
@[OraHome]\forms\create_webutil_db.sql
-- Inspect SQL*Plus output for errors, and then
CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
Reconnect as SYSTEM, and issue:
grant execute on webutil_db to public;
5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
to the CLASSPATH entry.
6) Start the OC4J instance
7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
It is important to generate the PLX, to avoid the FRM-40039 discussed in
Note 303682.1
If the PLX is not generated, the Webutil.pll library would have to be attached with
full path information to all forms wishing to use WebUtil. This is NOT recommended.
8) Create a new FMB.
Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
There is no need to Subclass the WebutilConfig object.
Attach the Webutil.pll Library, and remove the path.
Add an ON-LOGON trigger with the code
NULL;
to avoid having to connect to an RDBMS (optional).
Create a new button on a new canvas, with the code
show_webutil_information (TRUE);
in a WHEN-BUTTON-PRESSED trigger.
Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
the "Application Server URL" is empty.
Then append "?config=webutil" at the end, so you end up with a URL of the form
http://server:port/forms/frmservlet?config=webutil
10) Run your form.sarah -
Sometimes getting a load: class name .class not found error
I have an applet running in a hidden frame. It runs fine with Microsoft JVM but when run with Sun JVM it sometimes is fine and other times fails with the error message below.
Does anyone know why this is happening?
load: class <name>.class not found.
java.lang.ClassNotFoundException: <name>.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Malformed reply from SOCKS server
at java.net.SocksSocketImpl.readSocksReply(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.http.HttpClient.privilegedOpenServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.New(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.createConnection(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 moreAfter some more investigation... I have finally found the problem... I think!!!
Suns JVM took my browsers default connection settings:
HTTP IP PORT
SECURE IP PORT
FTP IP PORT
GOPHER IP PORT
SOCKS IP PORT
All of these are set in my browser.
It seems that Suns JVM orders the way it connects to the Internet.
Basically the JVM was trying to access the Internet via the SOCKS server settings and not the HTTP.
To fix the problem I un-ticked the "use browser settings" check box in the Java plugin proxies tab and just added the HTTP IP and PORT of our proxy server that goes out onto the Internet.
I then tried the applet and it worked!!!
Does anyone know why the JVM orders connections in this way?
Maybe you are looking for
-
How can I create a Lion USB Thumb Drive with the 11E2068 build?
It seems that the Lion build from the Mac App Store is not compatible with my Macbook Pro Retina 15''. It's seems I would need the the build 11E2068 for my USB thumb drive to work properly. I don't want to go through the internet recovery and loose 8
-
IPod Touch Newbie: What is the purpose of the iTunes app on my iPod Touch?
What is the purpose of the iTunes app on my iPod Touch? All it does is connect to the iTunes store if I'm near a WiFi connection. It appears to be useful only for impulse purchasing of media. So why is it not named "iTunes Store"? It appears to have
-
I recently migrated from MacBook Pro to MacBook Pro retina. Now my macbook will not print to my LaserJet3200 printer. I downloaded the drivers but still only prints a line of gibberish per page, and endless pages, when i send printer a print job. Any
-
Hello I have a problem connecting to shares on at NSS4000 with windows 2008 server and windows 7 below is the CIPS log fil. Do anyone have some suggestions? Apr 4 14:33:56 LILLYNAS nmbd[4513]: [2012/04/04 14:33:56, 0] nmbd/nmbd.c:main(711) Apr 4 14:3
-
How to unlock my iphone if i forgot my pin
I managed to activate the phone locking feature and forgot the pin I used. Now the phone is locked and I don't know what to do. Please help