Javax.naming.NameNotFoundException: While trying to lookup 'jdbc.SampleHR1DS' didn't find subcontext

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 jdev

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

  • Javax.naming.NameNotFoundException: While trying to lookup 'mail.NewMailSes

    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 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?

  • 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
    Naresh

    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
    Naresh

  • Runtime error "didn't find subcontext 'jdbc'."

    hi,
    what does it take to make this application run back on WebLogic?
    It's a bit boring testing applications on Glassfish...
    So i'd prefer all-stage-development in JDeveloper, then final deployment to Glassfish.
    I followed to Shay Shmeltzer blog's recommendation on deployement to Glassfish and reversed it.
    i set deployment platfroms to Weblogic for Application and ViewController projects
    During runtime i get the error:
    While trying to lookup 'jdbc.ncsDS' didn't find subcontext 'jdbc'.Resolved
    What might cause it?
    i set for both DeployPlatform in bc4j.config
    <Custom JDBCDataSource="java:comp/env/jdbc/ncsDS"/>

    well , i talk about using integrated WL that comes with JDev.
    i guess it's all about setting up jdbc in the application
    (i hope nobody gets bored setting up integrated WL each day during development)

  • 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?
    Thanks

    ganesh 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

  • Tried to lookup an EJB (succ dply) got: javax.naming.NameNotFoundException

    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!
    Thanks

    I 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?

  • Javax.naming.NameNotFoundException: jdbc not bound

    Hi !
    I've a application deployed with JBoss 4.0.2 Solaris 2.8, I've create a Oracle DS, when I try to read data from a database throw DS works fine, but when I try to insert, delete or update records from database the jboss show the next error.
    2005-09-07 09:17:55,662 ERROR [org.jboss.ejb.plugins.LogInterceptor] Transaction
    RolledbackLocalException in method: public abstract int com.soluzionasf.arqw10.g
    c.cmp.OracleSequenceSessionLocal.getNextSequenceNumber(java.lang.String) throws
    javax.ejb.FinderException, causedBy:
    javax.naming.NameNotFoundException: jdbc not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionBean.getConnection
    (OracleSequenceSessionBean.java:76)
    at com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionBean.getNextSequen
    ceNumber(OracleSequenceSessionBean.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
    tatelessSessionContainer.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
    ke(CachedConnectionInterceptor.java:185)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
    elessSessionInstanceInterceptor.java:130)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(Service
    EndpointInterceptor.java:51)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
    Interceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:105)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
    torCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
    66)
    This is my DS definition
    <?xml version="1.0" encoding="UTF-8"?>
    <local-tx-datasource>
    <jndi-name>jdbc/OracleDS</jndi-name>
    <connection-url>jdbc:oracle:thin:@10.98.10.42:1532:orcl28</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>evo_adminis</user-name>
    evo_adminis1
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
    <type-mapping>Oracle9i</type-mapping>
    </local-tx-datasource>
    Who knows the solutions for my problem
    Thanks for advance

    Could be that your EJB is connected to a wrong datasource called only "jdbc"?
    Strangely you say that while reading data all works fine (so the datasource definition is ok) but only when writing data there is a NamingException.
    The stacktrace seems to report an error while getting datasource reference inside com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionLocal.getNextSequenceNumber method, the problems seems to be a bad name resource name ("jdbc" instead of java:jdbc/OracleDS or java:comp/env/jdbc/OracleDS if you use resource reference in your web.xml file). If you created this class as a CMP perhaps you misstype the right datasource name, otherwise if you code this method by yourseft you misstype the naming reference.

  • 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

  • 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 AM

    I 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
    Thanks

    Hello:
    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?

  • 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.

  • Aused by: javax.naming.NameNotFoundException: Unable to resolve 'RuntimeConfigService'. Resolved ''; remaining name 'RuntimeConfigService'

    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 17

    Can any one help me Please ...

Maybe you are looking for

  • How can we pass the entire rows of a table to a web service in a VC model ?

    Hi, On the click of the submit button, I have to pass the rows of two tables into an enterprise service. This service also takes other fields of a form as an input. How can we pass the entire rows of a table into a service ? Regards, Nitin

  • How to make my program case - in sensitive?

    Hi, Iam writing a SELECT query in report for retrieving the address number by giving address details like street, city and post code.But my program is case sensitive such that if the user inputs either in Upper Case or Lower Case, it will not work. F

  • Storage Location exclusion from MRP problem

    Hi all, I have added some Storage locations to exclude from MRP, via SPRO cust. (Production>MRP>Planning>Define st. loc. MRP per Plant) However, when I want to verify it, I go into MD04 and for a material, the excluded storage loc. lis does not show

  • Sub domains not working? help

    I recently got my server going with the dns being server.domain.ca I have domain.ca as primary zone server.domain.ca as Machine with IP 10.0.1.14 gallery.domain.ca as Machine with IP 10.0.1.14 I also have both domain.ca and server.domain.ca as a serv

  • Third party software application updated the audio driver and now have lost sound. Driver is con

    driver is conexant HD smart audio 221.  Notebook is HP pavilion dc 9999 64 bit.   I have uninstalled and reinstalled driver but no sound. I appreciate any guidance/feedback/ solution