Registering standalone RMI server in WebLogic JNDI
Hi,
I need to register a standalone RMI server in WebLogic JNDI. I'm sure I've done this before, but now I'm having problems!
I have a standalone program which creates a remote object (implements Remote and extends UnicastRemoteObject). I am compiling my stubs with the Sun rmic compiler. I then create a JNDI InitialContext using wlclient.jar and a t3 url, and attempt to bind my remote object. It fails with the following exception:
javax.naming.NamingException: Unhandled exception in rebind() [Root exception is org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code
: 0 completed: No]I am using WLS 8.1sp4 and Sun JDK 1.4.2_05 (as shipped with WLS).
If I use the RMI registry (Naming.bind(), etc.) it works fine.
Thanks
Dan.
Danny Yates <> writes:
You should use PortableRemoteObject and generate iiop ties for your
impl. wlclient.jar runs on top of iiop.
andy
Hi,
I need to register a standalone RMI server in WebLogic JNDI. I'm sure I've done this before, but now I'm having problems!
I have a standalone program which creates a remote object (implements Remote and extends UnicastRemoteObject). I am compiling my stubs with the Sun rmic compiler. I then create a JNDI InitialContext using wlclient.jar and a t3 url, and attempt to bind my remote object. It fails with the following exception:
javax.naming.NamingException: Unhandled exception in rebind() [Root exception is org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code
: 0 completed: No]I am using WLS 8.1sp4 and Sun JDK 1.4.2_05 (as shipped with WLS).
If I use the RMI registry (Naming.bind(), etc.) it works fine.
Thanks
Dan.
Similar Messages
-
Detect & re-register in Rmi Server
Hi,
I am running rmi registry in separate console. My application is registering an URL in RMI server. Now I am stopping rmi registry & restarting it again.
Now rmi registry is a new process & all previous registration entries are gone. So my application has to re-register.
How my application can detect that rmi server is stopped & restarted so that I can re-register it again?
Any help?
Here is my code where I am registering
public void initializeExternalManagementInterface(String serviceURL)
mbeanServer = MBeanServerFactory.createMBeanServer();
String domain = m_mbeanServer.getDefaultDomain();
String mbeanObjectNameStr = domain + ":type=" + EXTERNAL_MBEAN_CLASS_NAME + ",index=1";
objectName = ObjectName.getInstance(mbeanObjectNameStr);
Attribute serviceURLAttribute = new Attribute("ServiceURL", serviceURL);
m_mbeanServer.setAttribute(m_mbeanObjectName, serviceURLAttribute);
public void startManagementInterface(String jmxServiceURL, String mbeanClassName)
env.put(RMIConnectorServer.JNDI_REBIND_ATTRIBUTE,"true");
JMXServiceURL p_jmxServiceURL = new JMXServiceURL(jmxServiceURL);
LoggerManager.getLogger().info("Starting JMX Server: " + p_jmxServiceURL);
m_mbeanServerConnector = JMXConnectorServerFactory.newJMXConnectorServer(p_jmxServiceURL, env, m_mbeanServer);
m_mbeanServerConnector.start();
LoggerManager.getLogger().info("THE MANAGEMENT INTERFACE STARTED FOR SERVICE URL :" + jmxServiceURL);
m_jmxConnector = JMXConnectorFactory.connect(p_jmxServiceURL, null);
m_mbeanConnection = m_jmxConnector.getMBeanServerConnection();
String domain = m_mbeanConnection.getDefaultDomain();
m_mbeanObjectName = new ObjectName(domain + ":type=" + mbeanClassName + ",index=1");
}Hi,
My application has a Watchdog process. It monitors few managed & unmanaged processes. If any process goes down due to some reason then it is responsibility of watchdog to restart it again.
Rmi registry is one of the unmanaged process for watchdog. So if Rmi stops or killed due to some reason then Watchdog restarts it successfully but the problem is my application has to re register again.
I want to know how my application can find out that Rmi registry is restarted so lets register again.
Note: Watchdog process has no way to communicate my application that rmi is restarted so my application has to care it self.
Suggest me if you have any solution.
Thanks & regards,
Jack -
Weblogic.jndi.internal.RootNamingNode by Startup
Hi,
I have definied a ConnectionPool, but in Startup exception raised:
Anyone knows why?
Interesting, I can see my connectionpool in "View JNDI tree" at the Consol. But
trying to use it from an EJB exception raised:
java.sql.SQLException: Connection Pool SEOInterBaseConnectionPool does not exist.
####<01.03.2001 10:35:39 GMT+01:00> <Info> <JDBC Connection Pool> <pc0194> <rpcserver>
<main> <system> <> <000000> <Connection for pool "SEOInterBaseConnectionPool"
created.>
####<01.03.2001 10:35:39 GMT+01:00> <Info> <Adapter> <pc0194> <rpcserver> <main>
<system> <> <000000> <Exception thrown by rmi server(class weblogic.jndi.internal.RootNamingNode)
[-7684374466692944493S:10.2.3.119:[7001,7001,7002,7002,7001,7002,-1]/9]: weblogic.jndi.internal.RootNamingNode@951a0>
javax.naming.NameNotFoundException: Unable to resolve weblogic.jdbc.connectionPool
Resolved: 'weblogic' Unresolved:'jdbc' ; remaining name 'connectionPool'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:803)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:129)
at weblogic.jndi.internal.BasicNamingNode.list(BasicNamingNode.java:496)Hi,
I have definied a ConnectionPool, but in Startup exception raised:
Anyone knows why?
Interesting, I can see my connectionpool in "View JNDI tree" at the Consol. But
trying to use it from an EJB exception raised:
java.sql.SQLException: Connection Pool SEOInterBaseConnectionPool does not exist.
####<01.03.2001 10:35:39 GMT+01:00> <Info> <JDBC Connection Pool> <pc0194> <rpcserver>
<main> <system> <> <000000> <Connection for pool "SEOInterBaseConnectionPool"
created.>
####<01.03.2001 10:35:39 GMT+01:00> <Info> <Adapter> <pc0194> <rpcserver> <main>
<system> <> <000000> <Exception thrown by rmi server(class weblogic.jndi.internal.RootNamingNode)
[-7684374466692944493S:10.2.3.119:[7001,7001,7002,7002,7001,7002,-1]/9]: weblogic.jndi.internal.RootNamingNode@951a0>
javax.naming.NameNotFoundException: Unable to resolve weblogic.jdbc.connectionPool
Resolved: 'weblogic' Unresolved:'jdbc' ; remaining name 'connectionPool'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:803)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:129)
at weblogic.jndi.internal.BasicNamingNode.list(BasicNamingNode.java:496) -
Regular RMI server object with WebLogic JNDI
Is that possible to register a regular RMI object with WebLogic JNDI
tree? I was building a simple program (using javac and rmic only) based
on the java.rmi.* (without changing the import statements to
weblogic.rmi.*) and using the weblogic.jndi to register the server
object. Below is some piece of code,
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://172.20.20.20:7001");
ctx = new InitialContext(ht);
ctx.bind("HelloServer", obj);
The code failed for the following reason,
javax.naming.NamingException. Root exception is
java.rmi.MarshalException: failed to marshal public abstract void
weblogic.jndi.internal.NamingNode.bind(java.lang.String,java.lang.Object,java.util.Hashtable)
throws javax.naming.NamingException,java.rmi.RemoteException; nested
exception is:
java.rmi.server.ExportException: A description for
examples.rmi.hello.HelloImpl was found but it could not be read due to:
[Failed to find examples.rmi.hello.HelloImpl_WLStub or
examples.rmi.hello.Hello_WLStub for class examples.rmi.hello.HelloImpl]
java.rmi.StubNotFoundException: Failed to find
examples.rmi.hello.HelloImpl_WLStub or examples.rmi.hello.Hello_WLStub
for class examples.rmi.hello.HelloImpl
at
weblogic.rmi.internal.BasicDescriptor.<init>(BasicDescriptor.java:101)
at
weblogic.rmi.internal.BasicRuntimeDescriptor.<init>(BasicRuntimeDescriptor.java:50)
at
weblogic.rmi.internal.DescriptorManager.resolveClass(DescriptorManager.java:55)
at
weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:39)
at
weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:30)
at
weblogic.rmi.internal.OIDManager.getRequestDispatcher(OIDManager.java:281)
at
weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:270)
at
weblogic.rmi.internal.OIDManager.replaceObject(OIDManager.java:98)
at
weblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:55)
at
weblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:239)
Any idea?
- SteveC"Pyung Yoon" <[email protected]> writes:
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);This implies JRMP which the server does not support. You need to use t3 or iiop.
andy -
ClassCastException while looking up RMI objects bound to weblogic.JNDI under WLS 6.1
We deploy a servlet (in a single .war archive) establishing a RMI connection to
an external Java object bound into weblogic JNDI (WLS 6.1).
We get a ClassCastException on invoking JNDI lookup:
Servlet failed with Exception>
java.lang.ClassCastException: $Proxy67
at com.thyssenkrupp.tks.tnt.admin.rmi.ClientServlet.init(ClientServlet.java:81)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:698)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:641)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:586)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:366)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:240)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Curiously we don't observe these problems when we include all the classes of the
remote application in the classpath of the WebLogic Server. Actually we want to
avoid including external classes in weblogic.classpath for (hot) deployment reasons.
It also seems that problems don't occur when accessing the remote object from
an independent client application.
We expect this to be a classloader conflict within WLS 6.1
Does anybody know a solution to our problems?
Thanks for suggestions
Andreas KoernerThere was a similar bug that was supposedly fixed in WL 6.1 SP 2. I had
filed a bug on this myself, and was given a patch for SP1, you should be
able to ask for the patch for CR060416.
Peter Mularien
Deploy Solutions, Inc.
Andreas Koerner wrote:
>
We deploy a servlet (in a single .war archive) establishing a RMI connection to
an external Java object bound into weblogic JNDI (WLS 6.1).
We get a ClassCastException on invoking JNDI lookup:
Servlet failed with Exception>
java.lang.ClassCastException: $Proxy67
at com.thyssenkrupp.tks.tnt.admin.rmi.ClientServlet.init(ClientServlet.java:81)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:698)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:641)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:586)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:366)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:240)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Curiously we don't observe these problems when we include all the classes of the
remote application in the classpath of the WebLogic Server. Actually we want to
avoid including external classes in weblogic.classpath for (hot) deployment reasons.
It also seems that problems don't occur when accessing the remote object from
an independent client application.
We expect this to be a classloader conflict within WLS 6.1
Does anybody know a solution to our problems?
Thanks for suggestions
Andreas Koerner -
How to run standalone java file from weblogic server on Solaris
Hi,
We have a requirement to run a java file at a scheduled time in a day using cron scheduler on our linux server.
We need to fetch data from the database & perform some business logic in this standalone JAVA file.
Our application has an EAR which is deployed on Weblogic 10.3 server & in our application, we are utilizing the datasource created in that domain.
Now, we have created a standealone Java file & used exisitng datasource (without Hibernate) of the domain with the help of below forums,
Use DataSource of weblogic in a standalone Java file
able to achieve the same.
I've bundled this JAVA in application WAR & depoyed on the same domain where datasource is created.
Now, how can I execute this file from anywhere on the server using weblogic classpath.
Please help on the same in implementation.
Thanks,
UttamIf the Java application must be stand-alone you must not deploy it on WebLogic, then WebLogic will manage its lifecycle.
In this case you can use the CommonJ API and use the timermanager if it must run on a certain time. More information
of how to do this can be found here: http://middlewaremagic.com/weblogic/?p=5569
If you keep the Java application stand-only and want to use a cron job you can follow the example presented here: http://middlewaremagic.com/weblogic/?p=7065
Note that the example runs a WLST script, but you can follow the same steps to run your Java application. -
Java.rmi.server.ExportException: while stopping weblogic Managed server
Hello,
I am getting the below error while I try to stop the weblogic managed server from the stop script in the server. I am able to do it thru the console.
the weblogic version is 9.23.
-server -Xms1536m -Xmx1536m
Stopping Weblogic Server...
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9990; nested exception is:
java.net.BindException: Address already in use
I am a newbie , so anyone could help me figure out the things I need to check so that I can troubleshoot the issue?
thanks in advance.Are you using a custom script or <domain>/bin/stopManagedWebLogic.sh ?
The msg you've informed seems to be an error that happens when you try to start a managed server that is trying to use a port that is already in use. -
Difference between Enterprise Standalone and Enterprise on Weblogic Server
Hi,
If I test my process on Standalone Enterprise Server and then test the same process on Enterprise Server on Weblogic (WLS), will there be any difference in my testing.. Will I receive different results or the results would be the same?Hi,
In Studio,in project preferences in General you have a check box that says something like Development for J2EE,that you should check if you are going to deploy to WLS or WAS. But there is no reason why something develop for StandAlone is not going to work in J2EE.
HTH -
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. -
How to look up a TxDataSource bound in weblogic JNDI
HI,
How can i look up a TxDataSource bound in weblogic JNDI. When i access it using
javax.sql.XADataSourse ds = (XADataSourse)context.lookUp(jndiName)
..it gives me classcast exception.
and if i lookup it using javax.sql.DataSource like below
javax.sql.DataSourse ds = (DataSourse)context.lookUp(jndiName)
then while executing my sql on the connection object it throws some other excepiton
like below
java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[weblogic.rjvm.PeerGoneException: ; nested exception is:
java.io.EOFException]
at weblogic.jdbc.rmi.SerialStatement.executeQuery(SerialStatement.java:92)
at TestTransactionMgr.main(TestTransactionMgr.java:46)
How can i solve this problem.. Actually my application needs to handle distributed transactions so i need to implement XADataSource.
can somebody help me iin this.
Thanks & Regards
Akhil NagplaHi Akhil did u get the solution for distributed database /
I am also working on same but i dint get the solution yet. Please if u have any solution for the same do mail me to [email protected] and [email protected]
here goes my problem !
we have 2 oracle databases.
I am using Stateless EJB and container managed transaction !
And inside a ejb method i am getting 2 different connection from 2 different datasources ok !
Since am using container managed transaction it starts transaction automatically when the method begins,
and the transaction ends when the method exit out ok !
Now i insert into 2 databases and when the method exits it gives an error listed below !
i am using NON emulated datasource with class name "com.evermindsql.DriverManagerDataSource"
and looking up this datasource in the EJB with name specified in location attribute of datasource !
"com.evermind.server.rmi.OrionRemoteExcepttion: Transaction was rolled back: javax.transaction.SystemException: could not commit: error code 29540- for additional error code check the oracle log file"
For distributed database we configured DBLINK also !
If u can give more info regarding DBlink it will be better ! Even after we set DBlink we are getting error !
Please tell us how to configure the database !
Oracle 9iAS
Oracle 9i DB
regards
Sreenath.V -
Failed to start managed server in weblogic server 9.2.1
Before I'm using WebLogic 9.2.0 and the managed server can startup without any issue. Now, my environment is upgraded to WebLogic 9.2.1 and I'm experiencing a couple of problems. The major problem is that I cannot start my managed server anymore even if the node manager and admin servers are running. Error logged are as follows:
<May 22, 2007 2:52:31 PM GMT+08:00> <Critical> <WebLogicServer> <BEA-000386> <Se
rver subsystem failed. Reason: javax.management.RuntimeErrorException: Error thr
own by the invoke method of the Dynamic MBean
javax.management.RuntimeErrorException: Error thrown by the invoke method of the
Dynamic MBean
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
at javax.management.remote.rmi.RMIConnectionImpl_920_WLStub.invoke(Unkno
wn Source)
at weblogic.management.remote.common.RMIConnectionWrapper$15.run(ClientP
roviderBase.java:606)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:363)
Truncated. see log file for complete stacktrace
java.lang.AssertionError: java.lang.ClassNotFoundException: weblogic.jndi.intern
al.ServerNamingNode_920_WLStub
at weblogic.jndi.WLInitialContextFactoryDelegate.newRootNamingNodeStub(W
LInitialContextFactoryDelegate.java:587)
at weblogic.jndi.WLInitialContextFactoryDelegate.newRemoteContext(WLInit
ialContextFactoryDelegate.java:559)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:474)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:372)
at weblogic.jndi.Environment.getContext(Environment.java:307)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: weblogic.jndi.internal.ServerNamingNode_920_WL
Stub
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:168)
at weblogic.jndi.WLInitialContextFactoryDelegate.newRootNamingNodeStub(W
LInitialContextFactoryDelegate.java:583)
at weblogic.jndi.WLInitialContextFactoryDelegate.newRemoteContext(WLInit
ialContextFactoryDelegate.java:559)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialCon
textFactoryDelegate.java:474)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:372)
at weblogic.jndi.Environment.getContext(Environment.java:307)
at weblogic.jndi.Environment.getContext(Environment.java:277)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
67)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at weblogic.management.remote.common.ClientProviderBase.makeConnection(C
lientProviderBase.java:125) at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(
ClientProviderBase.java:79)
at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnec
torFactory.java:326)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFacto
ry.java:247)
at weblogic.management.mbeanservers.domainruntime.internal.MBeanServerCo
nnectionManager.connectToManagedServer(MBeanServerConnectionManager.java:276)
at weblogic.management.mbeanservers.domainruntime.internal.MBeanServerCo
nnectionManager.notifyNewMBeanServer(MBeanServerConnectionManager.java:383)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at weblogic.management.jmx.modelmbean.WLSModelMBean.invoke(WLSModelMBean
.java:411)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
l.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
BeanServerInterceptor.java:815)
at weblogic.management.mbeanservers.domainruntime.internal.FederatedMBea
nServerInterceptor.invoke(FederatedMBeanServerInterceptor.java:248)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.inv
oke(WLSMBeanServerInterceptorBase.java:149)
at weblogic.management.mbeanservers.internal.SecurityMBeanMgmtOpsInterce
ptor.invoke(SecurityMBeanMgmtOpsInterceptor.java:63)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.inv
oke(WLSMBeanServerInterceptorBase.java:149)
at weblogic.management.mbeanservers.internal.SecurityInterceptor.invoke(
SecurityInterceptor.java:426)
at weblogic.management.mbeanservers.internal.AuthenticatedSubjectInterce
ptor$10.run(AuthenticatedSubjectInterceptor.java:377)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:363)
at weblogic.management.mbeanservers.internal.AuthenticatedSubjectInterce
ptor.invoke(AuthenticatedSubjectInterceptor.java:375)
at weblogic.management.jmx.mbeanserver.WLSMBeanServer.invoke(WLSMBeanSer
ver.java:310)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti
onImpl.java:1408)
at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio
nImpl.java:81)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
(RMIConnectionImpl.java:1245)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R
MIConnectionImpl.java:1348)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp
l.java:782)
at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown S
ource)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:548)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:438)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:434)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:5
7)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicSer
verRef.java:965)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)I experienced similar (identical?) problem after upgrading WLS 9.2 with MP2.
In my case simple setting the following fields from the tab 'Server Start': Java Home and Classpath resolved problem.
Greetings
GT -
RMI Clustering in Weblogic 7.0
Hi !
I am trying to use RMI Clustering in Weblogic 7.0. I followed the samples in the
documentation and it doesnt work for me. I could successfully bing my RMi Server
object to the JNDI tree and could view it via the weblogic JNDI tree. Even the
lookup is fine, but when I invoke a method on the remote object via the client,
I get the following error. Clearly there is something wrong with the Dynamic stub
downloaded from the JNDI tree.
Any Clues please...
Thanks
Sanjay
class examples.rmi.hello.HelloImpl_WLStub
java.rmi.ConnectException: Couldn't connect to weblogic.rjvm.RJVMImpl@3a0ab1 -
id: '6003776402499002017C:15.10.45.93R:12
46860412257523095S:15.10.45.93:[7001,7001,7002,7002,7001,7002,-1]:examples:examplesServer'
connect time: 'Fri Sep 06 08:
42:01 IST 2002'
at weblogic.rjvm.ConnectionManager.getOutputStream(ConnectionManager.java:1559)
at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:363)
at weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:88)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:116)
at examples.rmi.hello.HelloImpl_WLStub.sayHello(Unknown Source)
at examples.rmi.hello.HelloClient.main(HelloClient.java:42)Hi !
I am trying to use RMI Clustering in Weblogic 7.0. I followed the samples in the
documentation and it doesnt work for me. I could successfully bing my RMi Server
object to the JNDI tree and could view it via the weblogic JNDI tree. Even the
lookup is fine, but when I invoke a method on the remote object via the client,
I get the following error. Clearly there is something wrong with the Dynamic stub
downloaded from the JNDI tree.
Any Clues please...
Thanks
Sanjay
class examples.rmi.hello.HelloImpl_WLStub
java.rmi.ConnectException: Couldn't connect to weblogic.rjvm.RJVMImpl@3a0ab1 -
id: '6003776402499002017C:15.10.45.93R:12
46860412257523095S:15.10.45.93:[7001,7001,7002,7002,7001,7002,-1]:examples:examplesServer'
connect time: 'Fri Sep 06 08:
42:01 IST 2002'
at weblogic.rjvm.ConnectionManager.getOutputStream(ConnectionManager.java:1559)
at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:363)
at weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:88)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:116)
at examples.rmi.hello.HelloImpl_WLStub.sayHello(Unknown Source)
at examples.rmi.hello.HelloClient.main(HelloClient.java:42) -
Weblogic JNDI lookup in Applet
Hi
We are facing problem in JNDI lookup inside the applet
here is the scenario
We have two weblogic servers(port 7001)
one server is main server where the Applet1 , weblogic.jar and app.htm
are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
and another is proxy server where HTTPProxyServlet is running and one
web.xml file ( wall these files are provided by weblogic and the port
of proxy server is 448)
Both the servers are running on different machines
and when we run the client browser and put the folloing url
http://proxyServer IP Address:448/app.htm
we get the following exception
Java(TM) Plug-in: Version 1.3.0-C
Using JRE version 1.3.0 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\kkumar
Proxy Configuration: no proxy
JAR cache enabled.
In Init.1..:
In Init.after ..doClassLoaderWorkaround
In Init.after setText:
In Init.before initjms:
In initjms begin
In initjms hostName...:10.1.10.211
In initjms before initialcontext...:
In initjms after initialcontext...:
javax.naming.ConfigurationException. Root exception is
java.rmi.MarshalException: failed to marshal public abstract
java.lang.Object
weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
throws javax.naming.NamingException,java.rmi.RemoteException; nested
exception is:
java.io.NotSerializableException: javax.naming.InitialContext
java.io.NotSerializableException: javax.naming.InitialContext
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.Hashtable.writeObject(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at
weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
at
weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
at
weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
at
weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(Unknown Source)
at Applet1.initJMS(Applet1.java:128)
at Applet1.init(Applet1.java:46)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Initialization failed
In Init.end of initjms:
the files are here
app.htm
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="650" height="300" align="baseline"
codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
>
<PARAM NAME="code" VALUE="Applet1">
<PARAM NAME="codebase" VALUE=".">
<PARAM NAME="AppletName" VALUE="Applet1">
<PARAM NAME="archive" VALUE="weblogic.jar">
<PARAM NAME="MAYSCRIPT" VALUE="true">
<PARAM NAME="type"
VALUE="application/x-java-applet;version=1.2.2">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
<PARAM NAME="scriptable" VALUE="true">
<!--
<COMMENT>
<EMBED type="application/x-java-applet;version=1.2.2" width="650"
height="300" align="baseline"
code="ANZPopupApplet.class" codebase="../"
model="models/HyaluronicAcid.xyz"
pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
MAYSCRIPT="true">
<NOEMBED>
</COMMENT>
-->
No JDK 1.2 support for APPLET!!
</NOEMBED>
</EMBED>
</OBJECT>
</html>
Applet1.java
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.util.*;
import javax.naming.*;
import javax.jms.*;
import java.lang.reflect.*;
public class Applet1 extends Applet implements MessageListener {
private boolean started = false;
// JMS Stuff
private InitialContext jmsContext = null;
private QueueConnectionFactory jmsConnFactory = null;
private QueueConnection jmsConnection = null;
private Queue jmsQueue = null;
private QueueSession jmsSession = null;
private QueueSender jmsSender = null;
private QueueReceiver jmsReceiver = null;
// init - called to inform this applet that it has been
// loaded into the system
public void init() {
//{{INIT_CONTROLS
System.out.println("In Init.1..:");
//doClassLoaderWorkaround();
System.out.println("In Init.after ..doClassLoaderWorkaround");
setLayout(null);
setSize(426,266);
jmslabel.setText("JMS Applet");
System.out.println("In Init.after setText:");
add(jmslabel);
jmslabel.setBounds(144,12,148,24);
textArea1.setEnabled(false);
add(textArea1);
textArea1.setBounds(24,36,375,100);
jmsleaveButton.setLabel("Leave");
add(jmsleaveButton);
jmsleaveButton.setBackground(java.awt.Color.lightGray);
jmsleaveButton.setBounds(312,240,78,20);
add(jmsMessageField);
jmsMessageField.setBounds(24,168,367,38);
System.out.println("In Init.before initjms:");
initJMS();
System.out.println("In Init.end of initjms:");
//{{DECLARE_CONTROLS
java.awt.Label jmslabel = new java.awt.Label();
java.awt.TextArea textArea1 = new java.awt.TextArea();
java.awt.Button jmsleaveButton = new java.awt.Button();
java.awt.TextField jmsMessageField = new java.awt.TextField();
// getAppletInfo - Returns information about this applet.
public String getAppletInfo() {
return "JMS Applet\r\n";
// destroy - called to inform this applet that it is being
// reclaimed and that it should destroy any resources that
// it has allocated.
public void destroy() {
try {
if(started) {
if (jmsConnection != null) {
jmsConnection.stop();
jmsConnection = null;
started = false;
stop();
catch(Exception e) {
// start - called to inform this applet that it should start its
execution
public void start() {
if(!started) {
started = true;
// stop - Called to inform this applet that it should stop its
execution
public void stop() {
textArea1.setEnabled(false);
jmsMessageField.setEnabled(false);
// action - handles entering message, Leave button clicked
public boolean action(Event evt, Object obj) {
System.out.println("In action begin:");
if(evt.id == Event.ACTION_EVENT) {
if(obj.equals(jmsMessageField.getText())) {
System.out.println("In action before sendData:");
sendData(jmsMessageField.getText());
System.out.println("In action after sendData:");
jmsMessageField.setText("");
return true;
if(obj.equals(jmsleaveButton.getLabel())) {
destroy();
return true;
// initJMS - initialize all of the JMS stuff
private void initJMS() {
try {
System.out.println("In initjms begin");
String hostName = this.getCodeBase().getHost();
System.out.println("In initjms hostName...:"+hostName);
Hashtable env = new Hashtable();
env.put(Context.APPLET,this);
env.put(Context.PROVIDER_URL,
"t3://" + hostName + ":448");
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.println("In initjms before initialcontext...:");
jmsContext = new InitialContext(env);
System.out.println("In initjms after initialcontext...:");
jmsConnFactory
=(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
System.out.println("In initjms after initialcontext..lookup.:");
jmsConnection = jmsConnFactory.createQueueConnection();
System.out.println("In initjms after initialcontext..lookup1.:");
jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
System.out.println("In initjms before lookup...:");
jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
jmsConnection.start();
jmsSender = jmsSession.createSender(jmsQueue);
jmsReceiver = jmsSession.createReceiver(jmsQueue);
jmsReceiver.setMessageListener(this);
System.out.println("In initjms before setMessageListener...end of the
const:");
catch(Exception e) {
e.printStackTrace();
System.out.println("Initialization failed");
// sendData - sends a message
void sendData(String data) {
try {
System.out.println("In sendData before createTextMessage:");
TextMessage message = jmsSession.createTextMessage();
message.setText(data);
jmsSender.send(message);
System.out.println("In sendData end data:"+data);
catch(Exception e) {
System.out.println("Failed to send message");
// onMessage - asynchronously receives a message
public void onMessage(Message message) {
String data;
try {
System.out.println("In onMessage:");
data = ((TextMessage)message).getText();
System.out.println("In onMessage data:"+data);
textArea1.append(data + "\n");
repaint();
System.out.println("In onMessage end:");
catch(Exception e) {
System.out.println("Failed to receive message");
private void doClassLoaderWorkaround(){
boolean didit = false;
// Get the ClassLoader of this applet:
ClassLoader cloader = this.getClass().getClassLoader();
if (cloader == null){
System.out.println("### getClassLoader() returned null");
else
// We might call this handy utility routine:
// boolean didit =
Thread.currentThread().setContextClassLoader(cloader);
Method setContextClassLoaderMeth = null;
try {
Method [] allMethods = Thread.class.getMethods();
for ( int i = 0; i < allMethods.length; i++ ) {
if (allMethods.getName().equals("setContextClassLoader")) {
setContextClassLoaderMeth = allMethods[i];
break;
catch(Exception e) {
System.out.println("---Exception " + e);
// but we don't because we need more visibility about what goes
wrong.
// Rather, reproduce that logic here, with extra error messages:
//Method setContextClassLoaderMeth = null;
try{
// Class params = ClassLoader.class ;
// setContextClassLoaderMeth =
//Thread.class.getMethod("setContextClassLoader", params);
catch (NoSuchMethodException ne) {
setContextClassLoaderMeth = null;
System.out.println("--- This java version does not have the
method 'setContextClassLoader'. Not a problem.");
return;
catch (Exception ae){
setContextClassLoaderMeth = null;
System.out.println("### Thread.class.getMethod() threw
unexpected exception: " + ae.getMessage());
if (setContextClassLoaderMeth != null){
Object[] args = { cloader };
try{
setContextClassLoaderMeth.invoke(Thread.currentThread(),
args);
didit = true;
catch (InvocationTargetException ite){
Throwable be = ite.getTargetException();
System.out.println("### Thread.setContextClassLoader() failed:
InvocationTargetException: " + be.getMessage());
catch (Exception ie){
System.out.println("### Thread.setContextClassLoader() threw
unexpected exception: " + ie.getMessage());
if (didit){
System.out.println("--- Succeeded in setting the
ContextClassLoader of this thread to be this applet's own
ClassLoader");
else{
System.out.println("### Could not set ContextClassLoader,
additional threads may not be able");
System.out.println("### to get a JNDI Context in java 122 or
greater.");
any clue or thought. please help
regards
mohanIt looks like the object that you have placed into the JNDO tree is not serializable or doesnt implement exernalizable!
java.io.NotSerializableException
0rrc
On 26 Jul 2001 16:10:35 -0700, [email protected] (Mohan Raj) wrote:
Hi
We are facing problem in JNDI lookup inside the applet
here is the scenario
We have two weblogic servers(port 7001)
one server is main server where the Applet1 , weblogic.jar and app.htm
are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
and another is proxy server where HTTPProxyServlet is running and one
web.xml file ( wall these files are provided by weblogic and the port
of proxy server is 448)
Both the servers are running on different machines
and when we run the client browser and put the folloing url
http://proxyServer IP Address:448/app.htm
we get the following exception
Java(TM) Plug-in: Version 1.3.0-C
Using JRE version 1.3.0 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\kkumar
Proxy Configuration: no proxy
JAR cache enabled.
In Init.1..:
In Init.after ..doClassLoaderWorkaround
In Init.after setText:
In Init.before initjms:
In initjms begin
In initjms hostName...:10.1.10.211
In initjms before initialcontext...:
In initjms after initialcontext...:
javax.naming.ConfigurationException. Root exception is
java.rmi.MarshalException: failed to marshal public abstract
java.lang.Object
weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
throws javax.naming.NamingException,java.rmi.RemoteException; nested
exception is:
java.io.NotSerializableException: javax.naming.InitialContext
java.io.NotSerializableException: javax.naming.InitialContext
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.Hashtable.writeObject(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
at java.io.ObjectOutputStream.outputObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at
weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
at
weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
at
weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
at
weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(Unknown Source)
at Applet1.initJMS(Applet1.java:128)
at Applet1.init(Applet1.java:46)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Initialization failed
In Init.end of initjms:
the files are here
app.htm
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="650" height="300" align="baseline"
codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
>
<PARAM NAME="code" VALUE="Applet1">
<PARAM NAME="codebase" VALUE=".">
<PARAM NAME="AppletName" VALUE="Applet1">
<PARAM NAME="archive" VALUE="weblogic.jar">
<PARAM NAME="MAYSCRIPT" VALUE="true">
<PARAM NAME="type"
VALUE="application/x-java-applet;version=1.2.2">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
<PARAM NAME="scriptable" VALUE="true">
<!--
<COMMENT>
<EMBED type="application/x-java-applet;version=1.2.2" width="650"
height="300" align="baseline"
code="ANZPopupApplet.class" codebase="../"
model="models/HyaluronicAcid.xyz"
pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
MAYSCRIPT="true">
<NOEMBED>
</COMMENT>
-->
No JDK 1.2 support for APPLET!!
</NOEMBED>
</EMBED>
</OBJECT>
</html>
Applet1.java
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.util.*;
import javax.naming.*;
import javax.jms.*;
import java.lang.reflect.*;
public class Applet1 extends Applet implements MessageListener {
private boolean started = false;
// JMS Stuff
private InitialContext jmsContext = null;
private QueueConnectionFactory jmsConnFactory = null;
private QueueConnection jmsConnection = null;
private Queue jmsQueue = null;
private QueueSession jmsSession = null;
private QueueSender jmsSender = null;
private QueueReceiver jmsReceiver = null;
// init - called to inform this applet that it has been
// loaded into the system
public void init() {
//{{INIT_CONTROLS
System.out.println("In Init.1..:");
//doClassLoaderWorkaround();
System.out.println("In Init.after ..doClassLoaderWorkaround");
setLayout(null);
setSize(426,266);
jmslabel.setText("JMS Applet");
System.out.println("In Init.after setText:");
add(jmslabel);
jmslabel.setBounds(144,12,148,24);
textArea1.setEnabled(false);
add(textArea1);
textArea1.setBounds(24,36,375,100);
jmsleaveButton.setLabel("Leave");
add(jmsleaveButton);
jmsleaveButton.setBackground(java.awt.Color.lightGray);
jmsleaveButton.setBounds(312,240,78,20);
add(jmsMessageField);
jmsMessageField.setBounds(24,168,367,38);
System.out.println("In Init.before initjms:");
initJMS();
System.out.println("In Init.end of initjms:");
//{{DECLARE_CONTROLS
java.awt.Label jmslabel = new java.awt.Label();
java.awt.TextArea textArea1 = new java.awt.TextArea();
java.awt.Button jmsleaveButton = new java.awt.Button();
java.awt.TextField jmsMessageField = new java.awt.TextField();
// getAppletInfo - Returns information about this applet.
public String getAppletInfo() {
return "JMS Applet\r\n";
// destroy - called to inform this applet that it is being
// reclaimed and that it should destroy any resources that
// it has allocated.
public void destroy() {
try {
if(started) {
if (jmsConnection != null) {
jmsConnection.stop();
jmsConnection = null;
started = false;
stop();
catch(Exception e) {
// start - called to inform this applet that it should start its
execution
public void start() {
if(!started) {
started = true;
// stop - Called to inform this applet that it should stop its
execution
public void stop() {
textArea1.setEnabled(false);
jmsMessageField.setEnabled(false);
// action - handles entering message, Leave button clicked
public boolean action(Event evt, Object obj) {
System.out.println("In action begin:");
if(evt.id == Event.ACTION_EVENT) {
if(obj.equals(jmsMessageField.getText())) {
System.out.println("In action before sendData:");
sendData(jmsMessageField.getText());
System.out.println("In action after sendData:");
jmsMessageField.setText("");
return true;
if(obj.equals(jmsleaveButton.getLabel())) {
destroy();
return true;
// initJMS - initialize all of the JMS stuff
private void initJMS() {
try {
System.out.println("In initjms begin");
String hostName = this.getCodeBase().getHost();
System.out.println("In initjms hostName...:"+hostName);
Hashtable env = new Hashtable();
env.put(Context.APPLET,this);
env.put(Context.PROVIDER_URL,
"t3://" + hostName + ":448");
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.println("In initjms before initialcontext...:");
jmsContext = new InitialContext(env);
System.out.println("In initjms after initialcontext...:");
jmsConnFactory
=(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
System.out.println("In initjms after initialcontext..lookup.:");
jmsConnection = jmsConnFactory.createQueueConnection();
System.out.println("In initjms after initialcontext..lookup1.:");
jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
System.out.println("In initjms before lookup...:");
jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
jmsConnection.start();
jmsSender = jmsSession.createSender(jmsQueue);
jmsReceiver = jmsSession.createReceiver(jmsQueue);
jmsReceiver.setMessageListener(this);
System.out.println("In initjms before setMessageListener...end of the
const:");
catch(Exception e) {
e.printStackTrace();
System.out.println("Initialization failed");
// sendData - sends a message
void sendData(String data) {
try {
System.out.println("In sendData before createTextMessage:");
TextMessage message = jmsSession.createTextMessage();
message.setText(data);
jmsSender.send(message);
System.out.println("In sendData end data:"+data);
catch(Exception e) {
System.out.println("Failed to send message");
// onMessage - asynchronously receives a message
public void onMessage(Message message) {
String data;
try {
System.out.println("In onMessage:");
data = ((TextMessage)message).getText();
System.out.println("In onMessage data:"+data);
textArea1.append(data + "\n");
repaint();
System.out.println("In onMessage end:");
catch(Exception e) {
System.out.println("Failed to receive message");
private void doClassLoaderWorkaround(){
boolean didit = false;
// Get the ClassLoader of this applet:
ClassLoader cloader = this.getClass().getClassLoader();
if (cloader == null){
System.out.println("### getClassLoader() returned null");
else
// We might call this handy utility routine:
// boolean didit =
Thread.currentThread().setContextClassLoader(cloader);
Method setContextClassLoaderMeth = null;
try {
Method [] allMethods = Thread.class.getMethods();
for ( int i = 0; i < allMethods.length; i++ ) {
if (allMethods.getName().equals("setContextClassLoader")) {
setContextClassLoaderMeth = allMethods[i];
break;
catch(Exception e) {
System.out.println("---Exception " + e);
// but we don't because we need more visibility about what goes
wrong.
// Rather, reproduce that logic here, with extra error messages:
//Method setContextClassLoaderMeth = null;
try{
// Class params = ClassLoader.class ;
// setContextClassLoaderMeth =
//Thread.class.getMethod("setContextClassLoader", params);
catch (NoSuchMethodException ne) {
setContextClassLoaderMeth = null;
System.out.println("--- This java version does not have the
method 'setContextClassLoader'. Not a problem.");
return;
catch (Exception ae){
setContextClassLoaderMeth = null;
System.out.println("### Thread.class.getMethod() threw
unexpected exception: " + ae.getMessage());
if (setContextClassLoaderMeth != null){
Object[] args = { cloader };
try{
setContextClassLoaderMeth.invoke(Thread.currentThread(),
args);
didit = true;
catch (InvocationTargetException ite){
Throwable be = ite.getTargetException();
System.out.println("### Thread.setContextClassLoader() failed:
InvocationTargetException: " + be.getMessage());
catch (Exception ie){
System.out.println("### Thread.setContextClassLoader() threw
unexpected exception: " + ie.getMessage());
if (didit){
System.out.println("--- Succeeded in setting the
ContextClassLoader of this thread to be this applet's own
ClassLoader");
else{
System.out.println("### Could not set ContextClassLoader,
additional threads may not be able");
System.out.println("### to get a JNDI Context in java 122 or
greater.");
any clue or thought. please help
regards
mohan -
RMI server object lookup in a session bean
Hi all,
I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
bean. Following is the code and exception. Please note that I am using java.rmi
package instead of weblogic.rmi and that both the session bean and RMI server
object (a startup class) is deployed on the same machine.
Thanks for your help in advance.
// a simple, replica-aware session bean method
// some code here
try {
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
catch (Exception e) {
// log the exception
The exception:
java.rmi.MarshalException: Error marshaling transport header; nested exception
i
s:
java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:224)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
a:88)
at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
a:28)
at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
di8yo_EOImpl.java:46)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
e)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:762)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:295)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)Hi Pyung,
How about trying this instead:
InitialContext ctx = new InitialContext();
MediatorInterface mediator = (MediatorInterface) ctx.lookup("TestMediator");
This assumes your startup class binds the Mediator to the JNDI name "TestMediator".
- Matt
Pyung Yoon wrote:
Hi all,
I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
bean. Following is the code and exception. Please note that I am using java.rmi
package instead of weblogic.rmi and that both the session bean and RMI server
object (a startup class) is deployed on the same machine.
Thanks for your help in advance.
// a simple, replica-aware session bean method
// some code here
try {
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
catch (Exception e) {
// log the exception
The exception:
java.rmi.MarshalException: Error marshaling transport header; nested exception
i
s:
java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:224)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
a:88)
at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
a:28)
at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
di8yo_EOImpl.java:46)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
e)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:762)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:295)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133) -
Calling foreign EJB server from Weblogic
Hi,
I'm trying to invoke an EJB hosted in an old PowerTier EJB Container from an 8.1 SP5 hosted EJB, and I'm running in to problems. (PowerTier is based on the JBroker ORB)
So far the only way I can get it to work is by replacing Weblogic's ORB implementation with the JBroker one:
-Djavax.rmi.CORBA.StubClass=com.sssw.jbroker.rmi.StubDelegate
-Djavax.rmi.CORBA.UtilClass=com.sssw.jbroker.rmi.UtilDelegate
-Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sssw.jbroker.rmi.PortableRemoteObjectDelegate
But I'd like to avoid doing this if possible.
So I'd like to get this to work using the WL RMI-IIOP implementation to integrate with the PowerTier/JBroker server.
After looking at : http://forums.bea.com/bea/message.jspa?messageID=202437541&tstart=0
I tried the following:
Properties config = new Properties();
config.setProperty(
Context.PROVIDER_URL, "<b>iiop</b>://xxx.xxx.xxxxx.xxx:389/cn=Instance1,ou=Development,cn=Xxxx%20Xxxxxxx%20Xxxxx,ou=Components,cn=Xxxxxx%20Xxxx,ou=Applications,o=xxxxxxxx,c=uk");
InitialContext context = new InitialContext(config);
URL changed to protect the innocent - but format maintained.
When the server executes this I get the following exception:
javax.naming.InvalidNameException: url does not contain a port
at weblogic.corba.j2ee.naming.NameParser.parseURL(NameParser.java:419)
at weblogic.corba.j2ee.naming.ORBHelper.parseURL(ORBHelper.java:533)
at weblogic.corba.j2ee.naming.ORBHelper.getORBReference(ORBHelper.java:440)
at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:97)
at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:42)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
Any idea what is causing this exception? If I replace the '%20' with a normal spaces it makes no difference.
Am I going about this the right way?
Thanks!Getting a bit closer now.
The Object retreived from LDAP was a javax.naming.Reference - which contains the IOR for the Home interface.
// Get IOR from LDAP
InitialContext context;
Hashtable config = new Hashtable();
config.put(Context.PROVIDER_URL,"ldap://<host>:389/");
config.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
context = new InitialContext(config);
Reference reference = (Reference)context.lookup("<path to home>");
// Get IOR from reference
String ior = "" + reference.get(0).getContent();
// Get WLS ORB
ORB orb = (ORB)new InitialContext().lookup("java:comp/ORB");
Object object = orb.string_to_object(ior);
FooHome home = (FooHome)PortableRemoteObject.narrow(object, FooHome.class);
Foo foo = home.create();
// Everything works fine up to here.
foo.invokeMethod(); // <-- This fails with the following exception :
java.rmi.RemoteException: ; nested exception is:
org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:197)
at weblogic.iiop.IIOPRemoteRef.invokeInternal(IIOPRemoteRef.java:205)
at weblogic.iiop.IIOPRemoteRef.invoke(IIOPRemoteRef.java:153)
at ztkt.pl.Foo_IIOP_WLStub.invokeMethod(Unknown Source)
at com.xyz.ezs.wl.ejb.PLProxyBean.invoke(PLProxyBean.java:56)
at com.xyz.ezs.wl.ejb.PLProxy_o3b3ao_EOImpl.invoke(PLProxy_o3b3ao_EOImpl.java:45)
at com.xyz.ezs.wl.ejb.PLProxy_o3b3ao_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:337)
at weblogic.iiop.InboundResponseImpl.getThrowable(InboundResponseImpl.java:62)
at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:179)
... 15 more
(Method, class and package names changed.)
Has anyone seen this before? Any idea what might be causing it?
Maybe you are looking for
-
How do I create a new HotMail account?
How do I create another account with Hotmail?
-
PI 7.4-receiver determination, communication component
Hello, I believe the question is simple, what determines, what communication components are available in receiver determination, I mean, when You are creating receiver determination, there is need to choose communication component (using search help)
-
I have encountered a problems with my webiste home page (newly designed): I wish to have centrally-displayed page, with blank margins on each side, that would display equially well in various browsers. My approach was to desing a four-frame Frameset,
-
Captivate 4 publishing for LMS
Hello, First, sorry for my bad english : I'm french. Please someone can help me : I do not can launch my captivate project on my LMS : the message written is : The archive is not standard to SCORM 2004 (3rd or 4th ed) I've already check the folder
-
Conflict between CAT2 and ESS Record Time
Does anyone know how to set up security to allow someone to record time through ESS while prohibiting that person from recording their own time through transaction CAT2 in ECC? Our Payroll Department uses CAT2 to record/correct time for the entire c