Problem in JNDI lookup.
Hi,
I have a JSP running on tomcat. And it accesses an EJB running on weblogic thru a local bean. When the following JNDI lookup code is executed, I get errors. Errors follow the code. Please Help.
Thanks!
public InitialContext getInitialContext() throws NamingException
// Utils.Trace("****** in getInitialContext ******");
// web logic server and jsp engine NOT weblogic
if (url != null && url.length() > 0)
//Hashtable env = new Hashtable();
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
// assumes that JSP and EJB container are on the same box,
// otherwise EJB hostname should be specified
//env.put(Context.PROVIDER_URL, "t3://localhost:7001");
env.put(Context.PROVIDER_URL, url);
System.out.println("Using t3 services");
return new InitialContext(env);
// weblogic server and weblogic jsp, or inprise server (JBuilder's default JSP)
else
System.out.println("Not Using t3 services");
return new InitialContext();
The ERRORS are
=====================================================================
org.apache.jasper.JasperException: weblogic/common/T3Services
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:479)
root cause
javax.servlet.ServletException: weblogic/common/T3Services
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:276)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:479)
Your JSP trying to load the weblogic context factory to perform the lookup, but can't find it. Your servlet engine must have access to the weblogic.jndi.WLInitialContextFactory class (in weblogic.jar).
Similar Messages
-
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.
-
Problem in Jndi lookup for ITaskService
HI,
I am trying to initiate oracle bpm Human task programatically by using Java remotely.
for this I am using following JNDI lookup for ITaskService.
Hashtable ht = new
Hashtable<IWorkflowServiceClientConstants.CONNECTION_PROPERTY,java.lang.String>();
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:7001");
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "username");
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "password");
Context ctx = new InitialContext(ht);
ITaskService taskService = (ITaskQueryService)ctx.lookup("ejb/bpel/services/workflow/TaskServiceBean");
taskService.initiateTask(task);
It the right approach or not.
Please help.To access human workflow api remotely try using the following code :
Map properties = new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:8001");
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "welcome1");
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "weblogic");
IWorkflowServiceClient wfSvcClient =
WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT, properties, null);
//Get the task query service
ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();
//Login as weblogic
IWorkflowContext ctx = querySvc.authenticate("weblogic","welcome1".toCharArray(),null);
after getting the workflow context, you can call any method like query task list. perform actions etc. just see the api doc.
Regards,
Anshul -
Problems with JNDI lookup for java:comp/env/ejb
Hi all,
I'm using OC4J 9.0.3 and I have problems when looking up for the local
EJB context.
I have a SLSB which refers to another SLSB via a JNDI mapping like
shown below. Both services are deployed within one EAR file.
(snippets of ejb-jar.xml and orion-ejb-jar.xml)
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>ServiceABean</ejb-name>
<home>com.coi.ServiceAHome</home>
<remote>com.coi.ServiceA</remote>
<ejb-class>com.coi.ServiceABean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>ejb/some/sub/packages/ServiceB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.coi.ServiceBHome</home>
<remote>com.coi.ServiceB</remote>
</ejb-ref>
</session>
</enterprise-beans>
</ejb-jar>
<orion-ejb-jar>
<enterprise-beans>
<session-deployment location="global/some/sub/packages/ServiceA" name="ServiceABean">
<ejb-ref-mapping name="ejb/some/sub/packages/ServiceB" location="global/some/sub/packages/ServiceB" />
</session-deployment>
</enterprise-beans>
</orion-ejb-jar>
The ApplicationInitialContextFactory will be used (prepared by the container),
so the lookup for ServiceB within a method of ServiceA should work as follows:
public class ServiceABean implements SessionBean
public void someMethod()
InitialContext con = new InitialContext(); // will be of class ApplicationContext
Context localEjbContext = (Context)con.lookup( "java:comp/env/ejb" );
ServiceBHome serviceBHome = (ServiceBHome) PortableRemoteObject.narrow(
localEjbContext.lookup( "some/sub/packages/ServiceB" ),
ServiceBHome.class );
The problem is now, that the lookup for "java:comp/env/ejb" doesn't work
and throws a NameNotFoundException.
To figure out what's actually happening during lookup I debugged a little bit and
tried a few things:
1. A lookup for "java:comp" works fine. It returns an instance of class FlatMapContext
which consists of a hash map which itself contains an entry for "env".
2. So a lookup for "env" on that FlatMapContext also works and returns an instance of SubContext.
3. A lookup for "ejb" using this SubContext causes a NameNotFoundException
with message "java:comp/env/ejb not found".
4. A lookup like con.lookup( "java:comp/env" ) throws also a NameNotFoundException
with message "java:comp/env not found (not inside a J2EE module, for instance a Web-App,
EJB, or Application-Client)".
Does anyone know something about this?
Regards
--thomasHi Debu,
Great! 9.0.4 will be released in june/july this year, right? Sorry for my ironical reaction, but does that mean, that I don't have any chance to get my whole stuff running in 9.0.3? I cannot believe that. Isn't there a wordaround I could apply? A setting or whatever to substitute the daft FlatCtx by something else that is implemented according to the spec?
Regards
--thomas -
Problem in JNDI Lookup of Deployable Proxy inside logon.par
Hi,
I have customized the Logon par file and have a functionality to call a webservice when the Password Reset happens.
<b>from the ResetPassword.jsp , SAPMLogonLogic.java is getting called ,and there is a method called performResetPassword().</b>
I am calling a Deployable Proxy in that method by using the below code,
<b>Gateway objGateway=(SMSGateway)ctx.lookup("java:comp/env/MailProxy");
MailGatewayViDocument objSMSGatewayViDocument=(MailGatewayViDocument )objGateway.getLogicalPort("wsPort_Document",MailGatewayViDocument.class);</b>
objMailGatewayViDocument.sendMail(...);
I am getting the Exception,
<b>com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/MailProxy.</b>
I have deployed the Deployable Proxy in the J2EE Engine and add this API Jar as the External Library (Project >Properties>Java Build Path ---> Add External jars...Added the .jar file generated in the Proxy Project).
Please let me know the possible solutions where i can call a deployable proxy inside the logon par file.
Thanks and Regards,
SekarHi Sekar!
Try this:
MailGateway objMailGateway=(MailGateway)ctx.lookup
("wsclients/proxies/sap.com/MailProxy/com.ms.sap.sms.MailProxy/wsPort_Document");
I have understood you're deploying a par file... if you are doing this way, don't forget to put a reference to the webservice in portalApp.xml:
<property name="PrivateSharingReference" value="SAPJ2EE::sap.com/com.ms.sap.sms.MailProxy"/>
Hope this can work.
Are you sure this destination is the one you are looking for?
sap.com/CHEPSMSProxy/com.ms.sap.sms.SMSProxy/wsPort_Document
It seems to be anther app. If this is the correct app then the JNDI should be:
MailGateway objMailGateway=(MailGateway)ctx.lookup
("wsclients/proxies/sap.com/CHEPSMSProxy/com.ms.sap.sms.SMSProxy/wsPort_Document");
If this fails and if you have have source code of the proxy app, check out the application.xml file, and look for Display name. Also look for the application-j2ee-engine.xml file, and look for the 'Vendor name', and post them please.
Eneko
Message was edited by:
Eneko Rodriguez -
Problem in JNDI Lookup of Deployable Proxy from the logon par file
Hi,
I have customized the Logon par file and have a functionality to call a webservice when the Password Reset happens.
<b>from the ResetPassword.jsp , SAPMLogonLogic.java is getting called ,and there is a method called performResetPassword().</b>
I am calling a Deployable Proxy in that method by using the below code,
<b>Gateway objGateway=(SMSGateway)ctx.lookup("java:comp/env/MailProxy");
MailGatewayViDocument objSMSGatewayViDocument=(MailGatewayViDocument )objGateway.getLogicalPort("wsPort_Document",MailGatewayViDocument.class);
objMailGatewayViDocument.sendMail(...);</b>
I am getting the Exception,
<b>com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/MailProxy.</b>
I have deployed the Deployable Proxy in the J2EE Engine and add this API Jar as the External Library (Project >Properties>Java Build Path ---> Add External jars...Added the .jar file generated in the Proxy Project).
<b>Please let me know the possible solutions where i can call a deployable proxy inside the logon par file</b>.
Thanks and Regards,
SekarHi,
I have fixed this error by changing the lookup as follows.
InitialContext ctx=new InitialContext();
Gateway objGateway=(Gateway)ctx.lookup("wsclients/proxies/sap.com/GatewayProxy/com.ms.sap..GatewayProxy");
Just open Visual Administrator and look for the path under wsclients for proper naming.
Thanks and Regards,
Sekar
Edited by: Sekar M on Jan 16, 2008 6:10 PM -
hi,
i created my own Queue and QueueConnectionFactory using the j2eeadmin tool. both objects show up just fine when i run j2eeadmin -listXXX
however when i try to lookup either one of these with the runtime api, i get javax.naming.NameAlreadyBoundException
my client code may not be correct, but here's what i have:
InitialContext jndiContext = new InitialContext();
jndiContext.lookup( name );
where name is the name that object is bound to.
if anyone has any idea what i'm doing wrong, please let me know.
thanks,
mark.u can set jndi name during u deploy the EJB ,for example ,after u start the deploytool ,u have built a group of ejb classes such as sessionbean, remote interface ,home interface ,then deploy them as a ejb,after this u can get the menu about alias ,so set the name when u write ur script to call the ejb ,just give the same name as u wrote just now
-
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 -
Stand-alone JNDI lookup of an EJB in an Enterprise Application (EAR) build
Hi All,
I am having some difficulty doing JNDI look up an EJB 3.0 Bean that is part of an Enterprise Application (EAR) build. Below are all the related codes:
package ejb;
import javax.ejb.Local;
@Local
public interface Hello1Local {
public String getHello1();
package ejb;
import javax.ejb.Stateless;
@Stateless
public class Hello1Bean implements Hello1Local {
public String getHello1() {
return "I am Hello1 Bean!";
package ejb;
import javax.ejb.Remote;
@Remote
public interface Hello2Remote {
public String getHello2();
package ejb;
import javax.ejb.Stateless;
import javax.ejb.EJB;
@Stateless
@EJB(name="ejb/Hello1",
beanInterface=Hello1Local.class,
beanName="Hello1Bean")
public class Hello2Bean implements Hello2Remote {
@EJB private Hello1Local hello1bean;
public String getHello2() {
return hello1bean.getHello1();
There is no problem looking up Hello2 Bean using an Application Client such as the following:
public class LocalHelloApplicationClient {
@EJB(name="Hello2")
private static Hello2Remote hello2Bean;
public static void main(String[] args) {
System.out.println("hello2Bean.getHello2(): " + hello2Bean.getHello2());
}There is also no problem doing JNDI lookup (from a Stand-Alone Client the same bean if both Hello1 and Hello2 were created by themselves. ie not part of an Enterprise Application (EAR) build. However, I am wondering whether it is possible to do JNDI lookup of the same bean (Hello2) that is part of an Enterprise Application (EAR) built. Below are the type of JNDI lookup entries that I have tried without success:
public class StandalonePojoCallHelloWorld {
public static void main(String [] args)
try
InitialContext jndiContext = new InitialContext();
Hello2Remote hello2Bean = (Hello2Remote) jndiContext.lookup("ejb.Hello2Remote");
or
Hello2Remote hello2Bean = (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.Hello2.remote");
or
Hello2Remote hello2Bean = (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.ejb.Hello2Remote");
or
Hello2Remote hello2Bean = (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.Hello2Remote");
or
Hello2Remote hello2Bean = (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.LocalHelloEnterpriseApplication-ejb.Hello2Remote");
System.out.println("hello2Bean.getHello2(): " + hello2Bean.getHello2());
catch (javax.naming.NamingException ne)
ne.printStackTrace();
They all came up with the same error message:
javax.naming.NameNotFoundException: LocalHelloEnterpriseApplication.LocalHelloEnterpriseApplication-ejb.Hello2Remote not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:129)
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)Any suggestion would be appreciated.
Thanks,
JackHello
I've somme problems to get access to ejb interface from remote stand-alone client.
Here is my EJB code :
package stateless;
import javax.ejb.Stateless;
@Stateless(name = "TestSB", mappedName = "ejb/stateless/TestSB")
public class TestEJBBean implements TestEJBRemote {
public String getMessage() {
return "Hello EJB World";
}And the remote interface :
package stateless;
import javax.ejb.Remote;
@Remote
public interface TestEJBRemote {
String getMessage();
} In client side, i just edit main.java like this :
package testclient;
import java.io.FileInputStream;
import java.util.Properties;
import javax.naming.InitialContext;
import stateless.TestEJBRemote;
public class Main {
public static void main(String[] args) throws Exception {
Properties props = new Properties();
props.load(new FileInputStream("jndi.properties"));
InitialContext ctx = new InitialContext(props);
TestEJBRemote testEJB = (TestEJBRemote) ctx.lookup("ejb/stateless/TestSB");
System.out.println(testEJB.getMessage());
}here is my jndi.properties file (my glassfish server IP is 192.168.0.10) :
java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url.pkgs = com.sun.enterprise.naming
java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
org.omg.CORBA.ORBInitialHost = 192.168.0.10
org.omg.CORBA.ORBInitialPort = 3918when i run client on the same machine than the glassfish app server, it works fine.
But i run it on the different machine than the glassfish app server (on the same LAN without firewall), it fails with this error message :
eclan@eclan-laptop:~/NetBeansProjects/TestClient$ java -jar dist/TestClient.jar
24 août 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 3918"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at testclient.Main.main(Main.java:14)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 14 more
24 août 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4038"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at testclient.Main.main(Main.java:14)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 14 more
24 août 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4138"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at testclient.Main.main(Main.java:14)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 14 more
24 août 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 3918"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at testclient.Main.main(Main.java:14)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 14 more
24 août 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4038"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at testclient.Main.main(Main.java:14)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 14 more
24 août 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4138"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at testclient.Main.main(Main.java:14)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 14 more
eclan@eclan-laptop:~/NetBeansProjects/TestClient$ THANKS YOU FOR YOUR HELP
Justin -
JNDI lookup problem in WAS 5.1
Hello all,
I have generated an EAR using XDoclet and MyEclipse. When I deploy this EAR on WAS 5.1, I get the following exception:
javax.naming.NameNotFoundException: Context: WarHog/nodes/WarHog/servers/server1, name: ejb/TEDIObjectManagerLocal: First component in name TEDIObjectManagerLocal not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.rmi.iiop.CDRInputStream.readBoxedIDLEntity(CDRInputStream.java:2112)
at com.ibm.rmi.iiop.CDRInputStream.readIDLValue(CDRInputStream.java:2177)
at com.ibm.rmi.iiop.CDRInputStream.fast_read_value(CDRInputStream.java:1734)
at com.ibm.rmi.io.IIOPInputStream.readValueType(IIOPInputStream.java:2085)
at com.ibm.rmi.io.IIOPInputStream.readObjectField(IIOPInputStream.java:2057)
at com.ibm.rmi.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1765)
at com.ibm.rmi.io.IIOPInputStream.inputObjectUsingClassDesc(IIOPInputStream.java:1348)
at com.ibm.rmi.io.IIOPInputStream.continueSimpleReadObject(IIOPInputStream.java:420)
at com.ibm.rmi.io.IIOPInputStream.simpleReadObjectLoop(IIOPInputStream.java:404)
at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:347)
at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:200)
at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1367)
at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
at javax.rmi.CORBA.Util.copyObject(Util.java:333)
at com.wdc.tedi.interfaces._TransformationEngine_Stub.transform(_TransformationEngine_Stub.java:268)
at com.wdc.tedi.web.TestHarnessBean.translate(TestHarnessBean.java:42)
at com.wdc.tedi.web.TestHarnessBean.setDataBlob(TestHarnessBean.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)First of all, I don't really understand what the error means. Is it that the JNDI lookup failed when one of my beans tried to do a lookup on 'ejb/TEDIObjectManagerLocal'? I believe there's some configuration that went wrong (EJB reference binding or something) when I deployed the EAR. The reason I don't think it's a faulty code is because the EAR runs like a charm when I deploy it on Oracle 10g and Weblogic.
I am really stuck on this problem and shall appreciate any help that I can get. I can send the code, xdoclet tags and configuration if that might assist someone.
Thanks
-ybh6336Hello all,
I'm still stuck on this issue. Following are the entries related to my
application when I do a 'dumpNameSpace':
28 (top)/nodes/WarHog/servers/server1/ejb/tedi/TEDIObjectManager
28
com.wdc.tedi.interfaces._TEDIObjectManagerHome_Stub
29 (top)/nodes/WarHog/servers/server1/ejb/tedi/DSValueLookup
29
com.wdc.tedi.interfaces._DSValueLookupHome_Stub
30 (top)/nodes/WarHog/servers/server1/ejb/tedi/TransformationEngine
30
com.wdc.tedi.interfaces._TransformationEngineHome_StubObservations:
- I only see the namespace entries for my Session beans. There's one
entity bean also which does not show up.
- I don't see anything for the Local Home interfaces, it shows only the
Home interfaces.
As additional information, I'm looking up 'TEDIObjectManagerLocal'
using 'ejb/TEDIObjectManagerLocal'. I also tried using 'local:ejb/ejb/TEDIObjectManagerLocal' (as Karthyk suggested) and
'java:comp/env/ejb/TEDIObjectManagerLocal', but that does not work
either.
Also, the XDoclet tags that I use to generate the interfaces for
TEDIObjectManager bean are as follows:
/* @ejb.bean name="TEDIObjectManager"
* display-name="TEDIObjectManager"
* description="TEDIObjectManager"
* jndi-name="ejb/tedi/TEDIObjectManager"
* local-jndi-name="ejb/TEDIObjectManagerLocal"
* type="Stateless"
* view-type="both"
* @ejb.util generate="physical"
* @ejb.ejb-ref ejb-name="TEDIObject"
* view-type = "local"
* ref-name = "ejb/TEDIObjectLocal"
* @oc4j.bean jndi-name="ejb/tedi/TEDIObjectManager"
*/My ejb-jar.xml looks like following for that bean:
<session >
<description><![CDATA[TEDIObjectManager]]></description>
<display-name>TEDIObjectManager</display-name>
<ejb-name>TEDIObjectManager</ejb-name>
<home>com.wdc.tedi.interfaces.TEDIObjectManagerHome</home>
<remote>com.wdc.tedi.interfaces.TEDIObjectManager</remote>
<local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
<ejb-class>com.wdc.tedi.ejb.TEDIObjectManagerSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref >
<ejb-ref-name>ejb/TEDIObjectLocal</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.wdc.tedi.interfaces.TEDIObjectLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TEDIObjectLocal</local>
<ejb-link>TEDIObject</ejb-link>
</ejb-local-ref>
</session>AND following for the bean that is referencing it:
<session >
<description><![CDATA[TransformationEngine]]></description>
<display-name>TransformationEngine</display-name>
<ejb-name>TransformationEngine</ejb-name>
<home>com.wdc.tedi.interfaces.TransformationEngineHome</home>
<remote>com.wdc.tedi.interfaces.TransformationEngine</remote>
<local-home>com.wdc.tedi.interfaces.TransformationEngineLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TransformationEngineLocal</local>
<ejb-class>com.wdc.tedi.ejb.TransformationEngineSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref >
<ejb-ref-name>ejb/TEDIObjectManagerLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
<ejb-link>TEDIObjectManager</ejb-link>
</ejb-local-ref>
</session>The entries in ibm-ejb-jar-bnd.xmi (generated using MyEclipse) are as
follows for the two beans:
<ejbBindings
xmi:id="Session_bnd_1"
jndiName="ejb/tedi/TransformationEngine">
<ejbRefBindings xmi:id="EJBRefBnd_1"
jndiName="ejb/TEDIObjectManagerLocal">
<bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_1"/>
</ejbRefBindings>
<enterpriseBean
xmi:type="ejb:Session"
href="META-INF/ejb-jar.xml#Session_TransformationEngine" />
</ejbBindings>
<ejbBindings
xmi:id="Session_bnd_3"
jndiName="ejb/tedi/TEDIObjectManager">
<ejbRefBindings xmi:id="EJBRefBnd_2"
jndiName="ejb/TEDIObjectLocal">
<bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_2"/>
</ejbRefBindings>
<enterpriseBean
xmi:type="ejb:Session"
href="META-INF/ejb-jar.xml#Session_TEDIObjectManager" />
</ejbBindings>I know I'm swamping the post with code, but please let me know if anyone finds something unusual.
NOTE: When deploying on WAS, in the 'Map EJB references to beans' step, I'm giving the following values for 'TransformationEngine' bean:
Reference binding: ejb/TEDIObjectManagerLocal
JNDI Name: ejb/tedi/TEDIObjectManager
There's one other similar binding that works for 'TEDIObjectManager'
bean:
Reference binding: ejb/TEDIObjectLocal
JNDI Name: ejb/TEDIObject
Everything in ejb-jar and ibm-ejb-jar-bnd.xmi look similar for this working bean, there is one difference though, I do the lookup on this one using 'java:comp/env/ejb/TEDIObjectLocal', but I've already tried that for the other one.
Really appreciate your time.
Thanks
-yogesh -
Hi All
Two separate webapps, have different names for Datasources, on the same host and port. Both application work fine independently.
When we deploy both applications on the same app server(websphere), whichever we executes first gets its datasource from JNDI lookup and works fine, but when we try second application it have problem in finding its data source from JNDI lookup. If we start this second application first, it will work fine, but now another will have the same problem in its JNDI lookup.
Any idea why.
Thanks
....RanvirHi All
Two separate webapps, have different names for
Datasources, on the same host and port. Both
application work fine independently.
When we deploy both applications on the same app
server(websphere), whichever we executes first gets
its datasource from JNDI lookup and works fine, but
when we try second application it have problem in
finding its data source from JNDI lookup. If we start
this second application first, it will work fine, but
now another will have the same problem in its JNDI
lookup.
Any idea why.
Thanks
....RanvirHi Ranvir,
Do you mean you try to reach the same datasource with different names or do you try to reach different datasources over the same port?
If you try the first issue you shouldn't get any trouble. At least it works fine with JBOSS for example.
But if you try to do the latter in my oppinion you don't have a JNDI problem but a problem with socket binding: the two different databases must be contacted over different ports.
What do WebSphere's logs tell?
Best regards
Andy -
JNDI Lookup Problem (General Problem)
hi all,
i am newbie on bea products, but i have some experience on java technologies, how i fount on bea documentations and forums many people has the same problem like this, can anybody help us (me)?
problem: how is it possible to write simple client for j2ee server application? i found some posts about jndi lookup, and fount about j2ee client, but is there any doc or example how to write this j2ee client ???
i worked with many application servers and i have no problem with them (JBoss, Sun App Server, IBM Websophere, Oracle AS etc.)
some people told about jndi tree on Web Logic Server Administration console , i found this tree i my session beans looks like :
Binding Name:
TimestenExampleTimestenExample_jarInsertSubscriberBean_InsertSubscriber
Class:
test.InsertSubscriberBean_o7jk9u_InsertSubscriberImpl_1000_WLStub
why is so strange name for class or binding name ????
my session bean name is : InsertSubscriber
and it's implementation : InsertSubscriberBean
how i can lookup from client ?????
can anybody show me code snippet ???
my client looks like :
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import org.hibernate.property.Dom4jAccessor.ElementGetter;
public class Client {
public static void main(String[] args) {
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://192.9.200.222:7001");
try {
ctx = new InitialContext(ht);
InsertSubscriber usagefasade = (InsertSubscriber) ctx
.lookup("java:comp/InsertSubscriber");
} catch (NamingException e) {
e.printStackTrace();
} finally {
try {
ctx.close();
} catch (Exception e) {
e.printStackTrace();
}can anybody show me what is there incorrect ????
oo yes and i have weblogic.jar file into my client classpath.Hi,
Your EJB client looks fine.
You should use the JNDI name of your ejb while doing the lookup. i.e :
InsertSubscriber usagefasade = (InsertSubscriber) ctx.lookup("..use JNDI name of EJB...");
You can use the JNDI name of the EJB that you see in the JNDI tree of weblogic. [don't use Binding Name or Class name]. you can also specify the JNDI name by "jndi-name" attribute in weblogic-ejb-jar.xml.
for more info:
http://e-docs.bea.com/wls/docs81/ejb/ejb11.html
Thanks,
Qumar Hussain -
Hi,
I have a client Java application accessing a session EJB in a remote JBoss J2EE server. I'm using JWS 1.2 to deploy my application but when I do a JNDI lookup to get access the the remote's object home interface I get this error:
"Need to specify class name in environment or system property, or as an applet parameter, or in an application resorce file: java.naming.factory.initial"
All the jar files are signed and the JNPL file contains <all-permissions/>. This is the code that triggers the exception
jndiContext = new InitialContext();
homeRMIReference = jndiContext.lookup(C_SERVICE_NAME);
Any help would be appreciated.
Thanks in advance,
RafaelHi,
I've finally found the origin of the problem.
1. JNDI uses a minimum set of properties during initialization phase:
java.naming.factory.initial
java.naming.factory.url.pkgs
java.naming.provider.url
Therefore these properties must be set in the <resource> topic of the JNLP file. The value of these properties is defined in the jndi.properties file that you can find in jbossjmx.ant.jar (within the jboss/client directory)
2. You have to add the JBoss files to your bundle. For doing so I've unjared all the .jar files within the jboss/client directory; afterwards I have jared them in a single file "jboss.jar" and I've signed the file. I've added jboss.jar to the <resource> tag within the JNLP file (Note that I've added all the jboss files just to do quick check but usually you will have to add only those files you need (it doesn't make sense to deploy all JBoss files in each client application)
I hope this helps,
Rafael -
Problem deploying cmp bean invoking another cmp bean using jndi lookup
I have a cmp BeanA that invokes another cmp BeanB, so I am using a jndi lookup in BeanA to download the localhome object to BeanB using the following:
Context ctx = new InitialContext();
home = (LocalAddressHome) ctx.lookup("java:comp/env/ejb/BeanBHomeRef");
then I specify the ejb/BeanBHomeRef, entity bean, local, BeanB's local home and component interface in EJB ref. when I am packaging BeanA
I also package BeanB in a separate jar file.
When I attempt to deploy the application it throws strange exception that says the folowing:
java.lang.IllegalArgumentException: BeanBEJB says it links to an ejb called BeanBEJB of local home class LocalBeanBHome but no bean with this local home c
lassname and type can be found in this ejb-jar.
yet when I un-jar the package, these class files exitsts.
When I go ahead and delete the reference to BeanB from the BeanA package file, I am able to deploy the application but then correctly fails on jndi lookup.
I have been able to open the cmpcustomer.ear sample application that comes with RI and execute it without any problem. But when I to package the same beans for example CustomerBean and it won't even allow me to create the customer.jar file. I get a screen full of errors.......
I am using Sun RI 1.3.01, is there a known bug that I am not aware of? Is there a fix around it?
Is there any another way to get the home ref. to BeanB so I can invoke create() method?
Any advice or suggestions?
thanksl
-kaisaabWhat app server are you using? may be I can help you
--Ashish Saraf -
11g preview version 3: JNDI Lookup problem when calling PL/SQL webservice
Hi,
I am experiencing a problem when calling a PL/SQL Webservice from a BPEL flow.
When I am trying to test my BPEL flow from the SOA Console I get a "Error doing JNDI lookup on target jdbc/MyDBDS"
The composite application including the BPEL flow is deployed in one application. "CompositeApp" and the web service in another Application called
"WebServiceApp".
Both applications are deployed on the same built in OC4J Application Server
If I test the webservice in isolation from the SOA console it works. It also seems to be working if the webservice and the and the BPEL flow is in the same project.
If anyone has any ideas on this one I would be very greatful.
Thanks in advancetry creating the MyDBDS connection as an application resource in both applications.
Maybe you are looking for
-
RUEI 12.1.0.3.0 - Dropdown List Not Showing Correctly in Session Replay
Hello all, While using Session replay, I found out that dropdown boxes/menu does not work in Session replay mode. I am using RUEI to monitor oracle.com Anyone has a similar experience? Care to assist, please? Regards, Nathan Edited by: 959447 on Dec
-
Philips RC144 5302 / 00B Codes for Vizio E241-A1 LCD TV
Has anyone found a code that will allow the Philips remote control A / V button to to open the Input menu on the Vizio E241-A1 LCD TV and also allow the up down arrow buttons to switch between the input sources on the TV? I am using the following cod
-
Business area financail statement
hi experts i want financial statement as per business area.Could any one tell me what are the necessary steps for that Please help me out its very urgent requirement thanks Nilesh
-
Need sql query to convert rows to columns
Im using oracle 11g. I have data in a table as below: Column names are type,month,percentage TYPE MONTH PERCENTAGE A1 JAN-2013 100 A2 JAN-2013 100 A3 JAN-2013 95 A4 JAN-2013 98 A5 JAN-201
-
Direct input guitar latency issue
So I have a brand new iMac 20" 2.66 GHZ /4Gb ram and an M-audio firewire 410. I have my guitar plugged direct and there is a delay in the monitor. If I match my guitar volume it sounds like slap delay. It is really annoying and I would like to know w