Javax.naming.NameNotFoundException while trying to lookup for the Datasourc
I get following exception when the datasource is looked up after redeployment.
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracleDS' Resolved: '' Unresolved:'jdbc' ; remaining name 'jdbc.oracleDS'
But after redeployment if I restart the application server, this problem gets resolved automatically and I am able to get the connection.
So is there any specific configuration, so that I can access the Database connections without restarting the servers after re-deployment?
Connection Pool and DataSource are targetted to a Cluster.
Please let me know if there is any solution for this.
Thanks in advance !
there are multiple option of creating data source.which one i should use.
should i use generic one. what is URL information for oracle xe client.what is driver name?
Similar Messages
-
hi,
i have installed hr schema and created a page with a table.when i run the page,
i am getting javax.naming.NameNotFoundException: While trying to lookup 'jdbc.SampleHR1DS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/SampleHR1DS'
Do i need to create data source for this.How to resolve this.
i am using 11.1.2.4.0 jdevthere are multiple option of creating data source.which one i should use.
should i use generic one. what is URL information for oracle xe client.what is driver name? -
Hi All,
Am using jdeveloper 11.1.1.6. Am trying to send a mail through ADF
I have verfied the link which given below and trying to do the same.
http://adfblogs.blogspot.in/2012/01/sending-e-mail-from-adf-application.html
While am pressing the send button am getting the exception as
<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
javax.faces.el.EvaluationException: javax.naming.NameNotFoundException: While trying to lookup 'mail.NewMailSession' didn't find subcontext 'mail'. Resolved ''; remaining name 'mail/NewMailSession'
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
Could any one pls help me to resolve it?I had restarted the weblogic server even though am getting the same error
javax.naming.NameNotFoundException: While trying to lookup 'mail.NewMailSession' didn't find subcontext 'mail'. Resolved ''; remaining name 'mail/NewMailSession'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at Mail.SendAction(Mail.java:49)
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 com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) -
Javax.naming.NameNotFoundException while Message driven bean
I am adding a message driven bean in to my EJB application and trying
to deploy it in the WebLogic 6.0 server.
Now please let me know is there any other step i am missing.
1) This is what i have added in my ejb-jar.xml
<enterprise-beans>
<message-driven>
<description>no description</description>
<display-name>ActivatorBean</display-name>
<ejb-name>ActivatorBean</ejb-name>
<ejb-class>com.savvion.bizlogic.server.ActivatorBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<jms-destination-type>javax.jms.Queue</jms-destination-type>
</message-driven-destination>
<security-identity>
<description/>
<run-as-specified-identity>
<description/>
<role-name/>
</run-as-specified-identity>
</security-identity>
</message-driven>
2) I am adding this is in the weblogic-ejb.xml
<weblogic-enterprise-bean>
<ejb-name>ActivatorBean</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>MyMessageQueueFactory</destination-jndi-name>
</message-driven-descriptor>
<transaction-descriptor>
<trans-timeout-seconds>1200</trans-timeout-seconds>
</transaction-descriptor>
<jndi-name>MessageQueue</jndi-name>
</weblogic-enterprise-bean>
anything else which needs to added in WebLogic-ejb.xml or in config.xml
because as per the following error message there should be some
entry in config.xml.
onemore thing i am little bit confused in
<destination-jndi-name>MyMessageQueueFactory</destination-jndi-name>
and
<jndi-name>MessageQueue</jndi-name>
and when i deploed this in WebLogic got this error message on the
prompt
<Error> <J2EE> <Error deploying EJB Component : LEngine
weblogic.ejb20.EJBDeploymentException: Error deploying Message-Driven
Bean,
couldn't find Queue 'MyMessageQueueFactory'. Make sure it was declared
in your config.xml.
; nested exception is:
javax.naming.NameNotFoundException: Unable to resolve MyMessageQueueFactory.
Resolved: '' Unresolved:'MyMessageQueueFactory' ; remaining name
javax.naming.NameNotFoundException: Unable to resolve MyMessageQueueFactory.
Reso
lved: '' Unresolved:'MyMessageQueueFactory' ; remaining name ''
<<no stack trace available>>
>
<Error> <J2EE> <Error deploying application
WFEngine: Could not deploy: 'xyz.jar'
Possible reasons include:
1. The bean or an interface class has been modified but
the deployment descriptor has not been updated
2. The database mappings in the deployment descriptor do not
match the database definition
3. The jar file is not a valid jar file
4. The jar file does not contain a valid bean>
Thanks
NareshI am adding a message driven bean in to my EJB application and trying
to deploy it in the WebLogic 6.0 server.
Now please let me know is there any other step i am missing.
1) This is what i have added in my ejb-jar.xml
<enterprise-beans>
<message-driven>
<description>no description</description>
<display-name>ActivatorBean</display-name>
<ejb-name>ActivatorBean</ejb-name>
<ejb-class>com.savvion.bizlogic.server.ActivatorBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<jms-destination-type>javax.jms.Queue</jms-destination-type>
</message-driven-destination>
<security-identity>
<description/>
<run-as-specified-identity>
<description/>
<role-name/>
</run-as-specified-identity>
</security-identity>
</message-driven>
2) I am adding this is in the weblogic-ejb.xml
<weblogic-enterprise-bean>
<ejb-name>ActivatorBean</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>MyMessageQueueFactory</destination-jndi-name>
</message-driven-descriptor>
<transaction-descriptor>
<trans-timeout-seconds>1200</trans-timeout-seconds>
</transaction-descriptor>
<jndi-name>MessageQueue</jndi-name>
</weblogic-enterprise-bean>
anything else which needs to added in WebLogic-ejb.xml or in config.xml
because as per the following error message there should be some
entry in config.xml.
onemore thing i am little bit confused in
<destination-jndi-name>MyMessageQueueFactory</destination-jndi-name>
and
<jndi-name>MessageQueue</jndi-name>
and when i deploed this in WebLogic got this error message on the
prompt
<Error> <J2EE> <Error deploying EJB Component : LEngine
weblogic.ejb20.EJBDeploymentException: Error deploying Message-Driven
Bean,
couldn't find Queue 'MyMessageQueueFactory'. Make sure it was declared
in your config.xml.
; nested exception is:
javax.naming.NameNotFoundException: Unable to resolve MyMessageQueueFactory.
Resolved: '' Unresolved:'MyMessageQueueFactory' ; remaining name
javax.naming.NameNotFoundException: Unable to resolve MyMessageQueueFactory.
Reso
lved: '' Unresolved:'MyMessageQueueFactory' ; remaining name ''
<<no stack trace available>>
>
<Error> <J2EE> <Error deploying application
WFEngine: Could not deploy: 'xyz.jar'
Possible reasons include:
1. The bean or an interface class has been modified but
the deployment descriptor has not been updated
2. The database mappings in the deployment descriptor do not
match the database definition
3. The jar file is not a valid jar file
4. The jar file does not contain a valid bean>
Thanks
Naresh -
A difficult javax.naming.NameNotFoundException problem
I have to move my application from IBM X455 PC Server to IBM X3850 (inter x86 64bit) PC Server . The application had been running on IBM X455 for about 3 years well . The OS is Red hat linux. The weblogic server on IBM X455 is 8.1.3. I tar the application from IBM X455 to IBM X3850 and install weblogic 8.1.4 on the x86 64bit OS. I redeploy the application on weblogic 8.1.4. When the client try to connect to the server, follow errors appear:
<Jul 30, 2008 8:39:21 AM GMT+08:00> <Warning> <WLW> <000000> <Unable to load class ProcessControl>
<Jul 30, 2008 8:39:22 AM GMT+08:00> <Error> <WLW> <000000> <Exception processing SessionService
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.RuntimeException: Unable to create adaptor
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl_814_WLStub.confirmDeployment(Unknown Source)
at com.bea.wlw.runtime.core.dispatcher.DispProjectJar.confirmDeployment(DispProjectJar.java:190)
at com.bea.wlw.runtime.core.dispatcher.DispResources.confirmDeployment(DispResources.java:752)
at com.bea.wlw.runtime.core.dispatcher.DispCache.ensureDispUnit(DispCache.java:767)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.getDispUnit(HttpServerHelper.java:501)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executePostRequest(HttpServerHelper.java:649)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doPost(HttpServer.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.reformsoft.safe.manage.SessionFilter.doFilter(SessionFilter.java:64)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.RuntimeException: Unable to create adaptor
at com.bea.wlw.runtime.core.dispatcher.DispBean.getAdaptor(DispBean.java:198)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.confirmDeployment(SyncDispatcherBean.java:346)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.confirmDeployment(SyncDispatcher_k1mrl8_EOImpl.java:100)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166)
... 24 more
Caused by: javax.naming.NameNotFoundException: While trying to lookup 'SafeWebService.GenericStateless.bean.StatelessContainer' didn
't find subcontext 'GenericStateless' Resolved SafeWebService; remaining name 'GenericStateless/bean/StatelessContainer'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:897)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:225)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:154)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:188)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:256)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:359)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.bea.wlw.runtime.core.dispatcher.DispBean.getHome(DispBean.java:132)
at com.bea.wlw.runtime.core.dispatcher.DispBean.getAdaptor(DispBean.java:189)
... 28 more
>
<Jul 30, 2008 8:39:22 AM GMT+08:00> <Error> <WLW> <000000> <Returning HTTP 500 due to httpWriteCompileErrors <error> <description>An
unexpected exception occurred while attempting to locate the run-time information for this Web Service. Error: java.rmi.RemoteExcep
tion:EJB Exception: ; nested exception is: java.lang.RuntimeException: Unable to create adaptor</description> <source>[unknown sourc
e]</source> <line>[unknown line]</line> <column>[unknown column]</column> <prescription>An unexpected error occurred. Please contact
[email protected] for further assistance.</prescription> </error> >
I check the weblogic console and find that there is something wrong with the JNDI tree. The state of GenericStateless is red. because of my poor english , please get the picture from http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=47583&messageID=282533 or http://www.itpub.net/viewthread.php?tid=1032379&extra=page%3D1&frombbs=1 , it will help.
Since the application is an old one and runs well on IBM X455 machine , the configuration of JNDI and other components is ok. Since the weblogic version is different(8.1.3 to 8.1.4, 32 bit to 64 bit) , is there anything wrong with the weblogic or JDK enviroment? or OS configuration? I have tried weblogic 8.1.6 and many versions of JDK too, still failed . What is wrong? Please help me ASAP. Thanks a lot!Did you managed to get the solution to the above error. Can you please let me know the solution if you have get it right? You can post back to my id [email protected]
Thanks,
SK
Edited by: shivaG on Nov 3, 2008 4:25 AM -
Javax.naming.NameNotFoundException in Jdeveloper 10g
HI,
I just migrate my source code from Jdeveloper 9 to Jdeveloper 10g. Since then, all my codes do not work properly.
I cut and pasted from old version data-source.xml to 10g data-source.xml. However, when I run the project, I got javax.naming.NameNotFoundException:jdbc/mbciwebEjb not found. I check my data-souces.xml which in embeded-oc4j/config folder. The definition is there.
Can anybody help me?
Thanksganesh wrote:
using WLS 8.1:
deployed all session beans in jar1
deployed all entity beans in jar2
session code trying to jndi lookup entity bean, using localhome interface.
the entity bean descriptor has <local-jndi-name> tag specified
but jndi lookup from session bean is failing, is this because session bean is in different jar.
what is solution please
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: While trying to look up /app/ejb/ejbs2.jar#UserEntity/local-home in /app/ejb/ejbs1.jar#UserManagerBean.; remaining name '/app/ejb/ejbs2/jar#UserEntity/local-home'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:869)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:148)Are these two jar deployed in the same application or different
applications?
-- Prasad -
Hi
I use JDev Studio 10.1.3.40.66 and EJB 3.0 with annotations. I am working in the same Project (Model) with two stateless beans and some entities. In the same Project I have one test-client which implemented the lookup.
Here a snippet of the EJB:
@Stateless( name = "MyDao" )
public class MyDaoImpl implements IMyDao {
... }Here piece of code out of test-client:
final Context context = getInitialContext();
IMyDao iMyDao = (IMyDao)context.lookup("MyDao");Now everything worked fine and nobody changed anything in the project. So it may be that after a "power off" and a restart I couldn't find my EJBs with the lookup?!
Here is what I get from OC4J log:
07/04/02 10:32:09 FEIN: TxSecIORInterceptor.addCSIv2Components Unable to obtain mutual auth port
07/04/02 10:32:09 FEIN: TxSecIORInterceptor.addCSIv2Components UnknownType exceptioncom.sun.corba.ee.spi.legacy.interceptor.UnknownType
(Here is some more stack trace!)
FEIN: [current-workspace-app:Azima_AzimaModel_0] Initializing EntityManagerFactory named Azima-local with persistence provider oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.
07/04/02 10:32:13 WARNUNG: Application.setConfig Application: current-workspace-app is in failed state as initialization failed.
java.lang.LinkageError: loader constraints violated when linking javax/persistence/spi/PersistenceUnitInfo class
Checking that EJBs were successfully deployed in embedded OC4J...
All EJBs are successfully deployed.From my test-client log I get:
javax.naming.NameNotFoundException: MyDao not found
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.promatis.azima.model.test.Client.main(Client.java:390)
...So I couldn't test my EJB anymore. If you have some suggestions or if you need more information about my project just post...
I need some help with this problem!
ThanksI work now more that two days on this error!!!
-> I remade my complete jdev project, it did not work!
-> I deleted the jdev/system/j2ee/oc4j/workspace dir
-> I search for some .lock files
-> and many more tries!!! But without success...
Is there a way to reset the Embedded OC4J? -
JNDI lookup from OC4J to weblogic throws javax.naming.NameNotFoundException
Hi All,
We have the below setup in our production environment.
EJB application is deployed in the Weblogic 10.3.4.0 Server on Sun Solaris. The EJB version is 3.0
OC4J 10.2.0 is running on another Sun Solaris machine.
There are 2 webservice applications WEBSERV1 & TestSoapEJB running on this OC4J container.
We need to do lookup the EJBs deployed on the Weblogic server. For this we used the below logic in the web service's Stateless session bean:
String weblogicURL = "";
Properties props = new Properties();
try
props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("wl.properties"));
weblogicURL = props.getProperty("weblogicURL");
catch (FileNotFoundException e)
e.printStackTrace();
catch (IOException e)
e.printStackTrace();
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.SECURITY_PRINCIPAL,"weblogic");
ht.put(Context.SECURITY_CREDENTIALS,"weblogic654");
ht.put(Context.PROVIDER_URL, weblogicURL);
ctx = NamingManager.getInitialContext(ht) ;
// tried using //ctx = new InitialContext(ht); same behavior.
TestEJB.AdministratorEJB ejb = (TestEJB.AdministratorEJB) ctx.lookup("TestEJB#TestEJB.AdministratorEJB");
ctx.close();
When we first test first WEBSER1, the lookup is fine.
But when we test the second webservice WEBSER2, the webservice name itself not able to lookup: It gives the below error:
javax.naming.NameNotFoundException: remaining name: env/TestSoapEJB
Below is the stack throws thrown on browser:
500 Internal Server Error
javax.naming.NameNotFoundException: remaining name: env/TestSoapEJB
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:64)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at oracle.j2ee.ws.SessionBeanRpcWebService.init(SessionBeanRpcWebService.java:65)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.findServlet(HttpApplication.java:4795)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2821)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:680)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:662)
It seems that, the OC4J is looking in Weblogic context. But it should be looking in its own context. How to resolve this issue.
The same case happens if i restart the OC4J and first test the TestSoapEJB the lookup is fine . But if i test the WEBSERV1 , it throws the same error as above. In short, if one of the webservices lookup is working fine, the other webservice is not working. At the same time only one webservice's lookup is working.
Kindly help me to resolve this issue.
regards,
Zia
Edited by: PT Expert on Sep 9, 2012 3:16 AMI work now more that two days on this error!!!
-> I remade my complete jdev project, it did not work!
-> I deleted the jdev/system/j2ee/oc4j/workspace dir
-> I search for some .lock files
-> and many more tries!!! But without success...
Is there a way to reset the Embedded OC4J? -
JNDI lookup failed:javax.naming.NameNotFoundException
Hello:
I have a application (not web) that publish messages to a specific topic, i want to receive these messages in a Web Service, but when the web service make the call to a class that is the JMS Client it can't find the Connection factory Name that i create in the aplication.
I want to know what i have to do,
I work with J2EE1.3.1 and JMS1.0.2 for the application that publish the messages
and Jwsdp1.1, tomcat 4 and j2sdk 1.4.0 for the web service.
I create the connection factory with this command:
j2eeadmin -addJmsFactory jms/DurableTopicB topic -props clientID=IdTopicB
Then in the class that the web service invoke i trying to join with this:
try {
jndiContext =new InitialContext();
}catch (NamingException e){
System.err.println("Could not create JNDI API "+
"context:"+e.toString());
return;
*Look up connection factory and topic.If either
*does not exist,exit.
try {
topicConnectionFactory =(TopicConnectionFactory)
jndiContext.lookup(conFacName);
}catch (NamingException e){
System.err.println("JNDI API lookup failed:"+
e.toString());
return;
//System.exit(1);
But i receive a error message in the log of Tomcat:
JNDI API lookup failed:javax.naming.NameNotFoundException: El nombre DurableTopicB no este asociado a este contexto
ThanksHello:
I display the full context of the connection factory in the application that publish the message:
Full context is :
Enviroment is : {java.naming.corba.orb=com.sun.enterprise.iiop.POAEJBORB@ec4a87}
And in the web service when i create the initial context the full context is:
Full context is : java:
Enviroment is : {java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, java.naming.factory.url.pkgs=org.apache.naming}
How can i see the connection factory in the Web Service, because the connection factory was created in other Application? -
Javax.naming.NameNotFoundException for foreign JMS Connection factory
I have a foreign jms server configured and when I try and test it I get a Name not found exception.
javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms]; remaining name 'SSLQueueConnectionFactory'
The config.xml looks ok
<ForeignJMSServer
ConnectionURL="ssl://eaid1-jms.ges.symantec.com:7243"
JNDIProperties="" Name="JMS Proxy Dev" Targets="TeamWorksServer">
<ForeignJMSConnectionFactory
LocalJNDIName="jms.SSLQueueConnectionFactory"
Name="MyForeign JMS Connection Factory"
PasswordEncrypted="{3DES}Es94ikW1TZzBFyDp+3/gktRtDaHWI6j/"
RemoteJNDIName="SSLQueueConnectionFactory" Username="weblogicUser"/>
<ForeignJMSDestination LocalJNDIName="jms.WEBLOGIC.TEST.QUEUE"
Name="MyForeign JMS Destination" RemoteJNDIName="WEBLOGIC.TEST.QUEUE"/>
</ForeignJMSServer>
The code i took from the QueueSend example
package com.symantec.utils.jms;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
/** This example shows how to establish a connection
* and send messages to the JMS queue. The classes in this
* package operate on the same JMS queue. Run the classes together to
* witness messages being sent and received, and to browse the queue
* for messages. The class is used to send messages to the queue.
* @author Copyright (c) 1999-2006 by BEA Systems, Inc. All Rights Reserved.
public class QueueSend
// Defines the JNDI context factory.
public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
// Defines the JMS context factory.
public final static String JMS_FACTORY="jms.SSLQueueConnectionFactory";
// Defines the queue.
public final static String QUEUE="WEBLOGIC.TEST.QUEUE";
private QueueConnectionFactory qconFactory;
private QueueConnection qcon;
private QueueSession qsession;
private QueueSender qsender;
private Queue queue;
private TextMessage msg;
* Creates all the necessary objects for sending
* messages to a JMS queue.
* @param ctx JNDI initial context
* @param queueName name of queue
* @exception NamingException if operation cannot be performed
* @exception JMSException if JMS fails to initialize due to internal error
public void init(Context ctx, String queueName)
throws NamingException, JMSException
qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(queueName);
qsender = qsession.createSender(queue);
msg = qsession.createTextMessage();
qcon.start();
* Sends a message to a JMS queue.
* @param message message to be sent
* @exception JMSException if JMS fails to send message due to internal error
public void send(String message) throws JMSException {
msg.setText(message);
qsender.send(msg);
* Closes JMS objects.
* @exception JMSException if JMS fails to close objects due to internal error
public void close() throws JMSException {
qsender.close();
qsession.close();
qcon.close();
private static void readAndSend(QueueSend qs)throws IOException, JMSException
BufferedReader msgStream = new BufferedReader(new InputStreamReader(System.in));
String line=null;
boolean quitNow = false;
do {
System.out.print("Enter message (\"quit\" to quit): \n");
line = msgStream.readLine();
if (line != null && line.trim().length() != 0) {
qs.send(line);
System.out.println("JMS Message Sent: "+line+"\n");
quitNow = line.equalsIgnoreCase("quit");
} while (! quitNow);
private static InitialContext getInitialContext(String url)
throws NamingException
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
return new InitialContext(env);
/** main() method.
* @param args WebLogic Server URL
* @exception Exception if operation fails
public static void main(String[] args) throws Exception
InitialContext ic = getInitialContext("t3://tus1bpmappdin01.ges.symantec.com:7501");
QueueSend qs = new QueueSend();
qs.init(ic, QUEUE);
readAndSend(qs);
qs.close();
Any suggestions would be appreciated
RegardsI have a foreign jms server configured and when I try and test it I get a Name not found exception.
javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms]; remaining name 'SSLQueueConnectionFactory'
The config.xml looks ok
<ForeignJMSServer
ConnectionURL="ssl://eaid1-jms.ges.symantec.com:7243"
JNDIProperties="" Name="JMS Proxy Dev" Targets="TeamWorksServer">
<ForeignJMSConnectionFactory
LocalJNDIName="jms.SSLQueueConnectionFactory"
Name="MyForeign JMS Connection Factory"
PasswordEncrypted="{3DES}Es94ikW1TZzBFyDp+3/gktRtDaHWI6j/"
RemoteJNDIName="SSLQueueConnectionFactory" Username="weblogicUser"/>
<ForeignJMSDestination LocalJNDIName="jms.WEBLOGIC.TEST.QUEUE"
Name="MyForeign JMS Destination" RemoteJNDIName="WEBLOGIC.TEST.QUEUE"/>
</ForeignJMSServer>
The code i took from the QueueSend example
package com.symantec.utils.jms;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
/** This example shows how to establish a connection
* and send messages to the JMS queue. The classes in this
* package operate on the same JMS queue. Run the classes together to
* witness messages being sent and received, and to browse the queue
* for messages. The class is used to send messages to the queue.
* @author Copyright (c) 1999-2006 by BEA Systems, Inc. All Rights Reserved.
public class QueueSend
// Defines the JNDI context factory.
public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
// Defines the JMS context factory.
public final static String JMS_FACTORY="jms.SSLQueueConnectionFactory";
// Defines the queue.
public final static String QUEUE="WEBLOGIC.TEST.QUEUE";
private QueueConnectionFactory qconFactory;
private QueueConnection qcon;
private QueueSession qsession;
private QueueSender qsender;
private Queue queue;
private TextMessage msg;
* Creates all the necessary objects for sending
* messages to a JMS queue.
* @param ctx JNDI initial context
* @param queueName name of queue
* @exception NamingException if operation cannot be performed
* @exception JMSException if JMS fails to initialize due to internal error
public void init(Context ctx, String queueName)
throws NamingException, JMSException
qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(queueName);
qsender = qsession.createSender(queue);
msg = qsession.createTextMessage();
qcon.start();
* Sends a message to a JMS queue.
* @param message message to be sent
* @exception JMSException if JMS fails to send message due to internal error
public void send(String message) throws JMSException {
msg.setText(message);
qsender.send(msg);
* Closes JMS objects.
* @exception JMSException if JMS fails to close objects due to internal error
public void close() throws JMSException {
qsender.close();
qsession.close();
qcon.close();
private static void readAndSend(QueueSend qs)throws IOException, JMSException
BufferedReader msgStream = new BufferedReader(new InputStreamReader(System.in));
String line=null;
boolean quitNow = false;
do {
System.out.print("Enter message (\"quit\" to quit): \n");
line = msgStream.readLine();
if (line != null && line.trim().length() != 0) {
qs.send(line);
System.out.println("JMS Message Sent: "+line+"\n");
quitNow = line.equalsIgnoreCase("quit");
} while (! quitNow);
private static InitialContext getInitialContext(String url)
throws NamingException
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
return new InitialContext(env);
/** main() method.
* @param args WebLogic Server URL
* @exception Exception if operation fails
public static void main(String[] args) throws Exception
InitialContext ic = getInitialContext("t3://tus1bpmappdin01.ges.symantec.com:7501");
QueueSend qs = new QueueSend();
qs.init(ic, QUEUE);
readAndSend(qs);
qs.close();
Any suggestions would be appreciated
Regards -
Javax.naming.NameNotFoundException: error in whil calling EJB Bean
Dear friends,
I have created (Bean Managed Entity) a remote,home and bean objects for adding a country in a database. When i convert
into jar and and deploy means, its working fine. But if i put into a package means it does work
and raise "javax.naming.NameNotFoundException" error.
i keep my files as following folder structure
d:\siva\projects\ShopCart\
(under this )
CountryMas.java
CountryHome.java
CountryBean.java
CountryMasPK.java
<meta-inf>
ejb-jar.xml
weblogic-ejb-jar.xml
and deployed in weblogic 6.1 using console.
i have copied the source code here with
Remote interface
package ShopCart;
import javax.ejb.*;
import javax.rmi.*;
public interface CountryMas extends EJBObject {
Home Interface
package ShopCart;
import javax.ejb.*;
import java.rmi.*;
public interface CountryHome extends EJBHome {
public CountryMas create(String Cname) throws CreateException,RemoteException;
public CountryMas findByPrimaryKey(CountryMasPK pk) throws
FinderException,RemoteException;
BEAN OBJECT
package ShopCart;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.sql.*;
import javax.ejb.*;
import javax.naming.*;
public class CountryBean implements EntityBean {
private EntityContext ctx;
private int CountryId;
private String CountryName;
public void setEntityContext(EntityContext ctx){
this.ctx = ctx;
public void unsetEntityContext(){
this.ctx = null;
public void ejbActivate(){
public void ejbPassivate(){
public void ejbLoad(){
public void ejbStore(){
public void ejbRemove(){
Connection con = null;
PreparedStatement ps = null ;
try {
con = getConnection();
ps = con.prepareStatement("Delete from CountryMas where id=?");
ps.setInt(1,CountryId);
if (ps.executeUpdate() !=1) {
String Error = "JDBC did not create any row";
throw new CreateException (Error);
}catch (Exception e){
System.out.println (e);
public CountryMasPK ejbCreate(String Cname) throws CreateException {
this.CountryName =Cname;
Connection con = null;
PreparedStatement ps = null ;
try {
con = getConnection();
ps = con.prepareStatement("insert into CountryMas values(?)");
ps.setString (1,CountryName);
if (ps.executeUpdate() !=1) {
String Error = "JDBC did not delete any row";
throw new CreateException (Error);
con.commit();
}catch (Exception e){
System.out.println (e);
int PKid=0;
ResultSet rs;
PreparedStatement ps1 = null;
try {
ps1 = con.prepareStatement("select max(id) as Mid from CountryMas");
rs = ps1.executeQuery();
PKid = rs.getInt("mid");
}catch(Exception e){
System.out.println (e);
return new CountryMasPK(PKid);
public void ejbPostCreate(String Cname) throws CreateException {
private Connection getConnection()throws SQLException {
InitialContext initCtx = null;
DataSource ds = null;
try{
initCtx = new InitialContext ();
ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/ShopCartPool");
}catch(Exception e){
System.out.println(e);
return ds.getConnection();
public CountryMasPK ejbFindByPrimaryKey(CountryMasPK pk)throws ObjectNotFoundException {
Connection con= null;
PreparedStatement ps = null ;
try{
con = getConnection();
ps = con.prepareStatement("select cname from CountryMas where id=?");
ps.setInt(1,pk.ID);
ps.executeQuery();
ResultSet rs= ps.getResultSet();
if (rs.next()){
this.CountryName = rs.getString(1);
}catch(Exception e){
System.out.println(e);
//return new CountryMasPK(pk.i);
return pk;
PRIMARY KEY OBJECT
package ShopCart;
import java.io.Serializable;
public class CountryMasPK implements java.io.Serializable {
public int ID;
public CountryMasPK(int ID){
this.ID =ID;
public CountryMasPK(){
public CountryMasPK(CountryMasPK pk){
this.ID = pk.ID;
public String toString(){
return new Integer(ID).toString();
public int hashCode(){
return new Integer(ID).hashCode();
public boolean equals(Object countrymas){
//return ((CountryMasPK)countrymas).ID.equals(ID);
return true;
EJB-JAR.XML
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC
'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>ShopCart</ejb-name>
<home>ShopCart.CountryHome</home>
<remote>ShopCart.CountryMas</remote>
<ejb-class>ShopCart.CountryBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>ShopCart.CountryMasPK</prim-key-class>
<reentrant>False</reentrant>
<resource-ref>
<res-ref-name>jdbc/ShopCartPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ShopCart</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
WEBLOGIC-EJB-JAR.XML
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>ShopCart</ejb-name>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/ShopCartPool</res-ref-name>
<jndi-name>ShopCartDataSource</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>Country</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
i converted jar file like this
d:\siva\projects\> set claapath=%classpath%;.;
cd d:\siva\projects\ShopCart > javac *.java
cd d:\siva\projects\ShopCart > jar -cvf Sh.jar *
cd..
d:\siva\projects> java weblogic.ejbc ShopCart\Sh.jar ShopCart\Shop.jar
and deployed using weblogic 6.1 console
and client code as follows
Client.java
import java.io.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.*;
import java.util.*;
import ShopCart.*;
class Client {
public static void main(String args[]){
Context ctx=null;
try{
Properties pr = new Properties();
pr.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
pr.put(Context.PROVIDER_URL,"t3://localhost:7001");
ctx= new InitialContext(pr);
Object obj = ctx.lookup("Country");
CountryHome cm = (CountryHome)
javax.rmi.PortableRemoteObject.narrow(obj,CountryHome.class);
cm.create(args[0]);
System.out.println ("Creating Country " + args[0] +" ..... [Done]");
}catch (Exception e){
System.out.println(e);
when i run this file it raise the error
D:\Siva\Projects>java Client.java
Exception in thread "main" java.lang.NoClassDefFoundError: Client/java
D:\Siva\Projects>java Client
javax.naming.NameNotFoundException: Unable to resolve Country. Resolved: '' Unre
solved:'Country' ; remaining name ''
D:\Siva\Projects>
This is the error message. Please observe it and do let me know what would be the error. There
would be small configuration error. But i couldn't locate it . plz help me somebody.
Thanx & Regards,
Siva.you need to use the name java:comp/env/Country in the client.
and the client deployment descriptor will need an ejb-ref entry:
<ejb-ref>
<ejb-ref-name>
Country
</ejb-ref-name>
<ejb-ref-type>
Session
</ejb-ref-type>
<home>
ShopCart.CountryHome
</home>
<remote>
ShopCart.CountryMas
</remote>
</ejb-ref>toby -
Help, help! I have a problem:
javax.naming.NameNotFoundException: No object bound for java:comp/env/configuratorDataSource
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:355)
at oracle.toplink.jndi.JNDIConnector.connect(Unknown Source)
at oracle.toplink.sessions.DatabaseLogin.connect(Unknown Source)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown Source)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown Source)
at oracle.toplink.threetier.ConnectionPool.buildConnection(Unknown Source)
at oracle.toplink.threetier.ConnectionPool.startUp(Unknown Source)
at oracle.toplink.threetier.ServerSession.connect(Unknown Source)
at oracle.toplink.publicinterface.DatabaseSession.login(Unknown Source)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
at com.configurator.datasource.ToplinkClientSessionManager.<init>(ToplinkClientSessionManager.java:18)
at com.configurator.datasource.ToplinkClientSessionManager.getInstance(ToplinkClientSessionManager.java:33
at com.configurator.persistence.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:16)
at com.configurator.ConfiguratorServiceMediatorImpl.getModelsFromDB(ConfiguratorServiceMediatorImpl.java:3
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:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:595)
code:
initialContext = new InitialContext();
LocalStatelessREHome localHome = (LocalStatelessREHome)initialContext.lookup("java:comp/env/StatelessREBean");
in web.xml:
<ejb-local-ref>
<ejb-ref-name>StatelessREBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.re.stateless.ejb.LocalStatelessREHome</local-home>
<local>com.re.stateless.ejb.LocalStatelessRE</local>
<ejb-link>StatelessREBean</ejb-link>
</ejb-local-ref>
Any help will be appreciated! Thanks in advance.Try removing the JNDI fully qualified name (i.e. java:comp\env\) Use the name of your bean to lookup.
It worked for me when i used to get a similar exception. -
Getting javax.naming.NameNotFoundException
Hi im a begginer for EJB n jDeveloper. I'm trying to run my code but whenever i tried to run im getting name not found exception. I'm using jDeveloper 10 and oracle DB 10 XE.
Here is the output:
C:\jdevstudio10135\jdk\bin\javaw.exe -client -classpath C:\jdevstudio10135\jdev\mywork\Lab3_B\Lab3\classes;C:\jdevstudio10135\j2ee\home\lib\ejb30.jar;C:\jdevstudio10135\toplink\jlib\toplink-essentials.jar;C:\jdevstudio10135\j2ee\home\lib\activation.jar;C:\jdevstudio10135\j2ee\home\lib\ejb.jar;C:\jdevstudio10135\j2ee\home\lib\jms.jar;C:\jdevstudio10135\j2ee\home\lib\jta.jar;C:\jdevstudio10135\j2ee\home\lib\mail.jar;C:\jdevstudio10135\j2ee\home\lib\servlet.jar;C:\jdevstudio10135\jdev\system\oracle.j2ee.10.1.3.43.6\embedded-oc4j\.client;C:\jdevstudio10135\j2ee\home\oc4j.jar;C:\jdevstudio10135\j2ee\home\lib\oc4j-internal.jar;C:\jdevstudio10135\opmn\lib\optic.jar;C:\jdevstudio10135\toplink\jlib\toplink.jar;C:\jdevstudio10135\toplink\jlib\toplink-oc4j.jar;C:\jdevstudio10135\toplink\jlib\antlr.jar lab3.BankTellerFacadeClient
javax.naming.NameNotFoundException: bankTellerFacade not found
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:60)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at lab3.BankTellerFacadeClient.main(BankTellerFacadeClient.java:18)
Process exited with exit code 0.
n here is my code:
BankTellerFacadeBean.java
package lab3;
import java.math.BigDecimal;
import java.util.List;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Stateful(name = "BankTellerFacade")
public abstract class BankTellerFacadeBean implements BankTellerFacade {
@PersistenceContext(unitName = "Lab3")
private EntityManager em;
private SavingsAccount defaultAccount = null;
public BankTellerFacadeBean() {
public Object mergeEntity(Object entity) {
return em.merge(entity);
public Object persistEntity(Object entity) {
em.persist(entity);
return entity;
/** <code>select o from SavingsAccount o</code> */
public List<SavingsAccount> findAll() {
return em.createNamedQuery("findAll").getResultList();
public void removeSavingsAccount(SavingsAccount savingsAccount) {
savingsAccount = em.find(SavingsAccount.class, savingsAccount.getId());
em.remove(savingsAccount);
public SavingsAccount findByPrimaryKey(Long eid) {
return (SavingsAccount)em.createNamedQuery("findByPrimaryKey").setParameter("eid",
eid).getSingleResult();
public List<SavingsAccount> findByLastName(String lName) {
return em.createNamedQuery("findByLastName").setParameter("lName",
lName).getResultList();
public void addAccount(Long pid, String fName, String lName, Double bal) {
SavingsAccount acc = new SavingsAccount(pid, fName, lName, bal);
this.persistEntity(acc);
public void removeAccount(Long accNo) {
defaultAccount = findByPrimaryKey(accNo);
this.removeSavingsAccount(defaultAccount);
public void credit(Long accNo, Double amount) {
defaultAccount = findByPrimaryKey(accNo);
Double balance = defaultAccount.getBalance() + amount;
defaultAccount.setBalance(balance);
public void debit(Long accNo,
Double amount) throws InsufficientBalanceException {
defaultAccount = findByPrimaryKey(accNo);
if (defaultAccount.getBalance() < amount) {
throw new InsufficientBalanceException("Insufficient balance!");
defaultAccount.setBalance(defaultAccount.getBalance() - amount);
public List<SavingsAccount> findInRange(BigDecimal balance1, BigDecimal balance2) {
return em.createNamedQuery("findInRange").setParameter("balance1", balance1).setParameter("balance2", balance2).getResultList();
SavingsAccount.java
package lab3;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@Entity
@NamedQueries({
@NamedQuery(name="findAll", query="select o from SavingsAccount o"),
@NamedQuery(name="findByPrimaryKey", query="select o from SavingsAccount o"
+
" where o.id = :eid"),
@NamedQuery(name="findByLastName", query="select o from SavingsAccount o"
+
" where o.lastname = :lName"),
@NamedQuery(name="findInRange", query="select o from SavingsAccount o"
+
" where o.balance BETWEEN :balance1 AND :balance2")
public class SavingsAccount implements Serializable {
private Double balance;
private String firstname;
@Id
@Column(nullable = false)
private Long id;
private String lastname;
public SavingsAccount() {
public SavingsAccount(Long pid, String fName, String lName, Double bal) {
setId(pid);
setFirstname(fName);
setLastname(lName);
setBalance(bal);
public Double getBalance() {
return balance;
public void setBalance(Double balance) {
this.balance = balance;
public String getFirstname() {
return firstname;
public void setFirstname(String firstname) {
this.firstname = firstname;
public Long getId() {
return id;
public void setId(Long id) {
this.id = id;
public String getLastname() {
return lastname;
public void setLastname(String lastname) {
this.lastname = lastname;
BankTellerFacadeClient.java:
package lab3;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.Iterator;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class BankTellerFacadeClient {
public static void main(String [] args) {
try {
final Context context = getInitialContext();
BankTellerFacade bankTellerFacade = (BankTellerFacade)context.lookup("bankTellerFacade");
SavingsAccount account = null;
bankTellerFacade.addAccount(new Long(123), "Joe", "Soap", new Double(123.45));
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
account = bankTellerFacade.findByPrimaryKey(new Long(123));
System.out.println(account.getFirstname() + " " +
account.getLastname() +
"'s account balance is £" +
nf.format(account.getBalance()));
bankTellerFacade.credit(new Long(123), new Double(43.55));
System.out.println(account.getFirstname() + " " +
account.getLastname() +
"'s account balance is £" +
nf.format(account.getBalance()));
bankTellerFacade.debit(new Long(123), new Double(100.00));
System.out.println(account.getFirstname() + " " +
account.getLastname() +
"'s account balance is £" +
nf.format(account.getBalance()));
bankTellerFacade.addAccount(new Long(234), "Fred", "Bloggs", new Double(345.23));
bankTellerFacade.credit(new Long(234), new Double(234.12));
bankTellerFacade.debit(new Long(234), new Double(100.0));
account = bankTellerFacade.findByPrimaryKey(new Long(234));
System.out.println(account.getFirstname() + " " +
account.getLastname() +
"'s account balance is £" +
nf.format(account.getBalance()));
bankTellerFacade.addAccount(new Long(345), "Brian", "Bloggs", new Double(10.00));
bankTellerFacade.credit(new Long(345), new Double(345.12));
bankTellerFacade.debit(new Long(345), new Double(123.45));
account = bankTellerFacade.findByPrimaryKey(new Long(345));
System.out.println(account.getFirstname() + " " +
account.getLastname() +
"'s account balance is £" +
nf.format(account.getBalance()));
List<SavingsAccount> accounts;
accounts = bankTellerFacade.findAll( );
Iterator i;
i = accounts.iterator();
System.out.println("Details of all savings accounts");
while (i.hasNext()) {
SavingsAccount tempAccount = (SavingsAccount) i.next();
System.out.println(tempAccount.getId() + " " +
tempAccount.getFirstname()+ " " +
tempAccount.getLastname() + " balance £" +
nf.format(tempAccount.getBalance()));
accounts = bankTellerFacade.findByLastName("Bloggs");
i = accounts.iterator();
System.out.println("Details of all savings accounts owned by the Bloggs family");
while (i.hasNext()) {
SavingsAccount tempAccount = (SavingsAccount) i.next();
System.out.println(tempAccount.getId() + " " +
tempAccount.getFirstname()+ " " +
tempAccount.getLastname() + " balance £" +
nf.format(tempAccount.getBalance()));
//accounts = bankTellerFacade.findInRange(new BigDecimal(200.0), new BigDecimal(500.0));
accounts = bankTellerFacade.findInRange(new BigDecimal (200.0), new BigDecimal (500.0));
i = accounts.iterator();
System.out.println("Details of all savings accounts with balances between £200 and £500");
while (i.hasNext()) {
SavingsAccount tempAccount = (SavingsAccount) i.next();
System.out.println(tempAccount.getId() + " " +
tempAccount.getFirstname()+ " " +
tempAccount.getLastname() + " balance £" +
nf.format(tempAccount.getBalance()));
catch (InsufficientBalanceException ex) {
System.out.println( ex.getMessage());
catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
// Get InitialContext for Embedded OC4J
// The embedded server must be running for lookups to succeed.
return new InitialContext();
InsufficientBalanceException.java:
package lab3;
public class InsufficientBalanceException extends Exception {
public InsufficientBalanceException()
public InsufficientBalanceException(String msg)
super(msg);
How could i solve this? and what is the reason behind this?Hi,
whatever is trying to find the facade probably does it with wrong spelling: bankTellerFacade
javax.naming.NameNotFoundException: bankTellerFacade not found
Your facade is named
@Stateful(name = "BankTellerFacade")
This is where you want to look for the problem
at lab3.BankTellerFacadeClient.main(BankTellerFacadeClient.java:18)
Frank -
Getting NameNotFoundException while trying to look up timer from startup cl
Hi all,
I am getting NameNotFoundException while trying to look up timer from startup class.
I have configured commonj.timers.TimerManager in ejb-jar.xml of my MDB. I am using statrtup classes to initialize some static components immidiate to the MDB's active state. I have to initialize the timer manager object immidiate to the MDB's active state which is configured in ejb-jar.xml. I wrote this lookup logic in postStart() method of ApplicationLifecycleListener, The method getting called but the lookup logic getting failed, the same look up logic is working in MDB class (MDBTimer.java). I have tried different ways, I did’nt get solution, finally I am posting the problem here.
Could any of weblogic experts please help out on this Issue?
Here I am giving my code.
weblogic-application.xml
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-application
xmlns="http://www.bea.com/ns/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
<listener>
<listener-class>my.examples.mdb.timer.TestApplicationListener</listener-class>
</listener>
</weblogic-application>
ejb-jar.xml
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"
version="3.0">
<enterprise-beans>
<message-driven>
<ejb-name>MyTimerMDB</ejb-name>
<ejb-class>my.examples.mdb.timer.MDBTimer
</ejb-class>
<resource-ref>
<description>My Default Timer Manager</description>
<res-ref-name>timer/MyDefaultTimer</res-ref-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
MDBTimer.java
package my.examples.mdb.timer;
import javax.ejb.MessageDriven;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import commonj.timers.Timer;
import commonj.timers.TimerManager;
@MessageDriven(mappedName = "TEST_Q", name = "MyTimerMDB", activationConfig = {
@javax.ejb.ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@javax.ejb.ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@javax.ejb.ActivationConfigProperty(propertyName = "transactionType", propertyValue = "Container"), })
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class MDBTimer implements MessageListener {
public static TimerManager manager = null;
@Override
public void onMessage(Message arg0) {
System.out.println("onMessage() method called...\n\n");
if (arg0 instanceof ObjectMessage) {
ObjectMessage msg = (ObjectMessage) arg0;
try {
if (msg.getObject() instanceof String) {
Thread.sleep(1000);
System.out
.println("Message received >> " + msg.getObject());
} catch (Exception e) {
e.printStackTrace();
System.out.println("onMessage() method returned...\n\n");
if(manager==null){
manager=MyUtil.getTimerManager();
TestApplicationListener.java
package my.examples.mdb.timer;
import commonj.timers.TimerManager;
import weblogic.application.ApplicationException;
import weblogic.application.ApplicationLifecycleEvent;
import weblogic.application.ApplicationLifecycleListener;
public class TestApplicationListener extends ApplicationLifecycleListener {
public void preStart(ApplicationLifecycleEvent evt)throws ApplicationException {
String logStr = ">>>>TestApplicationListener.preStart()>>>>";
System.out.println(logStr+"entered...");
super.preStart(evt);
System.out.println(logStr+"leveaing...");
public void postStart(ApplicationLifecycleEvent evt)throws ApplicationException {
String logStr = ">>>>TestApplicationListener.postStart()>>>>";
System.out.println(logStr+"entered...");
super.postStart(evt);
TimerManager timerManager = MyUtil.getTimerManager();
System.out.println(logStr+"Got timer manager ==> "+timerManager);
System.out.println(logStr+"leveaing...");
public void preStop(ApplicationLifecycleEvent evt)throws ApplicationException {
String logStr = ">>>>TestApplicationListener.preStop()>>>>";
System.out.println(logStr+"entered...");
TimerManager timerManager = MyUtil.getTimerManager();
System.out.println(logStr+"Got timer manager ==> "+timerManager);
super.preStop(evt);
System.out.println(logStr+"leveaing...");
public void postStop(ApplicationLifecycleEvent evt) throws ApplicationException{
String logStr = ">>>>TestApplicationListener.postStop()>>>>";
System.out.println(logStr+"entered...");
super.preStop(evt);
System.out.println(logStr+"leveaing...");
MyUtil.java
package my.examples.mdb.timer;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import commonj.timers.TimerManager;
public class MyUtil {
public static TimerManager getTimerManager() {
TimerManager timerManager = null;
try {
InitialContext ctx = new InitialContext();
timerManager = (TimerManager) ctx
.lookup("java:comp/env/timer/MyDefaultTimer");
System.out
.println("@@@@@Looked-up using java:comp/env/timer/MyDefaultTimer : "
+ timerManager);
} catch (NamingException e) {
e.printStackTrace();
return timerManager;
}Thaks for your valuble information. I tried as you suggested!!! But NO luck . Still I am getting the issue.
I am using a class(TestApplicationListener) implements ApplicationLifecycleListener to listen my application.
I have overriden the methods preStart(), postStart(), preStop() and postStop().
Given following entries in weblogic-application.xml
<listener>
<listener-class>my.examples.mdb.timer.TestApplicationListener</listener-class>
</listener>
Also given
<ejb>
<start-mdbs-with-application>false</start-mdbs-with-application>
</ejb> As you suggested.
If I try to look-up timer manager from postStart() method of TestApplicationListener then it is giving NameNotFoundException
, same exception is giving in preStop() method.
If it is problem with initialization; I think, it should not give problem with preStop() method. (Correct me if I am wrong)
If I try to lookup the timer manager from onMessage() method of my MDB, It is not giving any problem.
I didn’t understand the reason why it is happening.
Note: All the life cycle methods (preStart(), postStart(), preStop() and postStop() ) are getting executed when I start/stop/redeploy my application from console. -
Hi - While starting my weblogic admin server which is configured with Primavera and has BPM on that is throwing error like.
Please help me on this.
<Aug 27, 2013 3:09:31 PM IST> <Warning> <oracle.soa.services.workflow.worklist> <BEA-000000> <<.> Error while setting task display, this can happen with app l
oading issue, trying to load for 16>
TaskFlow Registration: TaskFlowDeployerThread.registerTaskFlowWithTask - calling TaskFlowPropsUtil.setTaskDisplayInfo - iteration-17
TaskFlow Registration: TaskFlowPropsUtil.setTaskDisplayInfo - begin with following params
ClientLookupType=REMOTE
CompositeVerion=null
CompositeAppName=null
TaskDefinitionNamespace=http://xmlns.oracle.com/P6ConfigValidator/P6ConfigValidator/ConfigurationReport
Hostname=gcdsinggn3abac02
URI=/workflow/P6ConfigUI/faces/adf.task-flow?_id=ConfigurationReport_TaskFlow&_document=WEB-INF/ConfigurationReport_TaskFlow.xml
TaskFlow Registration: TaskFlowPropsUtil.setTaskDisplayInfo - using namespace - http://xmlns.oracle.com/P6ConfigValidator/P6ConfigValidator/ConfigurationRepor
t
TaskFlow Registration: TaskFlowPropsUtil.setTaskDisplayInfo (private) - begin
TaskFlow Registration: TaskFlowPropsUtil.setTaskDisplayInfo (private) - obtaining existing taskDisplayInfo for namespace: http://xmlns.oracle.com/P6ConfigVali
dator/P6ConfigValidator/ConfigurationReport
oracle.bpel.services.workflow.client.WorkflowServiceClientException: javax.naming.NameNotFoundException: Unable to resolve 'RuntimeConfigService'. Resolved ''
; remaining name 'RuntimeConfigService'
at oracle.bpel.services.workflow.runtimeconfig.client.RuntimeConfigServiceRemoteClient.getTaskDisplayInfo(RuntimeConfigServiceRemoteClient.java:698)
at sun.reflect.GeneratedMethodAccessor318.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.bpel.services.workflow.client.WFClientRetryInvocationHandler.invokeTarget(WFClientRetryInvocationHandler.java:133)
at oracle.bpel.services.workflow.client.WFClientRetryInvocationHandler.invoke(WFClientRetryInvocationHandler.java:72)
at $Proxy124.getTaskDisplayInfo(Unknown Source)
at oracle.bpel.services.workflow.client.worklist.util.TaskFlowPropsUtil.setTaskDisplayInfo(TaskFlowPropsUtil.java:850)
at oracle.bpel.services.workflow.client.worklist.util.TaskFlowPropsUtil.setTaskDisplayInfo(TaskFlowPropsUtil.java:825)
at oracle.bpel.services.workflow.client.worklist.servlet.TaskFlowDeployerThread.registerTaskFlowWithTask(TaskFlowDeployerThread.java:276)
at oracle.bpel.services.workflow.client.worklist.servlet.TaskFlowDeployerThread.run(TaskFlowDeployerThread.java:133)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'RuntimeConfigService'. Resolved ''; remaining name 'RuntimeConfigService'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:412)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at oracle.bpel.services.workflow.runtimeconfig.client.RuntimeConfigServiceRemoteClient.getTaskDisplayInfo(RuntimeConfigServiceRemoteClient.java:693)
... 11 more
TaskFlow Registration: TaskFlowDeployerThread.registerTaskFlowWithTask - Error while setting task display, this can happen with app loading issue, trying to l
oad for 17Can any one help me Please ...
Maybe you are looking for
-
Using iPhone as Storage for any docs
Does anyone know how can I user iphone as storage device? I had motorola phone with 8 gigs mem card, where I could drag any docs (word, excell or any pics and music) I know it's pain here already with all the podcasts that I downloaded to transfer to
-
The macbook reads a disc, and opens up DVD player but then says not permitted when I hit play, or any other button. Sometimes the initial music plays, but the screen remains black and then it all stops. These are shop bought DVD's that have previousl
-
How to access my mail from another computer. Both iPads
HHow to access my mail from another computer. Both iPads. Both iCloud.
-
Render and Email SSRS reports via SOAP/Web Services
Hi all Running SQL Server 2008 R2 RTM and wondering if the ReportExecution2005.asmx web service can be used to render AND email a report all within the web service (ie. Not wanting to render the report and then having to email it manually). Since RS
-
hi,new to java,soplease be patient: 1) I've installed jdk1.6 on c drive in a folder named java 2) I've also saved the "HelloWorldApp.java" text file in the same folder 3) Now I try to run with C:\java\jdk1.6.0_10\bin\javac HelloWorldApp.java at the c