Making dataconnection via JNDI

Hello
I am trying to connect to a MS-ACCESS database which is on the same machine as
where WebLogic is installed.
In the console I fill in the following values:
Name : Serise
JNDI Name : weblogic.jdbc.DataSource.weblogic.jdbc.odbc.Serise
Pool Name : Serise
The following error occurs when my EJB is deployed:
<6-aug-01 9:44:05 GMT+02:00> <Error> <J2EE> <Error deploying EJB Component : employee
weblogic.ejb20.EJBDeploymentException: Error Deploying CMP EJB:; nested exception
is:
weblogic.ejb20.cmp.rdbms.RDBMSException: Could not access table 'employee'.
I can't see what I have down wrong, the names are the same in the xml files going
with the EJB.
Any Help !?
Melle

Make sure that the table employee exists in DB.
-- Prasad
"melle" <[email protected]> wrote in message
news:3b6e5105$[email protected]..
>
Hello
I am trying to connect to a MS-ACCESS database which is on the samemachine as
where WebLogic is installed.
In the console I fill in the following values:
Name : Serise
JNDI Name : weblogic.jdbc.DataSource.weblogic.jdbc.odbc.Serise
Pool Name : Serise
The following error occurs when my EJB is deployed:
<6-aug-01 9:44:05 GMT+02:00> <Error> <J2EE> <Error deploying EJB Component: employee
>
weblogic.ejb20.EJBDeploymentException: Error Deploying CMP EJB:; nestedexception
is:
weblogic.ejb20.cmp.rdbms.RDBMSException: Could not access table'employee'.
>
I can't see what I have down wrong, the names are the same in the xmlfiles going
with the EJB.
Any Help !?
Melle

Similar Messages

  • SJSAS 9.1 does not expose EJB 3.0 remote Interface via JNDI

    I have successfully deployed a simple Stateful EJB 3.0 bean (CartBean, like the one in the Java EE 5 tutorial remote interface Cart) on SJSAS 9.1, located on machine host1.
    After I deployed the CartBean, I browsed the SJSAS and noticed the existence of the following JNDI entries:
    ejb/Cart
    ejb/Cart__3_x_Internal_RemoteBusinessHome__
    ejb/Cart#main.Cart
    ejb/mgmt
    ejb/myOtherEJB_2_x_bean ( +myOtherEJB_2_x_bean+ is a different 2.x bean that I have deployed as well)So, I am trying to access the remote interface of the CartBean from a remote machine, host2. The client application is a Java-standalone client.
    I am using the Interoperable Naming Service syntax: corbaname:iiop:host1:3700#<JNDI name>
    The problem is that the remote interface of the bean does NOT seem to be available via JNDI. I get the javax.naming.NameNotFoundException when I try to do a lookup like:
    corbaname:iiop:host1:3700#ejb/Cart
    On the other hand, the following lookups succeed:
    corbaname:iiop:host1:3700#ejb/mgmt
    corbaname:iiop:host1:3700#myOtherEJB_2_x_bean
    and also the following succeeds:
    corbaname:iiop:host1:3700#ejb/Cart__3_x_Internal_RemoteBusinessHome__So it seems like the Remote interface is not available via JNDI, rather only some internal SJSAS implementation (the object returned from the ejb/Cart__3_x_Internal_RemoteBusinessHome__ lookup is of type: com.sun.corba.se.impl.corba.CORBAObjectImpl
    Why is this happening? I know there used to be a bug in Glassfish, but I thought it had been fixed since 2006.
    Many thanks in advance, any help would be greatly appreciated.

    The EJB 3.0 Remote Business references are not directly stored in CosNaming. EJB 3.0 Remote references do not have the cross-vendor interoperability requirements that the EJB 2.x Remote view had.
    You can still access Remote EJB references from a different JVM as long as the client has access to SJSAS naming provider. Please see our EJB FAQ for more details :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • EJB called via JNDI in a Repository Service :: ClassCastException

    Hi SDN,
    I've got a problem in calling an EJB from a Repository Service...
    Here the steps I've follow:
      -  An EJB has been created with some Business Methods in it; it has been packaged in an EAR and deployed;
      -  This EJB is looked up succesfully via JNDI in a WDJ application and also in an Abstract Portal Component; I use the following guides:
    [Accessing EJB Apps using JNDI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010- 9ea4-c63d83d0797b?QuickLink=index&overridelayout=true]
    [Referencing an EJB in an Abstract Portal Component|http://wiki.sdn.sap.com/wiki/display/HOME/ConnectingEJBUsing ExternalJars]
      -  A Repository Service has been created and registered on "CREATE_CHILD_TEMPLATE" ResourceEvent; I can see from logs that this service works correctly;
       -  I've copied in the PAR lib and private/lib folders two jars (ejb20.jar and the JAR created building the EJB) and they are added to the build path;
      -  If I try to look up the EJB via JNDI in the received service method, I get a ClassCastException...
    Here some code:
    try {
         //I use System.err to see log in the Default Trace
         System.err.println("Initialize EJB");
         //TestJNDIHome class seems to be visible at runtime, following instruction does not throw any exception
         System.err.println("ToString TestJNDIHome: " + TestJNDIHome.class.toString());
         //EJB and PAR are on the same J2EE engine, so no InitialContext parameters, I'm right?
         InitialContext context = new InitialContext();
         Object jndiobj = context.lookup("altevie.com/testear/TestJNDIBean");
         System.err.println("Classe oggetto recuperato da lookup: " + jndiobj.getClass());
         TestJNDIHome home = (TestJNDIHome) javax.rmi.PortableRemoteObject.narrow(jndiobj, TestJNDIHome.class);
         testJNDI = home.create();
    } catch (NamingException ex) {
         System.err.println("NamingException :: " + ex.getLocalizedMessage());
    } catch (RemoteException ex) {
         System.err.println("RemoteException :: " + ex.getLocalizedMessage());
    } catch (CreateException ex) {
         System.err.println("CreateException :: " + ex.getLocalizedMessage());          
    Here the portalapp.xml (in the same PAR there are two objects, the Repository Service and an Abstract Portal Component, but I've got the same problem also removing the Abstract Portal Component...):
    <application>
      <application-config>
        <property name="com.sap.engine.interfaces.cross.ObjectReferenceImpl" value="SAPJ2EE::altevie.com/testEAR"/>
        <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
        <property name="PrivateSharingReference" value="SAPJ2EE::altevie.com/testEAR"/>
      </application-config>
      <components>
        <component name="TestJSP">
          <component-config>
            <property name="ClassName" value="com.comer.eps.epcomp.TestJSP"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services>
        <service name="RFServiceWrapper">
          <service-config>
            <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    javax.rmi.PortableRemoteObject.narrow method call throws a ClassCastException...
    From the previous println I can see the lookup method returns a com.sap.engine.interfaces.cross.ObjectReferenceImpl object, I do not know if it is correct...
    I've tried to lookup the Local (localejbs/altevie.com/testear/TestJNDIBean) and Remote (altevie.com/testear/TestJNDIBean) JNDI Bean name, but I get the same error...
    I'm sure the JNDI name is correct (it works with WDJ and Abstract Portal Component... I've also tested via LOOKUP command using telnet to connect to J2EE AS and I've checked JNDI Registry and EJB Container services in Visual Admin)...
    Here the stack trace of the error:
    java.lang.ClassCastException: com.comer.eps.ejb.AccessiEJBHome
         at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:179)
         at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.comer.eps.repsrv.onsave.RipubblicaByDE.initializeEJB(RipubblicaByDE.java:145)
    Can you help me? Why JNDI lookup works in an Abstract Portal Application and doesn't in a Repository Service (same code...)?
    Thank you so much and best regards,
    Manuel
    Text Formatted: Manuel Xiccato on Sep 27, 2011 12:29 PM

    Hi SDN,
    I've got a problem in calling an EJB from a Repository Service...
    Here the steps I've follow:
      -  An EJB has been created with some Business Methods in it; it has been packaged in an EAR and deployed;
      -  This EJB is looked up succesfully via JNDI in a WDJ application and also in an Abstract Portal Component; I use the following guides:
    [Accessing EJB Apps using JNDI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010- 9ea4-c63d83d0797b?QuickLink=index&overridelayout=true]
    [Referencing an EJB in an Abstract Portal Component|http://wiki.sdn.sap.com/wiki/display/HOME/ConnectingEJBUsing ExternalJars]
      -  A Repository Service has been created and registered on "CREATE_CHILD_TEMPLATE" ResourceEvent; I can see from logs that this service works correctly;
       -  I've copied in the PAR lib and private/lib folders two jars (ejb20.jar and the JAR created building the EJB) and they are added to the build path;
      -  If I try to look up the EJB via JNDI in the received service method, I get a ClassCastException...
    Here some code:
    try {
         //I use System.err to see log in the Default Trace
         System.err.println("Initialize EJB");
         //TestJNDIHome class seems to be visible at runtime, following instruction does not throw any exception
         System.err.println("ToString TestJNDIHome: " + TestJNDIHome.class.toString());
         //EJB and PAR are on the same J2EE engine, so no InitialContext parameters, I'm right?
         InitialContext context = new InitialContext();
         Object jndiobj = context.lookup("altevie.com/testear/TestJNDIBean");
         System.err.println("Classe oggetto recuperato da lookup: " + jndiobj.getClass());
         TestJNDIHome home = (TestJNDIHome) javax.rmi.PortableRemoteObject.narrow(jndiobj, TestJNDIHome.class);
         testJNDI = home.create();
    } catch (NamingException ex) {
         System.err.println("NamingException :: " + ex.getLocalizedMessage());
    } catch (RemoteException ex) {
         System.err.println("RemoteException :: " + ex.getLocalizedMessage());
    } catch (CreateException ex) {
         System.err.println("CreateException :: " + ex.getLocalizedMessage());          
    Here the portalapp.xml (in the same PAR there are two objects, the Repository Service and an Abstract Portal Component, but I've got the same problem also removing the Abstract Portal Component...):
    <application>
      <application-config>
        <property name="com.sap.engine.interfaces.cross.ObjectReferenceImpl" value="SAPJ2EE::altevie.com/testEAR"/>
        <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
        <property name="PrivateSharingReference" value="SAPJ2EE::altevie.com/testEAR"/>
      </application-config>
      <components>
        <component name="TestJSP">
          <component-config>
            <property name="ClassName" value="com.comer.eps.epcomp.TestJSP"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services>
        <service name="RFServiceWrapper">
          <service-config>
            <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    javax.rmi.PortableRemoteObject.narrow method call throws a ClassCastException...
    From the previous println I can see the lookup method returns a com.sap.engine.interfaces.cross.ObjectReferenceImpl object, I do not know if it is correct...
    I've tried to lookup the Local (localejbs/altevie.com/testear/TestJNDIBean) and Remote (altevie.com/testear/TestJNDIBean) JNDI Bean name, but I get the same error...
    I'm sure the JNDI name is correct (it works with WDJ and Abstract Portal Component... I've also tested via LOOKUP command using telnet to connect to J2EE AS and I've checked JNDI Registry and EJB Container services in Visual Admin)...
    Here the stack trace of the error:
    java.lang.ClassCastException: com.comer.eps.ejb.AccessiEJBHome
         at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:179)
         at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.comer.eps.repsrv.onsave.RipubblicaByDE.initializeEJB(RipubblicaByDE.java:145)
    Can you help me? Why JNDI lookup works in an Abstract Portal Application and doesn't in a Repository Service (same code...)?
    Thank you so much and best regards,
    Manuel
    Text Formatted: Manuel Xiccato on Sep 27, 2011 12:29 PM

  • How can I persist a Java object to the PCD via JNDI ?

    Hi,
    I'm trying to persist XML data on the PCD via JNDI. I'm using
    portal version 6.2.0.4.200408172051.
    I followed the instructions in the "Portal Runtime Technology 640"
    document.
    The example they showed was:
    import javax.naming.Context;
    Context context = PortalRegistry.getCentralConfigurationContext();
    Context applicationContext = context.lookup("MyAppName");
    It was possible to obtain 'applicationContext' in the above example by
    using:-
    Context context = PortalRegistry.getCentralConfigurationContext();
    String appName = request.getComponentContext().getApplicationName();
    Context applicationContext = (Context) context.lookup(appName);
    However, any attempt to bind, rebind an object (implementing IStreamSource)
    resulted in NamingExcptions. As did 'listBindings' and 'list' (see below).
    BeanWrapper d = new BeanWrapper("test input");
    applicationContext.rebind("PCD_LOOKUP_KEY", d);
    // where 'd' implements IStreamSource
    class BeanWrapper implements IStreamSource {
    String content = "balh";
    BeanWrapper(String s) {
    content = s;
    public InputStream getInputStream() throws IOException {
    ByteArrayInputStream bis = new ByteArrayInputStream(content.getBytes());
    return bis;
    } // getInputStream
    } // BeanWrapper
    I don't know what I've done wrong. I couldn't find any more documentation
    on this topic...
    Any help would be appreciated.
    cheers,
    Michael
    javax.naming.NameNotFoundException: [Xfs] Object not found. Root exception is javax.naming.NamingException: [Xfs] Object not found
    at com.sapportals.portal.pcd.gl.xfs.BasicContext.lookup(BasicContext.java:840)
    at com.sapportals.portal.pcd.gl.PcdPersContext.lookup(PcdPersContext.java:422)
    at com.sapportals.portal.pcd.gl.PcdFilterContext.filterLookup(PcdFilterContext.java:387)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1083)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.proxyLookupLink(PcdProxyContext.java:1170)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.proxyLookup(PcdProxyContext.java:1132)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.getBasicObject(PcdProxyContext.java:1330)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.getBasicContext(PcdProxyContext.java:1306)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:473)
    at com.sapportals.portal.pcd.gl.PcdGlContext.rebind(PcdGlContext.java:1185)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:515)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:683)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:688)
    at com.sapportals.portal.prt.jndisupport.util.AbstractContextWrapper.rebind(AbstractContextWrapper.java:46)
    at com.siemens.pct.employee.cu_selector.CUSelector.saveCuBeanToPCD(CUSelector.java:305)
    at com.siemens.pct.employee.cu_selector.CUSelectorUpload.doUpload(CUSelectorUpload.java:70)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.handleRequestEvent(AbstractPortalComponent.java:700)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.handleEvent(AbstractPortalComponent.java:412)
    at com.sapportals.portal.prt.pom.ComponentNode.handleEvent(ComponentNode.java:250)
    at com.sapportals.portal.prt.pom.PortalNode.fireEventOnNode(PortalNode.java:333)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:627)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
    at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)
    at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)
    at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)
    at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
    at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
    at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
    at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)
    at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

    Hi Michael,
    here my comments to your questions:
    0.:[Michael says:]
    "So basically you're saying that under SP10 its not possible to store objects on the PCD ... ?"
    I want to clarify this:
    It is possible to store objects in the PCD in lower releases than SP10 (e.g. SP2). But due to the fact that PCD API is not public before SP10 you should not develop a SP2 iView that programmatically uses the PCD API and complain afterwards because some "tiny" things of it are not working in SP10. It might be that you have to adjust some parts of this SP2 iView.
    The kind of object that can be stored in the PCD depends on the fact if the objects have a corresponding object provider or not. If you want to store iViews, roles or one of the other commonly known portal objects you can do it because corresponding object provider (iViewservice, roleservice, etc.) are always available in a running portal.
    If you want to store objects (like your BeanWrapper class) then you should write a corresponding object provider (what I explained in my first reply).
    1.:[Michael asked:]
    Why does list and listBindings fail ? surely that should just
    list the existing bound objects ???
    Nothing was bound!
    Your code line
    applicationContext.rebind("PCD_LOOKUP_KEY", d);
    throws a NamingException because no object provider for class of object d was found.
    So I gess you did a lookup on  applicationContext.lookup( "PCD_LOOKUP_KEY" ) before you did the list/listBindings and because this
    context does not exist the corresponding "Name not found" exception was thrown?
    A list/listBinding on the applicationContext itself should work even if nothing was bound.
    2.:[Michael asked:]
    Is there not some kind of default object/object provider pair
    that can be used to store base types like Strings/Integers etc ?
    No. There are no default object providers for java string/integers. But for this case "persisting a string or integer value at any PCD context" the PCD offers another way to do it: Just create an additional attribute (of type STRING or INT) and persist the corresponding value in this attribute (of type IPcdAttribute - an extension of javax.naming.directory.Attribute )   
    The code for creating a pcd attribute looks e.g. like this:
    IPcdObjectFactory pcdObjFactory = ((IPcdGlService) PortalRuntime
                                                   .getRuntimeResources()
                                                   .getService(IPcdGlService.KEY))
                                                   .getPcdObjectFactory();
    IPcdAttribute newPcdAttr = pcdObjFactory.createPcdAttribute(     PcdAttributeValueType.STRING,
                                            "new_attrId" );     
    newPcdAttr.set(     0,
              "new_AttrValue" );
    ModificationItem mods[] = new ModificationItem[1];
    mods[0] = new ModificationItem(      DirContext.REPLACE_ATTRIBUTE,
                               (Attribute)newPcdAttr );
    pcdCtx.modifyAttributes(     "",
                        mods );
    Hope, that helps you!
    Regards,
    Jens

  • Searching iPlanet Users via JNDI

    This is probably more an iPlanet Directory Server question but since it is also a Sun product, I thought I try here first.
    I have an application that searches an iPlanet 5.1 directory service via JNDI. The directory server has 10,000 users in a single context. When I search for "objectclass=person" with a limit of 1000, I get a strange result. I get 1000 users distributed randomly from A to Z! This is the problem. I do not get the first 1000 users starting from A as I would expect. I therefore don't know how to ask for the next 1000 users since the result it randomly distributed across all 10000 users from A to Z.
    Is there a way to control the iPlanet Directory Server so that it gives me a linear result set starting from the first user in the context through the next 1000 users alphabetically.
    I know I can use ranges (&(sn>=A)(sn<=C)) to control it somewhat, but if that range has more than 1000 users it too is randomly distributed from A to C.
    What I am looking for is a way to have the iPlanet server return linear result sets not randomly distributed results sets.
    Can you help?
    Thanks,
    -- Peter Desaulniers

    No need to reply to this thread, instead please refer to the "Controlling iPlanet search ordering via JNDI" thread if you have some information.

  • EJB lookup via JNDI results in java.lang.NoClassDefFoundError

    Hello,
    I have created and deployed an EJB to the WebAS (ver 6.40).  There is no problem looking up the bean via JNDI and calling its methods from a J2EE application - I successfully did this via a servlet.
    However, a JNDI lookup from a Web Dynpro application - on the same server - results in a java.lang.NoClassDefFoundError error.
    The code for the JNDI lookup is identical in either case.
    Any thoughts?

    Hello,
    I am calling ejb from .jsp use following code
    Properties props = new Properties();
    InitialContext ctx = new InitialContext();
    Object ob = ctx.lookup("java:comp/env/ejb/CalculatorBean");
    CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
    calc = home.create();
    I have a error:
    java.lang.ClassNotFoundException: class com.sap.examples.calculator.beans.CalcProxy : com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at calculator, the whole lookup name is java:comp/env/ejb/CalculatorBean
    My ejb-jar.xml is:
    <display-name>
         CalculatorEjb</display-name>
         <enterprise-beans>
              <session>
                   <icon/>
                   <ejb-name>Calculator</ejb-name>
                   <home>com.sap.examples.calculator.CalculatorHome</home>
                   <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                   <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                   <local>com.sap.examples.calculator.CalculatorLocal</local>
                   <service-endpoint>com.sap.examples.calculator.CalculatorServiceEndpoint</service-endpoint>
                   <ejb-class>com.sap.examples.calculator.CalculatorBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <home>com.sap.examples.calculator.CalculatorHome</home>
                        <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-ref>
                   <ejb-local-ref>
                        <description/>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                        <local>com.sap.examples.calculator.CalculatorLocal</local>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-local-ref>
              </session>
         </enterprise-beans>
    my ejb-j2ee-engine.xml is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-j2ee-engine
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ejb-j2ee-engine.xsd">
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>Calculator</ejb-name>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-ref>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-local-ref>
              </enterprise-bean>
         </enterprise-beans>
    </ejb-j2ee-engine>

  • Connector access via JNDI?

    I have a project on java.net - https://lucenerar.dev.java.net/ if you're interested - and I have a client class meant to hide all the JNDI and connector plumbing from my application. However, this class needs to look up the connector via JNDI.
    This is all fine and good, but my webapp fails verification in the J2EE 1.4 RI if I have a resource-ref to a Connector factory. According to the developer's guide at http://docs.sun.com/source/819-0079/dgjndi.html I should be able to specify a resource of type javax.resource.cci.ConnectionFactory - which I do! - but this is the only cause of failure I can find.
    Note that I don't have a sun-web.xml yet, so it may be that it's trying to resolve the local name to a global name, and failing at that point. If that's the case, it's an error on my part as deployer, which I'll be glad to address - but I'd really rather know if that's actually the cause of my error, because that SHOULD be something I can configure at deploy-time rather than build time, IMO (as the connection factory's name is configured at deploy-time rather than build-time.)
    Does anyone see anything obvious that I'm doing incorrectly?

    [#|2005-01-20T19:59:00.836-0500|INFO|sun-appserver-pe8.1|javax.enterprise.system.tools.verifier|_ThreadID=24;|INFO: Look in file "/var/tmp//main-site.war20050120075858.txt" for detailed results.|#]
    [#|2005-01-20T19:59:03.214-0500|INFO|sun-appserver-pe8.1|javax.enterprise.system.tools.deployment|_ThreadID=25;|Total Deployment Time: 30206 msec, Total EJB Compiler Module Time: 0 msec, Portion spent EJB Compiling: 0%|#]
    [#|2005-01-20T19:59:03.257-0500|SEVERE|sun-appserver-pe8.1|javax.enterprise.system.tools.deployment|_ThreadID=25;|Exception occured in J2EEC Phase
    com.sun.enterprise.deployment.backend.IASDeploymentException: Some verifier tests failed for the given application. Aborting deployment. Please verify your application using the verifier separately for more details
         at com.sun.enterprise.deployment.backend.ModuleDeployer.runVerifier(ModuleDeployer.java:871)
         at com.sun.enterprise.deployment.backend.WebModuleDeployer.preRedeploy(WebModuleDeployer.java:260)
         at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:160)
         at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:146)
         at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:71)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:633)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:188)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:520)
         at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:143)
         at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:171)Looking at the text file yields:
          FAILED TESTS :
          Test Name : tests.web.WebResourceType
          Test Assertion : The resource-type element specifies the Java class type of the data source. Please refer to Java Servlet 2.4 Specification Section #SRV.13.4 for further information.
          Test Description : For [ main-site.war ]
    Error: The resource-type [ javax.resource.cci.ConnectionFactory ] element does not specify a valid Java class type for the data source within Web application [ main-site ].This is the failure that prevents deployment, that I'm trying to resolve. My suspicion is that my connection factory doesn't implement something it's supposed to, but I don't know where to look to find out what it is. SRC.13.4 sheds little light on it.

  • Accessing JMX via JNDI?

    Hi all,
    I've used JMX just a bit via custom jsps and the HttpAdapter that ships with Coherence. I would like to know how, if at all, to access the MBeans via JNDI. Running in WLS 8.1, I can access the WebLogic MBeans by looking up the MBean server via JNDI or by looking up the WLS-specific MBeanHome via JNDI. Can I do something similar with the Coherence MBeans? In my jsp, I can get the default MBeanServer via the MBeanServerFactory and then look up something like "Coherence:type=Service,*" and go from there. With JNDI, I look up "weblogic.management.server" but can't use it to look up any Coherence MBeans. Is there a different MBean server I should be looking up? Something else completely?
    Also, is there a way to use something more like strong typing? In other words, can I cast an object to something like ServiceMBean and call methods like getRequestTotalCount() on it? I know this works with WLS, but they document the interfaces. I haven't seen anything similar for Coherence.
    thanks
    john

    Hi all,
    I've used JMX just a bit via custom jsps and the HttpAdapter that ships with Coherence. I would like to know how, if at all, to access the MBeans via JNDI. Running in WLS 8.1, I can access the WebLogic MBeans by looking up the MBean server via JNDI or by looking up the WLS-specific MBeanHome via JNDI. Can I do something similar with the Coherence MBeans? In my jsp, I can get the default MBeanServer via the MBeanServerFactory and then look up something like "Coherence:type=Service,*" and go from there. With JNDI, I look up "weblogic.management.server" but can't use it to look up any Coherence MBeans. Is there a different MBean server I should be looking up? Something else completely?
    Also, is there a way to use something more like strong typing? In other words, can I cast an object to something like ServiceMBean and call methods like getRequestTotalCount() on it? I know this works with WLS, but they document the interfaces. I haven't seen anything similar for Coherence.
    thanks
    john

  • Datasource via JNDI vs Driver Manager

    I am really desperate to use Datasource for connectivity to Oracle (rather than using the driver manager) in my little J2EE app (no EJB) on IBM WSAD 5.0.
    I have some example using DB2 datasource via JNDI.
    I replaced the properties with my Oracle database parameters.
    as below
    userid=scott
    password=tiger
    url=jdbc:oracle:thin:@localhost:1521:library
    driver=oracle.jdbc.OracleDriver
    lookupName=jdbc/library
    database=library
    There is an object "DB2DataSource" coming from package COM.ibm.db2.jdbc.DB2DataSource in the example code "CreateDatasource.java" I am using to create the data source.
    I have added JNDI.jar(from oracle), Naming.jar(from WSAD home), nasmingClient.jar(from WSAD home) in to the project.
    By looking at Oracle manual we need import com.evermind.sql.DriverManagerDataSource; and
    com.evermind.server to get initialContext.
    But compiler cant find them.
    Can anyone tell me what is the equivalent in Oracle?
    Thanks
    Mei

    Hold on.
    This is what I think. There will be others here who might be able to build to this and provide you the solution.
    All that you need to do is
    1. Add the Oracle driver to the WebSphere classpath.
    2. Use the Admin Console / WSAD screens to create a JDBC Driver for the Oracle Driver.
    3. Create a datasource within this driver. There is step-by-step documentation on how to do this.
    4. Specify a JNDI name for the datasource.
    5. Lookup the DataSource and cast it to a DataSource object.
    6. Call getConnection method to get a connection.
    Your coding portion is only steps 5 and 6 above.
    Steps 1 through 4 needs to happen in the Admin Console / WSAD tool. I have done it in both the places before and it is a fairly straightforward process. You do not need any of the jars that you are mentioning below or need to do anything special.
    Vijay

  • JMS connection from SAP PI to Oracle AQ via JNDI...

    Hi,
    I am currently working on a project that requires connections between PI and Oracle AQ. It was advised that we shoule use PI JMS adpater with JNDI driver. However, it seems that not many people have tried this approach.
    Has anyone had similar solutions in production ? How repliable it is ?
    Your help is very much appreciated
    Tim

    Hi Tim,
    We implemented a similar scenario and now itu2019s still working.
    You have to configure a JNDI connection, but not directly with the Oracle AQ. The Oracle AQ are just queues, and you need a JMS provider in order to establish the connection with these queues. The solution we implemented was:
    1. Configure one OC4J server as JMS provider for the Oracle AQ queues.
    2. Configure JMS communication channels in SAP PI to establish the connection with the OC4J server.
    Maybe you can use a different and newer JMS provider, as BEA Weblogic or SAP WAS (I donu2019t know if itu2019s possible).
    We implement the scenario in SAP PI 7.0, and with this version we had a problem: When the communication between JMS adapter and the queues was broken (the DDBB fell down for example), the channel failed, itu2019s normal. But when the DDBB was already running the channel stayed in an error state, and we had to restart the channel manually. The response of SAP to this issue was that the channel behavior was correct because the connection failed.
    But this problem occurred rarely, maybe once a month. The solution is very reliable, we exchange a lot of message with this solution, and support messages of any size with an excellent performance.
    Best Regards,
    Roberto

  • Objects returned via JNDI Lookup

    All,
    I have had this nagging question in my head about JNDI lookups for some time
    now, but haven't had the time to do the proper research. The question is
    simple.
    The setup is simple as well. Suppose that we have a typical WLS setup, with
    WLS running in a JVM on a server host somewhere, with objects bound to its
    JNDI tree (we'll leave clustering out of the picture for simplicity's sake),
    and we also have a WLS client Java application. The client connects to WLS
    and performs various JNDI lookups on the server. Some of these objects
    implement java.io.Serializable, some do not.
    The question is, if the client uses JNDI to lookup an object that exsts in a
    separate JVM, and that object does not implement Serializable, how does this
    object come to be instantiated on the client?
    This leads to a second question: What exactly is getting returned from a
    JNDI lookup? A reference to an object or a copy of it? I can see that
    lookups within a single JVM would return a reference, but the cross-JVM
    lookup is less clear to me.
    Any and all help appreciated,
    -jc

    This leads to a second question: What exactly is getting returned from a
    JNDI lookup?From how I understand it, only Serializable objects are returned such as RMI
    stubs, which serve as proxies to EJB or other RMI servers registered in JNDI.
    - Thomas
    (ex-BONY too)
    Jonathan Castellani wrote:
    All,
    I have had this nagging question in my head about JNDI lookups for some time
    now, but haven't had the time to do the proper research. The question is
    simple.
    The setup is simple as well. Suppose that we have a typical WLS setup, with
    WLS running in a JVM on a server host somewhere, with objects bound to its
    JNDI tree (we'll leave clustering out of the picture for simplicity's sake),
    and we also have a WLS client Java application. The client connects to WLS
    and performs various JNDI lookups on the server. Some of these objects
    implement java.io.Serializable, some do not.
    The question is, if the client uses JNDI to lookup an object that exsts in a
    separate JVM, and that object does not implement Serializable, how does this
    object come to be instantiated on the client?
    This leads to a second question: What exactly is getting returned from a
    JNDI lookup? A reference to an object or a copy of it? I can see that
    lookups within a single JVM would return a reference, but the cross-JVM
    lookup is less clear to me.
    Any and all help appreciated,
    -jc

  • Using Java Mail in Tomcat via JNDI

    I have a web application and I want to make use of JNDI Mail Sessions for sending email in my Web Appln.
    I am using Tomcat4.0.1
    In my server.xml file I declared a resource as follows:
    <Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
    <ResourceParams name="mail/Session">
         <parameter>
         <name>mail.smtp.host</name>
         <value>mail.abc.com</value>
         </parameter>
    </ResourceParams>
    Now Inside my jsp/servlet code i can use something like this:=
    // Acquire our JavaMail session object
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    Session session = (Session) envCtx.lookup("mail/Session");
    // Prepare our mail message
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    InternetAddress dests[] = new InternetAddress[]
    { new InternetAddress(to) };
    message.setRecipients(Message.RecipientType.TO, dests);
    message.setSubject(subject);
    message.setContent(content, "text/plain");
    // Send our mail message
    Transport.send(message);
    But my smtp mail provider uses Authentication.
    So I am looking of some way wherein I can provide the user and password information in the server.xml file itself along with smtp provider.
    My Query is How to do this as i dont see any references for using JavaMail sessions using Authentication
    Any Help highly appreciated
    Thanks

    for the mail session I am getting an error like this
    ENCOUNTERED EXCEPTION: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 Unable to relay for [email protected]
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
         javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
         javax.mail.SendFailedException: 550 5.7.1 Unable to relay for [email protected]
         at javax.mail.Transport.send0(Transport.java:219)
         at javax.mail.Transport.send(Transport.java:81)
         at SendMailServlet.doPost(SendMailServlet.java:63)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Unknown Source)

  • Why can't I access JMS connection factory via JNDI?

    I'm going through the JMS tutorial and I'm trying to get the simple point-to-point example (http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client.html#1056518) to work with the JMS implementation in AS7.
    I have read the "Administration of the JMS Service" section of http://docs.sun.com/source/816-7153-10/djjms.html#18990 and I have correctly configured:
    - a javax.jms.QueueConnectionFactory under JNDI name "jms/QueueConnectionFactory"
    - a physical destination of resource type "queue" with name "Queue1";
    - a javax.jms.Queue destination resource under JNDI name "jms/MyQueue", with property "imqDestinationName" set to "Queue1"
    When I run SimpleQueueSender my JNDI lookup fails because there are no objects bound to the names I have tried:
    java:comp/env/jms/QueueConnectionFactory
    java:jms/QueueConnectionFactory
    java:QueueConnectionFactory
    QueueConnectionFactory
    The last line above actually returns a
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]I have done substantial searching for this issue on the Net and here on the forums but have yet to find a solution.
    Is it possible to obtain a JMS object through JNDI by invoking an RMI/IIOP-based client without using the ACC??? I am going to next try with the ACC to see if at least that is possible.
    Answers much appreciated!
    Daniel.

    May be able to help if you are on win2k or windows. If so, I had to write myself a big note
    on this one, because it is very frustrating. anyways here's the note, and to my disbelief,
    it worked. I was using an mqseries provider, but the jms context has always worked.
    BIGNOTE: when using jmsadmin for mqseries, do not define ctx(jms), then
    Chg ctx(jms) to create the JMS administered objects on windoz 2k. It is
    Required for Solaris. So on doz, instead of define qcf(boltsQCFnotjta) from
    the jms ctx, do define qcf(jms/boltsQCFnojta) from initalctx. MDB won�t find
    Q and factory unless you do it this way on doz.
    I can't remember if this is mqseries specific, or it also applies to Sun MQ. Kind of sucks
    because you have no visibilty of the properties of the queue and factory.

  • Accessing process manager via JNDI

    We are developing with Appserver 6.5, and also the the
    process manager running inside the appserver. Unfortunately our
    experience is that 6.5 is not stable enough to develop and deploy
    our app. However we do need to use the process manager.
    I'm now trying to run our application in Catalina (7.0) and use
    a JNDI reference to talk to the process manager beans in
    6.5. however the jndi lookup fails.
    javax.naming.NamingException: com.netscape.pm.model.IPMClusterManager
    I'm pretty sure I need to provide additional parameters in server.xml
    for this lookup... but cannot find -any- documentation as to what
    parameters are used.
    ideas?
    thanks
    Roy

    We are developing with Appserver 6.5, and also the the
    process manager running inside the appserver. Unfortunately our
    experience is that 6.5 is not stable enough to develop and deploy
    our app. However we do need to use the process manager.
    I'm now trying to run our application in Catalina (7.0) and use
    a JNDI reference to talk to the process manager beans in
    6.5. however the jndi lookup fails.
    javax.naming.NamingException: com.netscape.pm.model.IPMClusterManager
    I'm pretty sure I need to provide additional parameters in server.xml
    for this lookup... but cannot find -any- documentation as to what
    parameters are used.
    ideas?
    thanks
    Roy

  • Local bean access via JNDI returns a proxy object?

    Hi,
    I am using JBoss, and trying to access a local bean from another bean. One would think simple enough no, with the following code adequate:
    Context initialContext = new InitialContext();
    CartHome cartHome = (CartHome) initialContext.lookup(&#8220;java:comp/env/ejb/cart&#8221;);Which returns the home interface, right, but no in fact a $Proxy77 is returned. Can anyone tell me why this is? Or a solution please.
    Thanks in advance.
    Mike

    Thanks, it works. But do you think calling the executeQuery from a backing bean is against any ADF related coding standards? Should that call be only in Application Module? Please comment.

Maybe you are looking for

  • Nvidia 8600M GT GPU issues - please explain

    what is this exactly? well, whatever it is, someone told me this is why my MBP is in shop right now! screen went totally black lastnight with the computer running fine and normal. if this Nvidia thing is truly the problem and damaged, is this a big d

  • Problem deleting music on iOS 7

    I'm sure this question has been asked before, but i can't seem to find any information to help me. A while back I bought some music from the store which I don't want anymore and I had as a matter of fact deleted it from the iPhone, then when I update

  • Reloading iphoto library and streamlining iphoto file system.

    I had a hard-disk failure recently, and lost a lot of photos: basically all the full size files. Only the thumbnails remained on the system disk, so when I had the new drive installed, the engineer made these the iphoto library. Fortunately, I had mo

  • Site Studio Designer

    Hi, I designed a website in SiteStudio Designer.But when I try to open any of the pages in browser,it is giving error as "Page not Found".Even in the Home page,under websites,though my sitename appears,I am not able to view it.Please guide. Thanks in

  • Report Painter Program.. URGENT

    Hi All, Can you guys send me a sample program on Report Painter??? Its very urgent.. Regards, Parvez.