Connecting to MYSQL from RMI Server results SQL Communication fail
Hi ,
I have an RMI Server which exports a remote method, which in-turn needs to access content
from the MYSQL Database.
PROBLEM: The code snip for RMI Server is given below. In this getChief() is the remote method called
by the RMI Client running on my same Windows XP machine (ie., localhost).
I get a slew of exceptions when the DriverManager.getConnection() API call occurs in getChief()
via the remote method call from the RMI Client. Two exceptions are the SQL Communications failure and Access Denied Socket Exceptions.
I checked my policy file is OK and MySQL Server is running and my username/password is right in code?
Can you please let me know what am I missing in the RMI Server code?
I also found my code works if the Database Connection API is used within main() rather than inside a Remote
Method...
The Source and Binary are available in my local Windows XP Machine
RMI Server: c:/workspace/DirectoryJava/src/server for and c:/workspace/DirectoryJava/bin/server
RMI Client: c:/workspace/DirectoryJava/src/client for and c:/workspace/DirectoryJava/bin/client
My security policy file is:
grant codeBase "file:/workspace/DirectoryJava/bin" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
grant codeBase "file:/workspace/DirectoryJava/bin/client" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
grant codeBase "file:/workspace/DirectoryJava/bin/server" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
grant codeBase "file:/workspace/DirectoryJava/bin/directory" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
grant codeBase "file:/workspace/DirectoryJava/src/client" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
grant codeBase "file:/workspace/DirectoryJava/src/server" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
grant codeBase "file:/workspace/DirectoryJava/src/directory" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
permission java.net.SocketPermission "*","listen,connect,accept,resolve";
};I checked that mysqld.exe is running at port 3306 and am able to connect to and use it via
MySQL Command Client successfully.
Thanks in advance.
The Exception list is pasted below.
c:\workspace\DirectoryJava\bin>java -cp "c:/workspace/Directory
Java/bin/Directory.jar;c:/workspace/DirectoryJava/bin/server;c:/workspac
e/DirectoryJava/bin;C:/Program Files/MySQL/mysql-connector-java-5.1.6/my
sql-connector-java-5.1.6-bin.jar" -Djava.rmi.server.codebase=file:/c:/workspace/
DirectoryJava/bin/Directory.jar -Djava.security.policy=wideopen.policy
server.DirectoryEngine
DirectoryEngine bound
getChief() Called
SQLException: Communications link failure
Last packet sent to the server was 0 ms ago.
SQLState: 08S01
VendorError: 0
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link fai
lure
Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:282)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at server.DirectoryEngine.getChief(DirectoryEngine.java:91)
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.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
rce)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: java.security.AccessControlException: acces
s denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve)
at com.mysql.jdbc.StandardSocketFactory.unwrapExceptionToProperClassAndT
hrowIt(StandardSocketFactory.java:404)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
va:265)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
... 26 moreCODE SNIP:
=========
public class DirectoryEngine implements Directory {
public DirectoryEngine() {
super();
public Employee getChief() throws RemoteException {
Statement stmt = null;
ResultSet rs = null;
Employee emp = null;
// TODO Auto-generated method stub
try {
System.out.println("getChief() Called");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306",
"<username>","<password>");
// Username and Password were replaced with root username and password in my original code
System.out.println("getConnection() Called");
stmt = conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
System.out.println("createStatement() Called");
rs = stmt.executeQuery("use mysql");
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
ex.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
// it is a good idea to release
// resources in a finally{} block
// in reverse-order of their creation
// if they are no-longer needed
if (rs != null) {
try {
rs.close();
} catch (SQLException sqlEx){
// ignore
rs = null;
if (stmt != null) {
try {
stmt.close();
} catch (SQLException sqlEx) {
// ignore
stmt = null;
return emp;
} /* getChief() ends */
public static void main(String[] args) {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
try {
String name = "Directory";
Directory engine = new DirectoryEngine();
Directory stub =
(Directory) UnicastRemoteObject.exportObject(engine, 0);
Registry registry = LocateRegistry.getRegistry();
registry.rebind(name, stub);
Class.forName("com.mysql.jdbc.Driver").newInstance();
System.out.println("DirectoryEngine bound");
} catch (Exception e) {
System.err.println("DirectoryEngine exception:");
e.printStackTrace();
} /* end DirectoryEngine class */
It looks there is some permission issue.
Can you please try once with below policy and let me know the result.
grant {
permission java.security.AllPermission;
};
Similar Messages
-
Can't connect to MySQL from Oracle 11g R1
Hello Oracle's guru.
Sorry for my English it's not my native langauge
Enviroments: Oracle 11g R1, Windows 7, ODBC Driver 5.1.8
I have a some problem with creation gateway to connection to MySQL, and I hope somebody can help me.
So,
1) ODBC name - MYSQLDSN
2) initMYSQLDSN.ora
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
# HS init parameters
HS_FDS_CONNECT_INFO = MYSQLDSN
HS_FDS_TRACE_LEVEL = 0
3) listener.ora
# listener.ora Network Configuration File: E:\app\voxa\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=MYSQLDSN)
(ORACLE_HOME=E:\app\voxa\product\11.1.0\db_1)
(PROGRAM=dg4odbc)
4) tnsnames.ora
# tnsnames.ora Network Configuration File: E:\app\voxa\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
CXWH =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CXWH)
MYSQLDSN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
(CONNECT_DATA =(SID = MYSQLDSN))
(HS = OK)
Then I trying to connect to MySQL using sql*plus:
C:\Windows\system32>sqlplus
SQL*Plus: Release 11.1.0.6.0 - Production on Ср Июн 1 12:13:39 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
login: system
pass:
Connect to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create public database link MYSQLDSN
2 connect to DEMO identified by "DEMO" using 'MYSQLDSN';
Channel was created
SQL> select * from items@MYSQLDSN;
select * from items@MYSQLDSN
Error in line 1:
ORA-28500: connection with ORACLE with other system return message:
[MySQL][ODBC 5.1 Driver][mysqld-5.5.12]You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right
syntax to use near
'"ITEMS_KEY",A1."ITEM_NAME",A1."ITEM_CATEGORY",A1."ITEM_VENDOR",A1."ITEM_SKU",A1
.' at line 1
ORA-02063: предшествующий 2 lines из MYSQLDSN
If I trying create new ODBC mobule via OWB, I had next error:
[MySQL][ODBC 5.1 Driver][mysqld-5.5.12]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"DUAL"' at line 1
ORA-02063: предшествующий 2 lines из OWB_56
What I do wrong? Please help meHi,
You can download the 11.1.0.7 patchset from My Oracle Support -
support.oracle.com
as patch 6890831.
Once logged in click on 'Patches and Updates' and enter the patch number as 6890831 and choose whichever platform you are running.
the readme explains how to apply the patch to an existing 11.1.0.6 install.
The url you posted is only for complete product installs, but 11.1.0.7 is only a patchset that must be applied to an existing install.
Regards,
Mike -
Connecting to MySQL from Sun One Studio
Hi,
I am trying to connect to the MySQL from the Sun One Studio 5. I followed these steps.
1. I downloaded the MySQL software and installed on my local computer, it was successful.
2. I got the drivers [b][b][b]mysql-connector-java-3.0.8-stable-bin.jar and placed it in the <stdudio5>/lib/ext/ directory.
3. And I successfully got through that one also, and in the database section it showed me the icon for connecting to mysql database. I gave the url, username, and password. It worked fine.
4. Then I created the connection pool, JDBC resource, and Persistence manager for my server instance. It was also successful.
5. When I built a cmp bean accessing the table in mySQL database, it is giving me these errors.
If you notice these error, it is asking for vendor type. But i don't have any option to choose the vendor type when i configured the database resources.
Can soem body suggest some other method and clear this error. I am struggling with this since a week.
Thank you.
[[b]09/Oct/2003:11:12:31] WARNING ( 3476): Cannot get database metadata: database product name.
java.sql.SQLException: com.sun.enterprise.repository.J2EEResourceException
java.lang.ClassNotFoundException: org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource
at com.sun.enterprise.resource.SystemJdbcDataSource.internalGetConnection(SystemJdbcDataSource.java:252)
at com.sun.enterprise.resource.SystemJdbcDataSource.getConnection(SystemJdbcDataSource.java:154)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl.getConnection(TransactionHelperImpl.java:171)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.EJBHelper.getConnection(EJBHelper.java:169)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getDBName(SQLPersistenceManagerFactory.java:781)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:709)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:598)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:770)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:660)
at JAdminEntityBeans.JobinfoBean_1956195957_ConcreteImpl.jdoGetPersistenceManager(JobinfoBean_1956195957_ConcreteImpl.java:1479)
at JAdminEntityBeans.JobinfoBean_1956195957_ConcreteImpl.ejbFindByTitle(JobinfoBean_1956195957_ConcreteImpl.java:541)
at JAdminEntityBeans.JobinfoBean_1956195957_ConcreteImpl_RemoteHomeImpl.findByTitle(JobinfoBean_1956195957_ConcreteImpl_RemoteHomeImpl.java:175)
at JAdminEntityBeans._JobinfoHome_Stub.findByTitle(Unknown Source)
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 com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
[09/Oct/2003:11:12:31] INFO ( 3476): Bean Jobinfo method ejbFindByTitle: problems running JDOQL query.
com.sun.jdo.api.persistence.support.JDOFatalInternalException: Failed to get the vendor type for the data store.
NestedException: java.sql.SQLException: com.sun.enterprise.repository.J2EEResourceException
java.lang.ClassNotFoundException: org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getDBName(SQLPersistenceManagerFactory.java:802)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:709)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:598)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:770)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:660)
at JAdminEntityBeans.JobinfoBean_1956195957_ConcreteImpl.jdoGetPersistenceManager(JobinfoBean_1956195957_ConcreteImpl.java:1479)
at JAdminEntityBeans.JobinfoBean_1956195957_ConcreteImpl.ejbFindByTitle(JobinfoBean_1956195957_ConcreteImpl.java:541)
at JAdminEntityBeans.JobinfoBean_1956195957_ConcreteImpl_RemoteHomeImpl.findByTitle(JobinfoBean_1956195957_ConcreteImpl_RemoteHomeImpl.java:175)
at JAdminEntityBeans._JobinfoHome_Stub.findByTitle(Unknown Source)
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 com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)The AS7 error suggests that you have not set up the server startup classpath to include the driver jar. The steps to do this are included in the article mentioned in Chris's reply, namely:
http://developers.sun.com/tools/javatools/tips/tip03-08-22.html
Note especially the part starting with Step 3 under the section "Enabling the JDBC Driver in the IDE."
-Jane -
Problem to connect to mysql from servlet using a javabean
Hi,
I'm new here and beginner on java to.
I have problem to connect to MySql database, by a connection javabean.
It's the following: a HTML page calls a servlet and this servlet imports the package connection javabean.
It has no problem when I establish the connection inside the servlet, with all its methods (public and private). But i want to separate the code connection from servlet.
Detail: there is no problem, using the javabean to connect to MS Access database.
I put "mysql-connector-java-3.1.12-bin.jar" file inside WEB-INF/lib application and common/lib directories.
I set the classpath:
SET CLASSPATH=%CATALINA_HOME%\COMMON\LIB\mysql-connector-java-3.1.12-bin.jar;%CLASSPATH%
I think that the servlet cannot create an instance of javabean, because passed by catch exception of the servlet init method.
But I don't know why.
Please Why?
Below there are the fragment of errors, servlet code e javabean code.
Thank you.
Zovao.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
at CadServletFileBeanConexArq.doPost(CadServletFileBeanConexArq.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
Note: The line 47 is calling insertIntoDB javabean method.
========///////////////===============
// Here is the servlet CadServletFileBeanConexArq.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
import conJdbc.*;
public class CadServletFileBeanConexArq extends HttpServlet {
public ConexPed connect = null;
private String driver = "com.mysql.jdbc.Driver";
private String URL = "jdbc:mysql://localhost:3306/cadastro";
public void init( ServletConfig config )
throws ServletException
super.init( config );
try
connect = new ConexPed(driver, URL, "monty", "some_pass");
catch ( Exception e )
e.printStackTrace();
connect = null;
public void doPost( HttpServletRequest req,
HttpServletResponse res )
throws ServletException
boolean success = true;
String email, nome, sobrenome, produto, valor;
email = req.getParameter( "Email" );
nome = req.getParameter( "Nome" );
sobrenome = req.getParameter( "Sobrenome" );
produto = req.getParameter( "Produto" );
valor = req.getParameter( "Valor" );
res.setContentType( "text/html" );
if ( email.length() > 0 && nome.length() > 0 && sobrenome.length() > 0 && valor.length() > 0 )
/* inserting data */
success = connect.insertIntoDB(
"'" + email + "','" + nome + "','" + sobrenome + "','" + produto + "'", Double.parseDouble(valor) );
//closing connection
public void destroy()
connect.fecharConexao();
=============///////////////============
Here is the JavaBean.
package conJdbc;
import java.sql.*;
public class ConexPed
public Connection connection;
public Statement statement;
public ConexPed (String driver, String urlServidor, String user, String password)
try
Class.forName(driver);
connection = DriverManager.getConnection(urlServidor,user,password);
catch (ClassNotFoundException ex)
System.out.println("N�o foi poss�vel encontrar a classe do Driver: " + driver);
catch (SQLException ex)
System.out.println("N�o foi poss�vel conectar ao servidor");
try
statement = connection.createStatement();
catch (SQLException ex)
System.out.println("N�o foi poss�vel criar a statement");
*Inserting data to database
public synchronized boolean insertIntoDB( String stringtoinsert, double valor)
try
statement.executeUpdate( "INSERT INTO pedido values (" + stringtoinsert + " , " + valor + ");" );
catch ( Exception e ) {
System.err.println(
"ERROR: Problemas ao adicionar nova entrada" );
e.printStackTrace();
return false;
return true;
* Close statement.
public void fecharStatement()
try
statement.close();
catch (SQLException ex)
ex.printStackTrace();
* close database
public void fecharConexao()
try
connection.close();
catch (SQLException ex)
ex.printStackTrace();
}Hi,
I'm new here and beginner on java to.
I have problem to connect to MySql database, by a connection javabean.
It's the following: a HTML page calls a servlet and this servlet imports the package connection javabean.
It has no problem when I establish the connection inside the servlet, with all its methods (public and private). But i want to separate the code connection from servlet.
Detail: there is no problem, using the javabean to connect to MS Access database.
I put "mysql-connector-java-3.1.12-bin.jar" file inside WEB-INF/lib application and common/lib directories.
I set the classpath:
SET CLASSPATH=%CATALINA_HOME%\COMMON\LIB\mysql-connector-java-3.1.12-bin.jar;%CLASSPATH%
I think that the servlet cannot create an instance of javabean, because passed by catch exception of the servlet init method.
But I don't know why.
Please Why?
Below there are the fragment of errors, servlet code e javabean code.
Thank you.
Zovao.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
at CadServletFileBeanConexArq.doPost(CadServletFileBeanConexArq.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
Note: The line 47 is calling insertIntoDB javabean method.
========///////////////===============
// Here is the servlet CadServletFileBeanConexArq.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
import conJdbc.*;
public class CadServletFileBeanConexArq extends HttpServlet {
public ConexPed connect = null;
private String driver = "com.mysql.jdbc.Driver";
private String URL = "jdbc:mysql://localhost:3306/cadastro";
public void init( ServletConfig config )
throws ServletException
super.init( config );
try
connect = new ConexPed(driver, URL, "monty", "some_pass");
catch ( Exception e )
e.printStackTrace();
connect = null;
public void doPost( HttpServletRequest req,
HttpServletResponse res )
throws ServletException
boolean success = true;
String email, nome, sobrenome, produto, valor;
email = req.getParameter( "Email" );
nome = req.getParameter( "Nome" );
sobrenome = req.getParameter( "Sobrenome" );
produto = req.getParameter( "Produto" );
valor = req.getParameter( "Valor" );
res.setContentType( "text/html" );
if ( email.length() > 0 && nome.length() > 0 && sobrenome.length() > 0 && valor.length() > 0 )
/* inserting data */
success = connect.insertIntoDB(
"'" + email + "','" + nome + "','" + sobrenome + "','" + produto + "'", Double.parseDouble(valor) );
//closing connection
public void destroy()
connect.fecharConexao();
=============///////////////============
Here is the JavaBean.
package conJdbc;
import java.sql.*;
public class ConexPed
public Connection connection;
public Statement statement;
public ConexPed (String driver, String urlServidor, String user, String password)
try
Class.forName(driver);
connection = DriverManager.getConnection(urlServidor,user,password);
catch (ClassNotFoundException ex)
System.out.println("N�o foi poss�vel encontrar a classe do Driver: " + driver);
catch (SQLException ex)
System.out.println("N�o foi poss�vel conectar ao servidor");
try
statement = connection.createStatement();
catch (SQLException ex)
System.out.println("N�o foi poss�vel criar a statement");
*Inserting data to database
public synchronized boolean insertIntoDB( String stringtoinsert, double valor)
try
statement.executeUpdate( "INSERT INTO pedido values (" + stringtoinsert + " , " + valor + ");" );
catch ( Exception e ) {
System.err.println(
"ERROR: Problemas ao adicionar nova entrada" );
e.printStackTrace();
return false;
return true;
* Close statement.
public void fecharStatement()
try
statement.close();
catch (SQLException ex)
ex.printStackTrace();
* close database
public void fecharConexao()
try
connection.close();
catch (SQLException ex)
ex.printStackTrace();
} -
Can't connect to MySQL from Flex
Hi,
I just started learning Flex a week ago and I'm still a noob
in this area.
I recently discovered about Cairngorm and tried to understand
it.
I managed to understand the Cairngorm diagram and applied
that in my "Login" function.
My problem is when I define a database connection to MySQL, I
would get error in my Flex application, but when i define static
variable the whole application would work just fine.
The error is "NetConnection.call.failed: HTTP:failed"
I'm using Zend Amf as the server.
Please tell me what is the problem. Thanks!
Regards,
Joni
============ Edit ================
I'm sorry,
I just did some fix and this is the more specific details.
If I use this code in my PHP
mysql_connect(DBHOST, DBUSER, DBPASS);
mysql_select_db(DBNAME);
$query = "SELECT * FROM school";
$result = mysql_query($query);
return "test";
Flex would be able to "get" the return value.
But if I used this code
mysql_connect(DBHOST, DBUSER, DBPASS);
mysql_select_db(DBNAME);
$query = "SELECT * FROM school";
$result = mysql_query($query);
return $result;
Flex would get an error.
Please help.
Thanks.
Regards
JoniI am not a php guy really so here is what I would do in this
situation. Using the Flex Builder data wizard, I would generat a
crud appliation against the mySQL table and see how the resulting
php code returns data back to flex.
HTH
STeveR -
Unable to connect to MySql from eclipse
Hi,
I searched a number of threads and forums but was unable to find the reason for this issue. Please find my code belo.
import java.sql.Connection; import java.sql.DriverManager; public class MySql { /** * @param args */ /** * @param args */ /** * @param args */ public static void main (String[] args) { Connection conn = null; try { String userName = "root"; String password = "secret"; String url = "jdbc:mysql://locahost:3306/test"; Class.forName ("com.mysql.jdbc.Driver").newInstance (); conn = DriverManager.getConnection (url, userName, password); System.out.println ("Database connection established"); if(!conn.isClosed()) System.out.println("Successfully connected to " + "MySQL server using TCP/IP..."); } catch (Exception e) { System.out.println(e.getLocalizedMessage()); } } }
I added the mysql connector in the build path of eclipse but it still doesn't work.
It gives Communication Link Failure Exception or sometimes com.mysql.jdbc.Driver
I am able to connect to the server thru the GUI tool of MySql. I created the dsn in windows with name test using the MySql driver.
Please help me out.public static void main (String[] args)
Connection conn = null;
try
String userName = "root";
String password = "secret";
String url = "jdbc:mysql://locahost:3306/mydbtest";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
//String url = "jdbc:odbc:mydbtest";
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
if(!conn.isClosed())
System.out.println("Successfully connected to " +
"MySQL server using TCP/IP...");
catch (Exception e)
System.out.println(e.printStackTrace());
}Stack trace below
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1122)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2260)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:357)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at MySql.main(MySql.java:30)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1122)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:344)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:293)
... 13 more -
Connection to DB from App server fails ORA-1017
Oracle Enterprise Manager 10g Application Server Control 10.1.2.0.2
DB server1 - Has two DB instances SID=X, SID=Y
DB server2 - Has two DB instances SID=Y, SID=ZApplication server Tnsnames.ora file had entries for X and Y.
Y =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =DB server1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Y.WORLD)
)After Y,Z are installed in DB server2 (without dropping Y DB from DB server1) tnsnames.ora modified as follows
Y =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =DB server1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Y.WORLD)
)to
Y =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =DB server2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Y.WORLD)
)Now from Forms applications deployed in application server , we can connect to Z but we cannot connect to Y. We can connect to DB Y via SQL*Plus from Application server.
Need kind suggestions.
Best Regards,
LokanathHi Lokanath,
Check this parameter
SQL> SHOW PARAMETER SEC_CASE_SENSITIVE_LOGON
NAME TYPE VALUE
sec_case_sensitive_logon boolean TRUEIf value is True set it to False.
SQL> ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
System altered.Try this Hope it works.
Regards
Santosh Mahajan
Edited by: SanOra13 on Mar 15, 2012 11:59 PM -
How to connect to mysql from java app
hi
please say the procedure for connecting to mysql database from java app.
.) what should i give in environmental variables
.)where can i find the driver class for the mysql
.) syntax of the url
eg:- DM.getConnection("jdbc:mysql:..............what comes here..............");You can also get connections from a DataSource. Simple example:
MysqlDataSource msds = new MysqlDataSource();
msds.setUrl("jdbc:mysql://127.0.0.1:3306/dbdame");
msds.setUser("user");
msds.setPassword("pass");
Connection c = msds.getConnection();Explore your options and be sure to consider connection pooling. -
Kicking out a client from rmi server
I have a few clients on a rmi server .
how can I disconnect a client from the server?
the client is an applet.
I treid calling a method containning System.exit(0)
from the server on to the client but it throws a
java.securtiy .. exception?
so how can I close down the client applet from the server?
thanksplease help
shall I throw a remote exception on the server -
"UnknownHost" exception while connecting to mysql from web dynpro
Hi
I am trying to connect to Mysql 5.0 database from web dynpro application.I am using NWDS 7.1.
I have followed this blog and created the datasource in NWA.
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8675
I have written the following code in my web dynpro application.
InitialContext ctx;
try{
ctx=new InitialContext();
DataSource ds=(DataSource)ctx.lookup("jdbc/dbconnect");
Connection conn=ds.getConnection();
wdComponentAPI.getMessageManager().reportSuccess("connected");
Statement stmt=conn.createStatement();
String query="select Col from TestTable";
ResultSet res=stmt.executeQuery(query);
while(res.next())
String str1=res.getString(1);
wdComponentAPI.getMessageManager().reportSuccess(str1);
}catch (Exception e) {
wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
// TODO: handle exception
But I m getting the following error as "UnknownHost exception"
I checked with the datasource created in NWA.Here in the Driver status it is showing the driver as unknown.
I have added the following driver.
mysql-connector-java-5.0.8-bin.jar
Any idea on how to solve this problem?
Do I need to add the driver in my application also.
Thanks in advance,
SumangalaHi,
Have you created a datasource in Visualadmin?
Was that tested and was it success full?
If you havent done this this could be your issue
make sure the following code is using the correct datasource
DataSource ds=(DataSource)ctx.lookup("jdbc/dbconnect");
Regards
Ayyapparaj -
Send Message from RMI Server to RMI Client
Hi,
I want to send message to RMI Client throw RMI server to refresh client's data object as it is database application. I guessed i could implement an interface on client side and i can register my client to the server by sending object to the server. It is not helping it is throwing NULL Pointer exception on server side and it is not refreshing. It seems like it is not passing by reference.
Can any one please guide me with how to send messages to clinet. What is the best way to do it?
-A Thakkar.You need to elaborate the object model of your client. When you run into this situiation where you might have to sublass two different objects, then you should take a look at breaking the client itself into more than one object.
Let me put it another way: A JFrame is a GUI object; why would you ever try to callback a GUI object? Can't you create - say - a CallbackHandler, and let it initiate further action in the client? -
Hi
How to configure any connection from SAP to MySQL, I want to use result in ABAP.
I heard about legacy JDBC to MySQL but which transaction is for this ? and what I need? Netveawer and somehitng more?
Edited by: Kosmo on Oct 20, 2009 10:43 AMIt isn't possible
-
Connecting to MySQL from another machine.
I use following code to connect to my database.it works
String databaseUrl = "jdbc:mysql://localhost:3306/test";
but when i use
String databaseUrl = "jdbc:mysql://192.168.0.205:3306/test";{
it gives error (192.168.0.205 being my ip address)
error
message from server : "Host TRAIN5" is not allowed to connect to this MySQL server.
Is that because of my connection string?It is because of your configuration. It has to do with user permission.
Read the MySQL manual, again (you have read it, haven't you?), and pay close attention to user administration and the "GRANT" statement. -
Connecting to MySQL from an Applet
Hi !
I have some serious Problem connecting from within my Applet to a MySQL-DB. Everything is fine until i try to establish a Connection ( I use mm.mysql-driver ). The Driver seems to be correctly loaded, but when it comes to connection I get the following Error : Connection failed, Are you sure, that there is a MySQL-Database running at the specified target bla bla bla .....
I guess, that it is some Problem with the Applet not beeing certified, but as it is only intended for INTRAnet use, I don't really care about security. Has anybody a quick workaroud for my Problem ?
Thanx in advance
Regards
Markward Schuberti would try to connect to that database with application, if that fails as well then there is no applet certification problem
usually this kind of error is printed when you try to connect to some database that is not there
and with an applet you need to put applets binaries and database in the same server, because applet can connect only to the host where from it was loaded
i hope that some of it helped
L. -
Connecting to oracle from j2ee server.
this is my resource.properties file.
jdbcDataSource.0.name=jdbc/Cloudscape
jdbcDataSource.0.url=jdbc\:cloudscape\:rmi\:CloudscapeDB;create\=true
jdbcDataSource.1.name=jdbc/DB1
jdbcDataSource.1.url=jdbc\:cloudscape\:rmi\:CloudscapeDB;create\=true
jdbcDataSource.2.name=jdbc/DB2
jdbcDataSource.2.url=jdbc\:cloudscape\:rmi\:CloudscapeDB;create\=true
jdbcDataSource.3.name=jdbc/EstoreDB
jdbcDataSource.3.url=jdbc\:cloudscape\:rmi\:CloudscapeDB;create\=true
jdbcDataSource.4.name=jdbc/InventoryDB
jdbcDataSource.4.url=jdbc\:cloudscape\:rmi\:CloudscapeDB;create\=true
jdbcDataSource.5.name=jdbc/Oracle1
jdbcDataSource.5.url=jdbc\:oracle\:thin\:@rocky.ny.com\:1521\:ecom;create\=true
jdbcDataSource.6.name=jdbc/mysql
jdbcDataSource.6.url=jdbc\:mysql\://localhost\:3306/test;create\=true
jdbcDriver.0.name=COM.cloudscape.core.RmiJdbcDriver
jdbcDriver.1.name=com.mysql.jdbc.Driver
jdbcDriver.2.name=oracle.jdbc.driver.OracleDriver
jdbcXADataSource.0.name=jdbc/XACloudscape
jdbcXADataSource.0.classname=COM.cloudscape.core.RemoteXaDataSource
jdbcXADataSource.0.dbpassword=
jdbcXADataSource.0.dbuser=
jdbcXADataSource.0.prop.createDatabase=create
jdbcXADataSource.0.prop.databaseName=CloudscapeDB
jdbcXADataSource.0.prop.remoteDataSourceProtocol=rmi
jdbcXADataSource.1.name=jndi/OracleDriver
jdbcXADataSource.1.classname=oracle.jdbc.driver.OracleDriver
jdbcXADataSource.1.dbpassword=
jdbcXADataSource.1.dbuser=
jdbcXADataSource.2.name=jndi/mysqlDriver
jdbcXADataSource.2.classname=com.mysql.jdbc.Driver
jdbcXADataSource.2.dbpassword=
jdbcXADataSource.2.dbuser=
jmsCnxFactory.0.name=QueueConnectionFactory
jmsCnxFactory.0.isQueue=true
jmsCnxFactory.1.name=TopicConnectionFactory
jmsCnxFactory.1.isQueue=false
jmsCnxFactory.2.name=jms/QueueConnectionFactory
jmsCnxFactory.2.isQueue=true
jmsCnxFactory.3.name=jms/TopicConnectionFactory
jmsCnxFactory.3.isQueue=false
jmsDestination.0.name=jms/Queue
jmsDestination.0.isQueue=true
jmsDestination.1.name=jms/Topic
jmsDestination.1.isQueue=false
and JNDI for resource is "jdbc/Oracle".
when i run a client application, it returns error message like this..
Binding name:`java:comp/env/ejb/SimpleSavingsAccount`
Caught an exception.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: nested exception is: javax.ejb.EJBException: Unable to connect to database. Oracle not found; nested exception is:
javax.ejb.EJBException: Unable to connect to database. Oracle not found
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:64)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at SavingsAccountHomeStub.create(Unknown Source)
at SavingsAccountClient.main(SavingsAccountClient.java:29)
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 com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:229)
at com.sun.enterprise.appclient.Main.main(Main.java:155)
Caused by: java.rmi.RemoteException: nested exception is: javax.ejb.EJBException: Unable to connect to database. Oracle not found; nested exception is
javax.ejb.EJBException: Unable to connect to database. Oracle not found
at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:389)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:431)
at SavingsAccountBean_RemoteHomeImpl.create(SavingsAccountBean_RemoteHomeImpl.java:48)
at SavingsAccountBeanRemoteHomeImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:520)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:210)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:255)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
Caused by: javax.ejb.EJBException: Unable to connect to database. Oracle not found
at SavingsAccountBean.setEntityContext(SavingsAccountBean.java:168)
at com.sun.ejb.containers.EntityContainer.getPooledEJB(EntityContainer.java:1239)
at com.sun.ejb.containers.EntityContainer.getContext(EntityContainer.java:197)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:365)
at SavingsAccountBean_RemoteHomeImpl.create(SavingsAccountBean_RemoteHomeImpl.java:40)
... 7 more
please help... can't figure it out... thanks for anybody's help...java.rmi.RemoteException: nested exception is:
ion is: javax.ejb.EJBException: Unable to connect to
database. Oracle not found; nested exception is:That is the crux of your problem. The Server is unable to locate the database. Or to be more technical precise, it cant connect to it. This may be a configuration issue or a network issue. you will have to get in touch with your Network Administrator or DBA. Find out if the JDBC url is correct. Find out if the classes is there in the classpath, etc.
Hope this helps
Have a nice day
Maybe you are looking for
-
Why is soundBooth missing from the Adobe Cloud Apps?
-
[SOLVED] Problem With Cups and Hp printer.
I am new to using cups. I usually have my operating system do everything for me. Arch seems to be a lot more tricky though. I have an HP Deskjet 6980 printer. I have been able to successfully use it with Ubuntu, Debian, and Fedora. I noticed that Arc
-
Anyone know how iDisk is implemented on the iPad? I was hoping I could have Pages and Numbers docs saved on my iDisk that I could open up, edit and save on my iPad which would then sync back via MobileMe to my other macs. Is this possible or can I on
-
Question about keyword hierarchies
Hi, I'm relatively new to Lightroom. I'm seeing an "interesting" behavior with respect to hierarchical keywords and I'd like to understand if it is correct. To start with, I've got an example keyword hierarchy for aircraft: So far so good. Now, I hav
-
Scrollpane Image Resize?
When you load an image into the scrollpane via the contentPath it displays the image full size, ie if the image is larger than the scrollpane window you get scroll bars so that you can view the complete image. Is there a way to resize the image so th