RMI server & JDBC
hello:
I am unable to connect using JDBC in an RMI server. I get ExceptionInInitializerError exception in oracle.jdbc.dbaccess.DBConversion. I have tried this same connection from an application and applet and both work fine.
The problem seems to arise when the RMISecurityManager is set.
Lou
In reply to reply #4:
You can also quote the other part of my reply when it comes to snippets. There are so many pieces of code missing from your snippet that I simply cannot guess what is wrong. (Please do not put your entire class structures here.)
We get connections in many different classes at many different times. It is after all an application that does user work and the user work involves database accesses. Some of those accesses are before RMI (to establish repositories, etc). Most are after.
This URL (jdbc:oracle:thin:@wonder.cisco.com:1521:ODSDEV) appears to use a network connection (yes?). Is the 1521 a port? Are you trying to reuse this port? (the first conn uses the same URL). What port does RMI use?
There is nothing in your snippet that stands out obviously as "this is wrong".
RMI uses networking. JDBC uses networking.
Try substituting some other networking code in place of the RMI code and see if you still get a null trying the second connection. As you say, if you leave out the RMI code the second get.conn works.
Try leaving out the first get.conn. Do the RMI and second get.conn.
Try this and try that and try some more. I once had this problem with a network printer that would not print. The code was fine. The URL was fine. The response from the network and printer were both fine. The damn thing just wasn't printing. Turns out there was this bit, yes a single bit, in one word of a property called the "start print bit". If this bit wasn't on, nothing happened. I tried every combination until I finally found it.
I wish you the best.
Similar Messages
-
Cant create JDBC Connections in RMI Server
I am having a pretty weird problem which I am struggling with for the last three days. In the main method of the Server object, following three things are supposed to happen:
1) Creation of a JDBC Connection
2) Creation of a Remote Object and then publishing the same to Registry.
3) Creation of another JDBC Connection (exactly same as in step1)
step 1 and 2 successfully executes and the third one always errors out. I just simply get a NullPointerException.
If I comment out step 2, step 3 executes successfully. Can someone please tell me the mystery? I need your response really urgently so please help me.
TIA
Code Snippet:
public static void main(String[] args) {
System.setSecurityManager(new RMISecurityManager());
try {
Properties dbProps = new Properties();
dbProps.put("user", "SDAWOODI");
dbProps.put("password", "SDAWOODI");
java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@wonder.cisco.com:1521:ODSDEV", dbProps);
catch (Exception sqle) {
System.out.println("[11111]"+sqle.toString());
Properties props = new Properties();
props.put("java.rmi.server.codebase", rmiCodeBase);
System.setProperties(props);
try {
SchedulerRImpl schedulerR = new SchedulerRImpl(ssce_sch1);
String nameStr = "s-sce-scheduler";
try {
Naming.bind(nameStr, schedulerR);
if (Scheduler.m_debug_flag) System.out.println("[Scheduler.main] Scheduler bound with RMI registry!!!");
catch (AlreadyBoundException abe) {
if (Scheduler.m_debug_flag) System.out.println("[Scheduler.main] Scheduler is already bound with RMI registry ... trying RE-bind ...");
try {
Naming.rebind(nameStr, schedulerR);
if (Scheduler.m_debug_flag) System.out.println("[Scheduler.main] Scheduler RE-bound with RMI registry!!!");
catch (Exception e) {
if (Scheduler.m_debug_flag) System.out.println("[Scheduler.main] Rcheduler RE-binding failed :(((");
catch (Exception e) {
if (Scheduler.m_debug_flag) System.out.println("[Scheduler.main] SchedulerR instantiation failed:((( : "+e.toString());
Properties dbProps2 = new Properties();
dbProps2.put("user", "SDAWOODI");
dbProps2.put("password", "SDAWOODI");
try {
java.sql.Connection connection2 = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@wonder.cisco.com:1521:ODSDEV", dbProps2);
if (connection2==null) {
System.out.println("connection is NULL");
else {
System.out.println("connection is NOT null");
catch (Exception sqle2) {
System.out.println("[22222]"+sqle2.toString());
}In reply to reply #4:
You can also quote the other part of my reply when it comes to snippets. There are so many pieces of code missing from your snippet that I simply cannot guess what is wrong. (Please do not put your entire class structures here.)
We get connections in many different classes at many different times. It is after all an application that does user work and the user work involves database accesses. Some of those accesses are before RMI (to establish repositories, etc). Most are after.
This URL (jdbc:oracle:thin:@wonder.cisco.com:1521:ODSDEV) appears to use a network connection (yes?). Is the 1521 a port? Are you trying to reuse this port? (the first conn uses the same URL). What port does RMI use?
There is nothing in your snippet that stands out obviously as "this is wrong".
RMI uses networking. JDBC uses networking.
Try substituting some other networking code in place of the RMI code and see if you still get a null trying the second connection. As you say, if you leave out the RMI code the second get.conn works.
Try leaving out the first get.conn. Do the RMI and second get.conn.
Try this and try that and try some more. I once had this problem with a network printer that would not print. The code was fine. The URL was fine. The response from the network and printer were both fine. The damn thing just wasn't printing. Turns out there was this bit, yes a single bit, in one word of a property called the "start print bit". If this bit wasn't on, nothing happened. I tried every combination until I finally found it.
I wish you the best. -
Hello,
this is the first time that I work with RMI.
In fact it isn't so hard.
But I've made an interface that do the operations on my database.
Do I also have to program a locking mechanism?
Does anybody made such a system, or what do you recommand.
I want to make a simpel program that uses a database on another pc.
tnxHi Twims
Im asking if you could make me a favor... As I can see you know RMI with JDBC... And at this moment I need a client and server programs to connect to a database, execute SQL commands and retrieve information to client.
If you could send me those programs please do it to [email protected] or [email protected]
Thanks in advance
ANDRES GONZALEZ -
i want a program RMI with JDBC code included.
Java RMI programs for implementing Author Registration.
/* File Name : AuthorServerint.java
Java Remote Interface for implementing Author Registration
import java.rmi.*;
public interface AuthorServerint extends java.rmi.Remote
public void Update_Details(String autid, String name,String
title,String street, String city, String state, int pin)
throws java.rmi.RemoteException;
File Name : AuthorServerimpl.java
Java Interface implementation and Server program for implementing
Author Registration
import java.rmi.*;
import java.sql.*;
import javax.swing.*;
public class AuthorServerimpl extends java.rmi.server.UnicastRemoteObject
implements AuthorServerint
static Connection con;
static PreparedStatement ps;
static ResultSet rs;
static Statement st;
int in;
public AuthorServerimpl() throws java.rmi.RemoteException
super();
public static void main(String args[])throws Exception
try{
AuthorServerint As=new AuthorServerimpl();
Naming.rebind("rmi://localhost/As",As);
System.out.println("Server ready");
catch(Exception e){
System.out.println(e);
public void Update_Details(String autid, String name,String
title,String street, String city, String state, int pin)
throws java.rmi.RemoteException
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:data");
st=con.createStatement();
if(autid.equals("") || name.equals("") || title.equals("") ||
street.equals("") || city.equals("") || state.equals(""))
JOptionPane.showMessageDialog(null,"Fill all the entries");
else{
in=st.executeUpdate("insert into Author values ('" autid
"','"+name+"','"+title+"','"+street+"','"+ city+
"','"+state+"','"+pin+"')");
if(in>0){
JOptionPane.showMessageDialog(null,"Data Updated");
catch(Exception e){}
File Name : Authorclient.java
Java Client program for implementing Author Registration
import java.rmi.*;
import java.io.*;
import java.rmi.Naming;
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Authorclient extends JFrame implements ActionListener
static JTextField tautid,tname,ttitle,tstreet,tcity,tstate,tpin;
JLabel lautid,lname,ltitle,lstreet,lcity,lstate,lpin;
static JButton Badd,Exit,Bclear;
String autid,name,title,street,city,state;
int pin;
Authorclient()
Container C=getContentPane();
C.setLayout(new GridLayout(9,2));
lautid=new JLabel("Author Id");
lname=new JLabel("Author Name");
ltitle=new JLabel("Title");
lstreet=new JLabel("Street");
lcity=new JLabel("City");
lstate=new JLabel("State");
lpin=new JLabel("Pincode");
tautid=new JTextField(10);
tname=new JTextField(10);
ttitle=new JTextField(10);
tstreet=new JTextField(10);
tcity=new JTextField(10);
tstate=new JTextField(10);
tpin=new JTextField(10);
Badd=new JButton("SUBMIT");
Exit=new JButton("EXIT");
Bclear=new JButton("CLEAR");
Badd.addActionListener(this);
Exit.addActionListener(this);
Bclear.addActionListener(this);
C.add(lautid);
C.add(tautid);
C.add(lname);
C.add(tname);
C.add(ltitle);
C.add(ttitle);
C.add(lstreet);
C.add(tstreet);
C.add(lcity);
C.add(tcity);
C.add(lstate);
C.add(tstate);
C.add(lpin);
C.add(tpin);
C.add(Bclear);
C.add(Badd);
C.add(Exit);
setVisible(true);
resize(300,300);
public void actionPerformed(ActionEvent ae)
if(ae.getActionCommand().equals("SUBMIT"))
try{
AuthorServerint A=(AuthorServerint)Naming.lookup ("rmi://
localhost/As");
autid=tautid.getText();
name=tname.getText();
title=ttitle.getText();
street=tstreet.getText();
city=tcity.getText();
state=tstate.getText();
pin=Integer.parseInt(tpin.getText());
A.Update_Details(autid,name,title,street,city,state,pin);
catch(Exception E){}
else if(ae.getActionCommand().equals("EXIT"))
System.exit(0);
else if(ae.getActionCommand().equals("CLEAR"))
tautid.setText("");
tname.setText("");
ttitle.setText("");
tstreet.setText("");
tcity.setText("");
tstate.setText("");
tpin.setText("");
public static void main(String args[])
new Authorclient();
note: this program is done using swing components and need a database to run. The fields of the table("Author") database("data") are the same as the variable used in "Update_Details" function.
Edited by: Amar on Oct 30, 2007 12:11 PM -
MS SQL Server JDBC 2.0 datasource creation issue using Visual Admin
Hi,
I need to create an MS SQL Server JDBC 2.0 DataSource using the Visual Admin (running on NetWeaver 2004 SP19). I'm using the Microsoft SQL Server 2005 JDBC driver. Have no problem creating a Version 1.x (no XA support) DataSource.
The issue is that when I try to create a Version 2.0 (with XA support) datasource I get the following exception: java.sql.SQLException: Invalid DataSource reference
This is the setup I used:
JDBC Version "2.0 (with XA support)
JDBC 2.0 Compliant:
object factory: com.microsoft.sqlserver.jdbc.SQLServerDataSourceObjectFactory
datasource type: XADataSource
xads class name: com.microsoft.sqlserver.jdbc.SQLServerXADataSource
On the additional tab:
databaseName=fldev_jj
portNumber=1433
serverName=dbsrv61
user=fldev_jj
password=******
Even added the url, but that made no difference. Chose Vendor SQL,
and have initial connections set to 1. This url worked when used
with a version 1.x datasource.
What can I try to do to resolve this?
Full exception:
java.rmi.RemoteException: com.sap.engine.services.dbpool.exceptions.BaseRemoteException: Error during start of application "factorylogic.com/FactoryLogicBusinessDS". [id = StartupError]
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:608)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
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.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 4557350:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "FactoryLogicDS".
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1843)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:489)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4707)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
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.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.dbpool.exceptions.BaseInstantiationException: Cannot create instance XAManagedConnectionFactoryImpl.
at com.sap.engine.services.dbpool.spi.XAManagedConnectionFactoryImpl.<init>(XAManagedConnectionFactoryImpl.java:131)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1760)
... 42 more
Caused by: java.sql.SQLException: Invalid DataSource reference.
at com.microsoft.sqlserver.jdbc.SQLServerDataSourceObjectFactory.getObjectInstance(Unknown Source)
at com.sap.engine.services.dbpool.spi.XAManagedConnectionFactoryImpl.<init>(XAManagedConnectionFactoryImpl.java:129)
... 43 more
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:663)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
... 31 more
Caused by: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 4557350:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "FactoryLogicDS".
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1843)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:489)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4707)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
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.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.dbpool.exceptions.BaseInstantiationException: Cannot create instance XAManagedConnectionFactoryImpl.
at com.sap.engine.services.dbpool.spi.XAManagedConnectionFactoryImpl.<init>(XAManagedConnectionFactoryImpl.java:131)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1760)
... 42 more
Caused by: java.sql.SQLException: Invalid DataSource reference.
at com.microsoft.sqlserver.jdbc.SQLServerDataSourceObjectFactory.getObjectInstance(Unknown Source)
at com.sap.engine.services.dbpool.spi.XAManagedConnectionFactoryImpl.<init>(XAManagedConnectionFactoryImpl.java:129)
... 43 more
at com.sap.engine.services.deploy.server.application.ParallelAdapter.sleepClientThread(ParallelAdapter.java:270)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:127)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4707)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
... 33 more
at com.sap.engine.services.dbpool.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:178)
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 java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1016)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1337)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
at javax.management.MBeanException.writeObject(MBeanException.java:126)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1301)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1252)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1057)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1337)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
at com.sap.exception.BaseExceptionInfo.writeObject(BaseExceptionInfo.java:964)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1301)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1252)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1057)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1337)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1309)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1252)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1057)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at com.sap.engine.services.jmx.ResponseMessage.writeBody(ResponseMessage.java:177)
at com.sap.engine.services.jmx.Message.writeMsg(Message.java:257)
at com.sap.engine.services.jmx.Message.getMsg(Message.java:453)
at com.sap.engine.services.jmx.Message.writeExternal(Message.java:505)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1272)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1250)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1057)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:66)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)Leaving the object factory empty is absolutely part of the solution.
I can now start the data source and it can get a connection.
The remaining problem is that the moment I try to do anything with xa (inside of netweaver, using the datasource) I get an xa error... Found a way around that by changing the datasource type from "XADataSource" to a "ConnectionPoolDatasource".
The problem with that is that I'm no longer sure it uses XA transactions...
Will do more testing...
Very helpful reply Yuri!
Thanks -
XDK 9i Issues : setXSLT - NullPointerException And RMI Server hangs
Present Scenario :
JDK 1.3
Oracle DB : 8.1.6
JDBC Driver : OracleThin.jar
XML Parser : xmlparserv2.jar : ( size = 1121488 )
XML-SQL utility : xsu12.jar : ( size = 180522 )
We use RMI with JDBC. RMI server object connects to database , uses xsu12.jar and xmlparserv2.jar to convert data into XML. Servlet connects to RMI server and gets this XML. Everything works fine.
Problem Scenario :
Since this parser does not support JAXP , I downloaded XDK 9i from oracle site.(9.2.0.1.0 - Dated 01/31/02 ) . After extracting , I replaced xmlparserv2.jar and xsu12.jar with this new ones. And problem started. There are 2 problems :
A. setXSLT( String, String ) throws NullPointerExcpetion
B. When I commented setXSLT method, RMI server completes execution of remote method which can be verified from Log. But it never returns , so client gets blocked. When RMI server is stopped by doing ctrl-C , client gets correct XML document.
Then I installed latest JDBC2.0 driver for 8.1.6 from site which is classes.zip. This also resulted in to same problems mentioned above. But it did work fine wirh earlier version of xmlparserv2.jar and xsu12.jar. Just FYI : I noticed significant size difference betwenn new and old jars.
New xmlparserv2.jar : size = 660421
New xsu12.jar : size = 473249
Thanks for patience
What could be possible solution ?Thanks Jinu
Problem A of setXSLT throwing NullPOinter Exception is solved. However problem B of RMI server not returning still there.
Just as an FYI , following is system
DB : oracle 8.1.6
xmlparserv2.jar : 9i xdk
xsu12_816.jar : 9i xdk
classes12.zip : JDBC2.0 for 8.1.6
When RMI server is stopped ( ctrl- C ) , client gets correct XML document alongwith proper Node names as set in setStyleSheet( String, String). -
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;
}; -
Urgent Help Required For Starting RMI server from servlet.
I am currently working on rmi project.
I want to send request to remote machine(Web host) where my application is from desktop client .For that we are using RMI.
I am writing servlet and inside it i am binding object to registry for rmi server.
which will be deployed on remote server.
code ....
Registry reg;
reg=LocateRegistry.createRegistry(1099);
Server server=new Server("server");//class whose remote object to be accessed
//extends unicast remote object.Implement ServerInt interface which extends Remote.
reg.bind("server",server);
When i am trying to access this object i am getting following exception.
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
on: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: ServerModule.ServerInt]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at RequstReplication.main(RequstReplication.java:27)
Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested excep
tion is:
java.lang.ClassNotFoundException: ServerModule.ServerInt
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
... 4 more
Caused by: java.lang.ClassNotFoundException: ServerModule.ServerInt
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
... 5 more
I can access naming enumeration of registry and object bound to it.
by following program.I shows corect objects.
Context namingContext=new InitialContext();
NamingEnumeration<NameClassPair> e=namingContext.list("rmi:");
while(e.hasMore())
System.out.println(e.next().getName());
While when i start RMI server from simple java program i can access these objects from registry.
I am not getting what is problem problem.Is there any other way to send request?
Plese give quick response.I am currently working on rmi project.
I want to send request to remote machine(Web host) where my application is from desktop client .For that we are using RMI.
I am writing servlet and inside it i am binding object to registry for rmi server.
which will be deployed on remote server.
code ....
Registry reg;
reg=LocateRegistry.createRegistry(1099);
Server server=new Server("server");//class whose remote object to be accessed
//extends unicast remote object.Implement ServerInt interface which extends Remote.
reg.bind("server",server);
When i am trying to access this object i am getting following exception.
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
on: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: ServerModule.ServerInt]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at RequstReplication.main(RequstReplication.java:27)
Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested excep
tion is:
java.lang.ClassNotFoundException: ServerModule.ServerInt
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
... 4 more
Caused by: java.lang.ClassNotFoundException: ServerModule.ServerInt
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
... 5 more
I can access naming enumeration of registry and object bound to it.
by following program.I shows corect objects.
Context namingContext=new InitialContext();
NamingEnumeration<NameClassPair> e=namingContext.list("rmi:");
while(e.hasMore())
System.out.println(e.next().getName());
While when i start RMI server from simple java program i can access these objects from registry.
I am not getting what is problem problem.Is there any other way to send request?
Plese give quick response. -
Sql Exception on Testing Configuration with SQL Server JDBC driver for XA
I have a requirement of analyzing the behavior of SQL Server JDBC data sources for XA transactions in our application.We have been using Non-XA drivers for both Oracle and SQL Server as we had no requirement for transactions spanning across multiple databases in past.I have setup and tested the XA driver for Oracle (Oracle Driver (Thin XA) for Instance Connections 9.0.1,9.2.0,10,11) in Weblogic 11g and its working perfectly for transactions spanning across two databases.No when I am trying to configure weblogic 11g R1 for Sql server JDBC driver to support XA transactions with driver details as follows,
Server:Weblogic 11g R1
Driver Type: MS Sql Server
Database Driver :Oracle's MS SQL Server Driver(Type 4 XA) Version:7.0,2000,2005)
Database:SQL Server 2005(Single Instance)
and try to create a new data source and select "Test Configuration" and following error is thrown ,
<Mar 17, 2011 4:49:49 PM GMT+05:30> <Error> <Console> <BEA-240003> <Console encountered the following error java.sql.SQLException: [OWLS][SQLServer JDBC Driver][SQLServer]xa_open (0) returns -3
at weblogic.jdbc.sqlserverbase.BaseExceptions40.createAppropriateSQLExceptionInstance(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseExceptions40.createSQLException(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseExceptions.getException(Unknown Source)
at weblogic.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at weblogic.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
at weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at weblogic.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseStatement.commonTransitionToState(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseStatement.postImplExecute(Unknown Source)
at weblogic.jdbc.sqlserverbase.BasePreparedStatement.postImplExecute(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseStatement.commonExecute(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseStatement.executeUpdateInternal(Unknown Source)
at weblogic.jdbc.sqlserverbase.BasePreparedStatement.executeUpdate(Unknown Source)
at weblogic.jdbcx.sqlserver.SQLServerImplXAResource.executeXaRpc(Unknown Source)
at weblogic.jdbcx.sqlserver.SQLServerImplXAResource.executeXaRpc(Unknown Source)
at weblogic.jdbcx.sqlserver.SQLServerImplXAResource.open(Unknown Source)
at weblogic.jdbcx.sqlserverbase.BaseXAConnection.init(Unknown Source)
at weblogic.jdbcx.sqlserverbase.BaseXAConnection40.init(Unknown Source)
at weblogic.jdbc.sqlserverbase.BaseClassCreatorForJDBC40.createXaConnection(Unknown Source)
at weblogic.jdbcx.sqlserverbase.BaseXADataSource.getXAConnection(Unknown Source)
at com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:550)
at com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:450)
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:597)
at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:64)
at org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptor.wrapAction(ActionInterceptor.java:184)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.invoke(ActionInterceptors.java:50)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:58)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:87)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
at com.bea.console.internal.ConsolePageFlowRequestProcessor.processActionPerform(ConsolePageFlowRequestProcessor.java:261)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:256)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:133)
at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:686)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:142)
at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:106)
at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:199)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:47)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:130)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
I followed the instruction in weblogic jdbc drivers guide to configure the JTA Transactions to support XA on SQL Server machine and weblogic server which included,
1.Copying sqljdbc.dll copied to SQL_Server_Root/bin directory from WL_HOME\server\lib.
2.Copied instjdbc.sql to sql server machine and executed the script with following output,
Changed database context to 'master'.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_open', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_open2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_close', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_close2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_start', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_start2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_end', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_end2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_prepare', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_prepare2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_commit', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_commit2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_rollback', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_rollback2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_forget', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_forget2', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_recover', because it does not exist or you do not have permission.
Msg 3701, Level 11, State 5, Server SQLDB, Procedure sp_dropextendedproc, Line 16
Cannot drop the procedure 'xp_jdbc_recover2', because it does not exist or you do not have permission.
creating JDBC XA procedures
instxa.sql completed successfully.
3.Verified that MSDTC service is running on both SQL Server and weblogic machines with XA Transaction enabled and DTC option enabled for both inbound and outbound connections.
4.Copied sqljdbc.jar (version 3.0 downloaded from msdn portal) to "C:\Oracle\Middleware\wlserver_10.3\server\ext\jdbc\sqlserver" directory and updated weblogic_classpth variable in commEnv.cmd file.
set WEBLOGIC_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%BEA_HOME%\utils\config\10.3\config-launch.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;%FEATURES_DIR%\weblogic.server.modules_10.3.2.0.jar;%WL_HOME%\server\lib\webservices.jar;%ANT_HOME%/lib/ant-all.jar;%ANT_CONTRIB%/lib/ant-contrib.jar;C:\Oracle\Middleware\wlserver_10.3\server\ext\jdbc\sqlserver\server\ext\jdbc\sqlserver\sqljdbc.jar
Can some one please provide some input on whats causing this and any other steps needs to be followed to implement XA support using SQL Server JDBC driver.You seem to have done everything correctly and diligently. I would ask that you open
an official support case. -
Attempting to use SSL over RMI from a web application to a RMI server
Hi,
I am attempting to use SSL over RMI to a server. The client is the web
application that is hosted on WebLogic and that attempts to connect to the
server. There is no client or server verification at either the client or
the server end. The code works outside of WebLogic 7/8 but has the following
issues when running the web application inside weblogic:
java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
exception is:
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
actory.java:20)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
actory.java:115)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:79)
at
com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
ctionClient.java:59)
at
com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
lient.java:197)
at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1058)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:401)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:445)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:306)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5445)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:780)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3105)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
The code at the client that initiates the connection:
socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
socket.setEnabledCipherSuites(CIPHERS);
socket.setEnableSessionCreation(true);
Any ideas?
ThanksI don't see anything that indicates SSL was directly a factor in the
failure.
From the exception stack it looks like a more basic connectivity issue,
maybe the URL for the
RMI server is incorrect for some reason or the server was down.
It looks like you are doing something like this:
SSL client -> WLS server with servletA, servletA RMI client
(com.hyperion.css) -> RMI server
The connection failure appears to be the connection from servletA RMI client
to the RMI server.
Is that a correct picture?
Tony
"Gaurav Khanna" <[email protected]> wrote in message
news:[email protected]...
Hi,
I am attempting to use SSL over RMI to a server. The client is the web
application that is hosted on WebLogic and that attempts to connect to the
server. There is no client or server verification at either the client or
the server end. The code works outside of WebLogic 7/8 but has thefollowing
issues when running the web application inside weblogic:
java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
exception is:
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
actory.java:20)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
actory.java:115)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:79)
at
com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
ctionClient.java:59)
at
com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
lient.java:197)
at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1058)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:401)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:445)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:306)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5445)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:780)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3105)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
The code at the client that initiates the connection:
socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
socket.setEnabledCipherSuites(CIPHERS);
socket.setEnableSessionCreation(true);
Any ideas?
Thanks -
Error while registering RMI Server
Hi
I have a system connected to bradband with a static ip. I am planning to use this as the RMI server and any system connected to the internet as the client. Is this possible....?
I tried to bind the name to the registry and I get the following error.
C:\PROGRA~1\Java\jre1.5.0_06\bin>java -Djava.security.policy=policy HelloServer
HelloServer error: Connection refused to host: 59.144.28.215; nested exception i
s:
java.net.ConnectException: Connection refused: connect
java.rmi.ConnectException: Connection refused to host: 59.144.58.215; nested exc
eption is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at HelloServer.main(HelloServer.java:18)
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 sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
... 7 moreCan anyone help me by resolving this error.....what do you mean by intranet address?
If you use some NAT device (e.g, DSL, cable) that it is likely you won't be able to access the registry using the external IP address. In such case you need to open the registry port in the firewall. -
Not able to run a simple RMI server
I am running an RMI program like follwing
import java.rmi.* ;
import java.rmi.registry.* ;
import java.rmi.server.* ;
public class CallBeanServer extends UnicastRemoteObject implements ICallBeanServer
//main
public static void main(String args[]) throws Exception
int port = 1000 ;
Registry reg = null ;
if( args[0].equals("true"))
reg = LocateRegistry.createRegistry(port) ;
System.out.println("Successfully created registry") ;
else
reg = LocateRegistry.getRegistry(port) ;
System.out.println("Connected to existing registry") ;
CallBeanServer callBeanServer = new CallBeanServer(reg) ;
}//main
//constructor
public CallBeanServer(Registry reg) throws Exception, RemoteException
super() ;
reg.rebind("CallBeanServer",this) ;
System.out.println("CallBeanServer Object bound") ;
//my public method
public String callBeanServer() throws RemoteException
{ return "Success" ;
I have run the rmiregistry at port no 1000 like
rmiregistry 1000
I have compiled ICallBeanServer also and run rmic also over CallBeanServer like
rmic CallBeanServer
when I run this program using
java CallBeanServer false
it gives the follwoing errors
Connected to existing registry
Exception in thread "main" java.rmi.ServerException: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: CallBeanServer_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: CallBeanServer_Stub
java.lang.ClassNotFoundException: CallBeanServer_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at CallBeanServer.<init>(CallBeanServer.java:38)
at CallBeanServer.main(CallBeanServer.java:30)
Can you please tell me what is the error?
Thanks
Prashant GuptaAdd the classes (the stubs included) to the classpath when you start the registry.
-
Crazy Exception blocked my RMI server
Hi all one crazy exception is thrown when I try to start the server. Plz reply me the the possible cause and solution.
thanks in advance
The exception is :
Error starting service
java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
java.net.SocketException: JVM_Bind (code=10055)You cant listen / bind on port 0. Try a different port number greater than 1024. That should work out.
-
Load balancing on RMI Server Application
Hi there, I'd like to know more detail about load balancing on RMI server application, been digging the web for some time, but couldn't find much information, does anyone know any website or has the knowledge of load balancing on RMI to share? Sort like its design and implementation.
Thanks,
JaxI want performance and fault-tolerance,
In that case, is it necessary to have a main
rmi server to allow client to access and pick one of
the rmi servers for the client?Well, if you have one main RMI server, you have a single point of failure again.. Why can't your application know about all rmi servers, and randomly choose one? If it's down, pick a different one.. If your applicatoin is an applet, you'll have to sign it.. Do that and put it on 2 redundant web servers. You have performance by splitting the load and you have your fault tolerance by having x identical rmi servers.
If you're saying what I think, why would you have one main rmi server that picks a different rmi server? That's more work AND your redundancy goes byebye, ie if your main rmi server dies.. -
How to get the IP address of RMI server???
Hi:
Is there a way to know the IP address of RMI server before client and server connect?
I am assuming that client didn't know the IP address of the server.
Because I know that client must hold a server reference so that client can connect to server.
But I want my client program to find out server IP address before they connect and use this finding to connect to server.
Is it possible?
Thanks!So you KNOW that the client MUST know where the server is yet you want the client to find out where the server is?
Simple answer: forget it.
If you don't know where to connect to how are you ever going to connect to it?
And if you do know you don't have to go looking it up...
You can probably do something with JNDI, but then you're only putting off the inevitable as now you need to both know how to contact the JNDI server AND the JNDI server needs to know where the the RMI registry for the service you want to connect to is.
Maybe you are looking for
-
Macbook sleeping when screen open and wakes on close
I just repalced a busted screen on my Macbook 13"(white late early 2008) after it had falledn and broken the lcd screen. Everything went fine and the parts all went back together perfectly and without any uncertainty with teh exception of the small
-
Error while explicit creating relation object
Hello all ... i am using forms6i i.e. 'Forms [32 Bit] Version 6.0.8.8.0 (Production)' on Windows NT. it is not such a big problem, but ofcource affecting work. i am modifying a form that has a master block and five child blocks, while i am trying to
-
Nothing to add. I'm waiting for a new update to address the problems of this one--which has happened periodically in the past. The "educated guesses" below are incomprehensible.
-
Export to PDF is Being Cutoff-CP6
When exporting a project in CP6 (actually I tested in CP5.5 and it was the same), the PDF version cutoffs off the project when viewed at 100%. If you increase to 125%, you can see the whole project but then you have a white frame because it is bigger
-
Need to add JList to a Panel Please do help me out!!!
hi every body I need to add JList to Panel in a JTabbedPaneand having three columns by gridlayout,I have to add Jlist elements in one column and in the second one get elements from the database and place them in this column with a check and in third