Weblogic JNDI lookup with JDK1.2
Hi,
I've written JMS client that sends message to weblogic 8.1,
and I use "weblogic.jndi.WLInitialContextFactory" to get access to resources.
Now the problem is that my client can run only on JDK 1.2 and
so when I send message I get exceptions about some security classes which
webligic's JNDI is implementing looks like:
java.lang.NoClassDefFoundError: javax/security/auth/callback/CallbackHandler
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
I was wondering if there is any way to a client running on JDK 1.2
to get access to weblogic's JNDI, other than using WLInitialContextFactory,
or I have to go to Weblogic 6?
Any help is appreciated!
Thanks,
Ann
Hi,
I've written JMS client that sends message to weblogic 8.1,
and I use "weblogic.jndi.WLInitialContextFactory" to get access to resources.
Now the problem is that my client can run only on JDK 1.2 and
so when I send message I get exceptions about some security classes which
webligic's JNDI is implementing looks like:
java.lang.NoClassDefFoundError: javax/security/auth/callback/CallbackHandler
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
I was wondering if there is any way to a client running on JDK 1.2
to get access to weblogic's JNDI, other than using WLInitialContextFactory,
or I have to go to Weblogic 6?
Any help is appreciated!
Thanks,
Ann
Similar Messages
-
Anyone knows how to do JNDI lookup with OracleAQ?
Hi all;
Can anybody point me some guide/idea on how to implement JNDI lookup with OracleAQ?
(Creating connectionFacotry , parameters for "java.naming.factory.initial", java.naming.provider.url etc..)
Thanks
-Ratha
Edited by: Ratha on Sep 27, 2011 3:50 AMimport javax.naming.*;
import javax.naming.directory.*;
import java.util.Properties;
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, PROVIDER_URL);
env.put(Context.SECURITY_PRINCIPAL, JNDI_USER);
env.put(Context.SECURITY_CREDENTIALS, JNDI_PWD);
InitialContext = new InitialDirContext(env);
where JNDI_USER is the userid If ACL is configured at the JNDI server
where JNDI_PWD is the password If ACL is configured at the JNDI server
Context.INITIAL_CONTEXT_FACTORY is the initial Context factory and depends on ur JNDI service provider.
PROVIDER_URL is the url of the JNDI server containing protocol/ip/port
Hope it helps
-aseem -
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 -
EJB 3 JNDI lookup with WL 12c (12.1.1) Exception
Hi all,
I'm trying to lookup an EJB inside my application with the following code :
Context ctx = new InitialContext();
ctx.lookup("java:module/MyEJB");
it throws this Exception :
javax.naming.NamingException [Root exception is java.rmi.RemoteException: weblogic.ejb.container.internal.StatelessLocalObject; nested exception is:
java.io.NotSerializableException: weblogic.ejb.container.internal.StatelessLocalObject]
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
Truncated. see log file for complete stacktrace
Caused By: javax.faces.el.EvaluationException: javax.naming.NamingException [Root exception is java.rmi.RemoteException: weblogic.ejb.container.internal.StatelessLocalObject; nested exception is:
java.io.NotSerializableException: weblogic.ejb.container.internal.StatelessLocalObject]
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
Truncated. see log file for complete stacktrace
Caused By: javax.naming.NamingException [Root exception is java.rmi.RemoteException: weblogic.ejb.container.internal.StatelessLocalObject; nested exception is:
java.io.NotSerializableException: weblogic.ejb.container.internal.StatelessLocalObject]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:86)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:466)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:256)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:406)
at weblogic.jndi.internal.ApplicationNamingNode.resolveObject(ApplicationNamingNode.java:170)
Truncated. see log file for complete stacktrace
Caused By: java.rmi.RemoteException: weblogic.ejb.container.internal.StatelessLocalObject; nested exception is:
java.io.NotSerializableException: weblogic.ejb.container.internal.StatelessLocalObject
at weblogic.jndi.internal.WLEventContextImpl.copyObject(WLEventContextImpl.java:384)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:251)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:406)
at weblogic.jndi.internal.ApplicationNamingNode.resolveObject(ApplicationNamingNode.java:170)
at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:856)
Truncated. see log file for complete stacktrace
Caused By: java.io.NotSerializableException: weblogic.ejb.container.internal.StatelessLocalObject
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
Truncated. see log file for complete stacktrace
i'm using WL 12c, JDK 1.6.29.
regards.I can't upload all the project, but i will upload the [required files|http://dl.dropbox.com/u/79750638/WLForum.7z] .
inform me if you need more info.
thanks -
Hi all,
we are using 2 weblogic 5.1 servers (not clustered) for
our load balancing solution. In our client applications,
we use a hostname against a DNS for the JNDI lookups for our
RMI objects deployed on the 2 weblogic servers.
Ideally, a round-robin load balancing is expected.
But in reality, all the lookups are sticking to one of our
servers until we restart our client applications. The
lookups may switch to another. In our applications,
we are making many subsequent RMI lookup using JNDI.
We would like to spread the remote method invocation
between our 2 servers. How can we integrate with the
DNS? We have proved that the DNS will return the
IP addresses of the 2 weblogic in round-robin manner.
thanks!
cheers,
Kenneth
[email protected]Ken,
What client are you using? We had the same problem when we switched from
Windows NT to Windows 2000 clients. Round-robin worked fine in NT and by
default got "stuck" when we tried it from Win 2000 client. There is a
setting in the network properties on Win 2000 to "unstick" that will fix the
problem, if this is the setup you have?
Bart Jenkins, Globeflow SA
[email protected]
"Kenneth Yue" <[email protected]> wrote in message
news:3bb09863$[email protected]..
>
>
Hi all,
we are using 2 weblogic 5.1 servers (not clustered) for
our load balancing solution. In our client applications,
we use a hostname against a DNS for the JNDI lookups for our
RMI objects deployed on the 2 weblogic servers.
Ideally, a round-robin load balancing is expected.
But in reality, all the lookups are sticking to one of our
servers until we restart our client applications. The
lookups may switch to another. In our applications,
we are making many subsequent RMI lookup using JNDI.
We would like to spread the remote method invocation
between our 2 servers. How can we integrate with the
DNS? We have proved that the DNS will return the
IP addresses of the 2 weblogic in round-robin manner.
thanks!
cheers,
Kenneth
[email protected] -
Calling BRM from UDF using JNDI lookup with @EJB annotation
Hi Experts
I am trying to implement a UDF to invoke my BRM Rules set via JNDI Lookup instead of a SOAP Channel lookup.
I have had a look at the following links/docs:
Calling BRM from UDF using Public API
http://www.gleanster.com/system/resources/W1siZiIsIjIwMTIvMDgvMDcvMjAvNDcvNTAvNDMvVGhpbmdzX1lvdV9TaG91bGRfS25vd19hYm91dF9TQVBfTmV0V2VhdmVyX0JSTS5wZGYiXV0/Things%20You%20Should%20Know%20about%20SAP%20NetWeaver%20BRM.pdf
For item 1 above, the example looks really good, but it doesnt explain how I get access to the following required imports from my UDF:
import com.sap.brms.qrules.ejb.*;
import com.sap.brms.qrules.engine.AbstractProject;
import com.sap.brms.qrules.engine.RuleEngine;
import com.sap.brms.qrules.engine.RulesetContext;
import javax.ejb.EJB;
The second document is really good as well, but I could not figure out how to get it to work from my UDF.
So, can anyone help me to understand specifically what is required to get this to work?
Is is possible to invoke the rule set from my UDF?
How do I give my UDF access to all the required jars/imports?
I have manage to create a new DC (Development Component) with a public part and this enables me to get my code to compile on my local PC but I am not able to activate it due to the server not having access to the same java packages as my local copy.
Any help would be greatly appreciated.You resolve the dependency by importing the required jars with using the dependency tab for the mapping program.
As stipulated before, I have managed to resolve the dependency issue but I have now getting the same error as in the forum: Calling BRM from UDF using Public API
The specific error is:
com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:238)
Has anyome manage to get invoke a BRM Ruleset using JNDI? -
I have a JMS topic defined in a standalone oc4j (11g) and I am doing a JNDI lookup on that from an application that runs in embedded oc4j of jdev. Look up fails but if I add the same topic in jms.xml of embedded oc4j, it starts to work fine. My point is topic name shouldn't be needed in jms.xml of embedded oc4j i.e. client side (topic is present in remote oc4j and rightly defined in jms.xml of that oc4j). I verified that by creating a command line java application and that one is able to do lookup on the same topic available in the standalone oc4j.
I guess this problem is not specific to the label JDEVADF_MAIN_GENERIC_061111.1900.4245, it was there before also.
Any pointers on what could be wrong when I run in JDev?
Thanks,
VishalPlease use the internal email distribution list jdev_us for 11 related questions.
-
Weblogic 9.1 with JDK1.6 giving error ( while doing weblogic.appc )
hi,
I am trying to build my ear using jdk1.6 with weblogic 9.1.
I am getting this error while doing weblogic.appc using my ant scripts. Could some one pls let me know the solution for this problem.
[java] Created working directory: c:\windows\TEMP\appcgen_gdoasis.jar
[java] <02-Aug-2007 14:54:22 o'clock BST> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile yo
ur application. Recompile with the -verbose option for more details. Please see the error message(s) below.>
[java] javax.xml.stream.FactoryConfigurationError: Provider javax.xml.stream.XMLInputFactory could not be
instantiated: java.lang.InstantiationException
[java] at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:158)
[java] at weblogic.ejb.container.dd.xml.DDUtils.<clinit>(DDUtils.java:85)
[java] at weblogic.ejb.container.ejbc.EJBCompiler.parseDescriptors(EJBCompiler.java:1345)
[java] at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:431)
[java] at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:292)
[java] at weblogic.application.compiler.EJBCompiler.compile(EJBCompiler.java:95)
[java] at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:113)
[java] at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)
[java] at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:55)
[java] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
[java] at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:24)
[java] at weblogic.application.compiler.Appc.runBody(Appc.java:151)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:158)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:115)
[java] at weblogic.application.compiler.Appc.main(Appc.java:162)
[java] at weblogic.appc.main(appc.java:14)
[java] Provider javax.xml.stream.XMLInputFactory could not be instantiated: java.lang.InstantiationExcept
ion
ThanksHi,
First thing, I am not sure this will work :-)
The main issue is that there is no StAX provider to parse I-not-know-what XML file.
You may try to execute appc with the parameter
-Djavax.xml.stream.XMLInputFactory=com.bea.xml.stream.MXParserFactory
Anyhow, you may still have some issues given that Java 6 is not a supported Java version for WL 9.1.
Regards,
lg -
The WL4.5 docs, state that if "java.naming.provider.url" is not
explicitly provided
(either during the JVM start or in the InitialContext), the WL will
default to
"t3://localhost:7001".
Q1) If server is listening on a different port, shouldn't we explicitly
specify the
"-Djava.naming.provider.url=t3://theServerIP:theServerPort" during the
WL JVM
start-up. If we don't, how would the naming lookup work, when there is
no naming
service on the "localhost:7001"
In the real life, usually there are several (usually identical) copies
of the WL server
instances running in (DEV/TEST/QUAL environments. Assume that all
servers are
on the same network and have the same EJBs deployed (using the same home
names).
Q2) Does each WL instance have its own naming service running? (assume
yes)
Q3) If no WL instances listen on 7001, what happens with Q1?
Q4) If client specifically sets the TEST server IP:port for the
"java.naming.provider.url", would TEST naming service first lookup its
own tree and
then, if object does not exist ask other naming services (assume yes ...
how is this
set-up, how do the WL naming services discover each other)
Q5) How many naming services would run if all WL instances are running
on the
same machine using different listen ports? (assume N)
Darko Bohinc
Consultant - Synergy International Limited
Level 7, Synergy House, 131 Queen Street, PO Box 7445 Wellesley Street,
Auckland, NZ
Phone: +64 9 3772400
Fax: +64 9 3772444
URL: http://www.synergy.co.nzNo,version 4.5 is built to the 1.1 API.
Version 1.5 is updated to JNDI 1.2.
Thanks,
Michael
Michael Girdley
BEA Systems Inc
<[email protected]> wrote in message news:[email protected]..
Hi All
I have been using WL 4.5.1 for a while with JNDI 1.1.2 which are
included in weblogicaux.jar.
Can I use JNDI 1.2.1 with WL 4.5.1 by overriding the default 1.1.2 ?
If so, how do I do it?
Thanks
Madhu -
Weblogic 10.0 Comatability with JDK1.6
I have installed weblogic 10.0 on unix machine. And when i istalled it JDK1.5 will automatically installed with it inside weblogic folder.
And when i create a new instance of weblogic with existing JDK1.5 the instace will start properly and application executes also.
But when i point the weblogic to JDK1.6 at the time of instace creting. it will not work properly. When i stop the server below error is display.
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException: invalid type code: 88]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:32)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
org.python.pycode._pyx18.f$0(/newpluto/weblogic10/bea/citiSchedPayliteDomain/vb2java/shutdown.py:1)
at org.python.pycode._pyx18.call_function(/newpluto/weblogic10/bea/citiSchedPayliteDomain/vb2java/shutdown.py)
at org.python.core.PyTableCode.call(PyTableCode.java:208)
at org.python.core.PyCode.call(PyCode.java:14)
at org.python.core.Py.runCode(Py.java:1135)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:167)
at weblogic.management.scripting.WLST.main(WLST.java:106)
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 weblogic.WLST.main(WLST.java:29)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException: invalid type code: 88
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:222)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
at weblogic.common.internal.RMIBootServiceImpl_1002_WLStub.authenticate(Unknown Source)
at weblogic.security.acl.internal.Security$1.run(Security.java:185)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.security.acl.internal.Security.authenticate(Security.java:181)
My question is that Weblogic 10.0 is only comapatable with jdk1.5 only or either any way so we can point it to JDK1.6WLS 10.0 is not supported for JDK 6.
This is strict violation that you need to use only JDK 5 -
Weblogic & JNDI Data Source with proxy user.
We're trying to use Oracle proxy user authentication on a data source configured in WebLogic 10.3.6, however, we want to approach it in a programatic way. So we want to obtain the DataSource, and set the proxy related properties inside the application.
We came up with the following snippet:
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://10.1.1.10:7003");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "weblogic");
Context context = new InitialContext(env);
javax.sql.DataSource ds = (javax.sql.DataSource) context.lookup("ds_puser");
OracleConnection oconn = (OracleConnection) ds.getConnection();
The problem comes up when we try to cast the connection to OracleConnection, the thing is that the returned type is actually a 1036_WLStub.
How can we avoid that type or cast to it to something useful? I found this reference on Oracle forums and he's being able to cast it directly:
Re: My problem in using weblogic Datasource and proxy user
Can someone help us out?
Thanks a lot in advance!
Edited by: 990800 on 27-feb-2013 13:26A DataSource is an Interface. What the code gets from the jndi tree is some concrete object that
the code doesn't need to know the name of, or anything specific about it, as long as it implements
the DataSource Interface, which it successfully casts to, to allow calling the methods defined in the
DataSource Interface. If you call for a plumber, you don't need to know his name as long as you
can get a plumber, and can call the "Fix this leak" method, defined in the Plumber Interface. -
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 -
Using jndi.properties with weblogic 6.1
Apologies if this is a basic question - I am new to Weblogic.
I have successfully got a test EJB working with Weblogic 6.1 using a properties object to set up my JNDI InitialContext.
In the weblogic examples I've downloaded it says you can also use a jndi.properties file to do this. I have set up a jndi.properties file, which is in the classpath for my class calling the EJB. But when I do my jndi .lookup("ejbname") I get the error:
javax.naming.CommunicationException: Can't find SerialContextProvider
The weblogic documentation at:
http://e-docs.bea.com/wls/docs61///rmi_iiop/API_rmi_iiop.html
refers to using jndi.properties and says to look at:
http://edocs.bea.com/wls/docs61/jndi/jndi.html
But at this page there is no mention of the jndi.properties method.
I'd be grateful for any suggestions - in particular whether it is possible to use this method of configuring the JNDI setup.
I'm running wlserver6.1 on a Windows 2000 PC, using JDK 1.3.1
My jndi.properties file looks as follows:
java.naming.property.names=java.naming.factory.initial,java.naming.provider.url
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001It is not WebLogic-specific. See
http://java.sun.com/j2se/1.3/docs/api/javax/naming/InitialContext.html
Alison Tunley <[email protected]> wrote:
Apologies if this is a basic question - I am new to Weblogic.
I have successfully got a test EJB working with Weblogic 6.1 using a properties object to set up my JNDI InitialContext.
In the weblogic examples I've downloaded it says you can also use a jndi.properties file to do this. I have set up a jndi.properties file, which is in the classpath for my class calling the EJB. But when I do my jndi .lookup("ejbname") I get the error:
javax.naming.CommunicationException: Can't find SerialContextProvider
The weblogic documentation at:
http://e-docs.bea.com/wls/docs61///rmi_iiop/API_rmi_iiop.html
refers to using jndi.properties and says to look at:
http://edocs.bea.com/wls/docs61/jndi/jndi.html
But at this page there is no mention of the jndi.properties method.
I'd be grateful for any suggestions - in particular whether it is possible to use this method of configuring the JNDI setup.
I'm running wlserver6.1 on a Windows 2000 PC, using JDK 1.3.1
My jndi.properties file looks as follows:
java.naming.property.names=java.naming.factory.initial,java.naming.provider.url
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001--
Dimitri -
Jndi lookup problem between weblogic 6.1 and 8.1
Hello,
I have a portal application running in weblogic 6.1(sp2). It needs to lookup a
Stateless Session Bean which is deployed in Weblogic 8.1.
I have the 8.1 version ejb client jar in my WEB-INF/lib
Here is my code:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://server1.abc.com:port);
ctx = new InitialContext(env);
Object objref = ctx.lookup(EJBJNDI_NAME);
mEJBHome = (EJBServiceHome)PortableRemoteObject.narrow(objref, EJBServiceHome.class);
mEJBService=mEJBHome.create();
An exception occurred during the ctx.lookup call:
javax.naming.CommunicationException. Root exception is java.rmi.UnmarshalException:
Problem finding error class; nested exception is:
java.lang.ClassNotFoundException: java.lang.StackTraceElement
java.lang.ClassNotFoundException: java.lang.StackTraceElement
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:180)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
areClassLoader.java:68)
What troubles me is that the exact same code worked for a regular web application
(web1.war), but not the portal application (portal1.war). Both web1.war and portal1.war
are inside app.ear
Please help!! Any guess/suggestions are welcome.
Thank you!
EllenHi,
All I can say is Weblogic6.1 doesnot use JDK1.4 compared to Weblogic8.1, hence the class java.lang.StackTraceElement is not found when the object is executed in 6.1.
This is clue which you may like to take forward for debugging your application.
Thanks. -
JNDI lookup issue in weblogic 10 server
Hi all,
I have a serious problem in getting the datasource lookup. My application uses EJB3 and JPA and it is deployed in weblogic10. I configured datasource in the domain (ex:mydomain) using weblogic 10 admin console. Now when i try to call from a client program, it is giving me javax.naming.NameNotFoundException. I use eclipse IDE to deploy the application. From the IDE, i can start the oracle 10.3 server and it automatically deploys the application into the server in mydomain. The admin console shows that the application deployed fine. And i can see the webcontent WAR file and EJB jar deployed. Coming back to the issue.... I verified user_projects\domains\mydomain\config\jdbc\datasource-jdbc.xml and user_projects\domains\mydomain\config\config.xml file enteries. My entries are present in those files.
When i start the server i am getting below error...
<< Stacktrace >>
javax.naming.NameNotFoundException: While trying to look up jdbc in /app.; remaining name 'jdbc'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
at weblogic.deployment.PersistenceUnitInfoImpl.lookUpAppScopedDataSource(PersistenceUnitInfoImpl.java:529)
at weblogic.deployment.PersistenceUnitInfoImpl.reconfig(PersistenceUnitInfoImpl.java:549)
at weblogic.ejb.container.deployer.EJBModule.reconfigPersistenceUnits(EJBModule.java:529)
at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:515)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
<< Client program snippet >>
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://10.237.76.132:7001");
InitialContext ctx = null;
ctx = new InitialContext(ht);
Object obj = (Object)ctx.lookup(EmployeeBean.RemoteJNDIName);
EmployeeRemote empRemote = (EmployeeRemote)PortableRemoteObject.narrow(obj,com.acs.test.emp.EmployeeRemote.class);
List empList = empRemote.getEmployeeDetails(1);
System.out.println("SUCCESS"+empList.size());
<< Persistence.xml >>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="cmsepool">
<jta-data-source>java:/mydatasource</jta-data-source>
<class>com.acs.test.emp.EmployeeVO</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>Make sure that this Datasource you created is Targetted to Admin Server and full Cluster (incase of cluster domain). From Admin Console, select your datasource and check for the Targets tab. Since its JNDI lookup error, most probably it may not be deployed properly.
HTH
Ravi Jegga
Maybe you are looking for
-
Scanning multiple pages to one file
I have a C310a All in One printer/scanner. My computer uses OS X 10.9 and all the drivers are updated. Is there a way to scan multiple pages to one file. I have tried the three methods mentioned in the HP bulletin for Mavericks but I can only scan
-
HDMI/DVI adapter problem?
I've had the 1st gen Apple TV since it came out and have loved it. It has worked fine on my 5 year old Sony HDTV. Since this tv does not have HDMI inputs (has an DVI input), i used an HDMI/DVI adapter and this worked fine up till now. Yesterday i got
-
Hi, if i want to install BPEL in HA-mode, do i have to install the MIDTier (OC4J-Containers) in active-active and then install the bpel PM? Or can i install the OC4J-Containers on both machines without the Cluster Topology option and use this option
-
Re-establish file associations
I opened a .pdf file (template) in Photoshop CS2, and now all .pdf's open in Photoshop CS2. It is not working for me. Also, all .pdf files show up in Windows Explorer as Photoshop files. How can I make it so that .pdf files open in Acrobat again?
-
Exchange 2010 outlook and mailbox move to another server
does a user need to create a new profile when mailbox has been moved to a different server? TM