No JNDI-Name found after implementing OpenEJB

Hello. My problem is as follows. I built up a ConnectionPool with OracleDataSource over JNDI, which was found and worked fine. Since I installed OpenEJB and created a stateful session bean, the datasource is not found anymore. I'am using Tomcat 5.5, OpenEJB 1.0.
out of my /WEB-INF/web.xml
<resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/ito</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>
<ejb-ref>
    <description>
        EJB Reference to the bean deployed to OpenEJB
    </description>
    <ejb-ref-name>dbconnection</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>de.dpits.bln.poe.ito.persistency.DBConnectionInterface</home>
    <remote>de.dpits.bln.poe.ito.persistency.DBConnectionRemote</remote>
</ejb-ref>
  <servlet>
    <servlet-name>loader</servlet-name>
    <servlet-class>org.openejb.loader.LoaderServlet</servlet-class>
    <init-param>
      <param-name>openejb.loader</param-name>
      <param-value>tomcat-webapp</param-value>
    </init-param>
    <init-param>
      <param-name>openejb.home</param-name>
      <param-value>C:/Programme/openejb1.0</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>out of the context-tag from my server.xml
<Resource
      factory="oracle.jdbc.pool.OracleDataSourceFactory"
      driverClassName="oracle.jdbc.OracleDriver"
      class="oracle.jdbc.pool.OracleDataSource"
      type="oracle.jdbc.pool.OracleDataSource"
      name="jdbc/ito"
      auth="Container"
      removeAbandoned="true"
      removeAbandonedTimeout="3"
      maxWait="5000"
      url="jdbc:oracle:thin:@localhost:1521:ITO"
      maxActive="50"
      maxIdle="0"/>
    <Ejb name="dbconnection"
    type="Session"
    home="de.dpits.bln.poe.ito.persistency.DBConnectionInterface"
    remote="de.dpits.bln.poe.ito.persistency.DBConnectionRemote"/>
    <ResourceParams name="dbconnection">
    <parameter>
        <name>factory</name>
        <value>org.openejb.client.TomcatEjbFactory</value>
    </parameter>
    <parameter>
        <name>openejb.naming.factory.initial</name>
        <value>org.openejb.client.LocalInitialContextFactory</value>
    </parameter>
    <parameter>
        <name>openejb.naming.provider.url</name>
        <value>localhost:4201</value>
    </parameter>
    <parameter>
        <name>openejb.ejb-link</name>
        <value>dbconnection</value>
    </parameter>
    </ResourceParams>out of my jsp
Context initContext = new InitialContext();
OracleDataSource ds = (OracleDataSource)initContext.lookup("Name "java:comp/env/jdbc/ito" not found. ");throws -> Name ito is not bound in this Context
as I already said, this worked before adding all the configuration for the session-bean.

OracleDataSource ds =
(OracleDataSource)initContext.lookup("Name
"java:comp/env/jdbc/ito" not found. ");Did you actually write the lookup string like this? :o

Similar Messages

  • JNDI names missing after deployement of .ear files

    I am trying to take an app that is currently in 1 ear file and split it into 2
    ear files for 2 weblogic server instances. When I split the ear and deploy, deployment
    seems to work fine but JNDI names never show up. When I deploy as one ear, all
    JNDI names show up fine. The jars and wars inside the ears are exactly the same
    build artifacts for either configuration. The original application.xml from 1
    ear is split into 2 ears appropriately.
    Any ideas?

    Try completely closing out of iBooks: from the Home screen double tap the Home button, once the multitask bar appears swipe up on the iBooks icon to close out of iBooks. Now restart the iPad and see if this might help resolve the issue.
    Alternatively instead of a restart you could perform a Reset once you close iBooks.
    Reset: hold down the Home and Sleep/Wake button at the same time for ~10sec, ignore the Slide to Power Off, the iPad will then Reset, Note: No data is lost during a Reset.

  • Error! No data source found with name 'mynewdsname' (after asking 0 providers)

    Hi all,
    I am trying out the instructions given below.
    http://dev.day.com/docs/en/cq/current/developing/jdbc.html
    I followed them exactly but removed <cq:include script="head.jsp"/> line from the jsp since I do not have a head.jsp.
    my config node settings are as follows.
    But when I go to the page, I get below error message.
    error! No data source found with name 'mynewdsname' (after asking 0 providers)
    DB is up and running. I could not find any issue with it. Code is as follows.
    <%DataSourcePool dspService = sling.getService(DataSourcePool.class);
      try {
         DataSource ds = (DataSource) dspService.getDataSource("mynewdsname");  
    %>
    Any help will be great. TX

    Document is outdated & for now could you please follow http://dev.day.com/content/kb/home/cq5/Development/HowToConfigureSlingDatasource.html

  • Jndi name conflict found in

    I have received a naming conflict when starting up App Server 7.
    I am using the Sun Studio Enterprise.
    The abstract schema name for the entity bean is Billercenter and everywhere else that the bean is referenced is billerCenter.
    I am thinking that the server is complaining about the name not matching in the application module, but it won't let me change out the name. The following error is from the server.log. Anyone know what the fix is?
    [12/May/2004:16:59:13] SEVERE ( 4516): EJB5090: Exception in creating EJB container [javax.naming.NameAlreadyBoundException [Root exception is org.omg.CosNaming.NamingContextPackage.AlreadyBound: IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0]]
    [12/May/2004:16:59:13] SEVERE ( 4516): appId=billerCenter_EJBModule moduleName=billerCenter_EJBModule ejbName=billerCenter
    [12/May/2004:16:59:13] SEVERE ( 4516): LDR5012: Jndi name conflict found in [billerCenter_EJBModule]. Jndi name [ejb/Billercenter] for bean [billerCenter] is already in use.
    [12/May/2004:16:59:13] SEVERE ( 4516): LDR5013: Naming exception while creating EJB container:
    javax.naming.NameAlreadyBoundException. Root exception is org.omg.CosNaming.NamingContextPackage.AlreadyBound: IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0
    at org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read(AlreadyBoundHelper.java:60)
    at org.omg.CosNaming._NamingContextExtStub.bind(_NamingContextExtStub.java:222)
    at com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:552)
    at com.sun.jndi.cosnaming.CNCtx.bind(CNCtx.java:588)
    at javax.naming.InitialContext.bind(InitialContext.java:359)
    at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:204)
    at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:168)
    at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:409)
    at com.sun.ejb.containers.EntityContainer.initializeHome(EntityContainer.java:355)
    at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:230)
    at com.iplanet.ias.server.AbstractLoader.loadEjbs(AbstractLoader.java:345)
    at com.iplanet.ias.server.EJBModuleLoader.load(EJBModuleLoader.java:79)
    at com.iplanet.ias.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:194)
    at com.iplanet.ias.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:166)
    at com.iplanet.ias.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:297)
    at com.iplanet.ias.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:464)
    at com.iplanet.ias.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:451)
    at com.iplanet.ias.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:294)
    at com.iplanet.ias.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:99)
    at com.iplanet.ias.admin.server.core.channel.AdminChannelServer.sendNotification(AdminChannelServer.java:84)
    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:324)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:536)
    [12/May/2004:16:59:13] WARNING ( 4516): CORE5020: Error while loading ejb module
    [12/May/2004:16:59:13] WARNING ( 4516): ADM5603:Event listener error [Error while loading EJB module [billerCenter_EJBModule]. Please refer to the server log for more details. ]

    12/May/2004:16:59:13] SEVERE ( 4516): LDR5012: Jndi name conflict found in [billerCenter_EJBModule]. Jndi name [ejb/Billercenter] for bean [billerCenter] is already in use.
    If you look at your deployment descriptor which should be ejb-jar.xml you s hould have more than 1 jndi entries which are identical for more than 1 ejbs ..

  • MySQL data source/JNDI name not found

    Hi,
    I created a JDBC data source (MySQLDS) and a connection pool through AppServer 7's Admin Console but my local entity bean couldn't find it. It thrown a NameNotFoundException. I have the following descriptor in the sun-ejb-jar.xml
    <ejb>
    <ejb-name>ServiceCatalogBean1</ejb-name>
    <jndi-name>ejb/ServiceCatalogBean1</jndi-name>
    <resource-ref>
    <res-ref-name>jdbc/MapServiceDS</res-ref-name>
    <jndi-name>MySQLDS</jndi-name>
    </resource-ref>
    </ejb>
    Any advice will be highly appreciated.
    thanks in advance
    Frank
    More info, I m using JDBC driver of mm.mysql-2.0.4 and have no problem running with WebLogic 7

    Hi,
    Can you post the relevant <jdbc-resource> element in server.xml? Also, your res-ref in ejb xml?
    Thanks.
    -Tuan.

  • A prefix can be included in the EJB JNDI name dynamically?

    In the Stateless annotation, we can specify the mappedName attribute to the EJB JNDI name bind.
    Can we specify a prefix to the mappedName separately?
    For example: We have this:
    @Stateless(mappedName="myEJB")And don't want to do this:
    @Stateless(mappedName="prefix/myEJB")We want to include the prefix in another place in the code dynamically.
    Can we do that??

    jtahlborn wrote:
    eudesf wrote:
    Hello! Thanks for reply!
    As I can't configure programatically, there is any way to configure in an application descriptor, or in another place of the application server?
    The idea is to publish two applications that use the same EJB classes, but in different JNDI namespaces, because we don't want to share the resources. Otherwise, it will result in JNDI name conflicts. The applications works in different contexts and we want to reuse the existing EJB definitions.
    Any suggestion?yes you can do this. ejb 3.0 keeps the features from 2.1, namely all the xml based configuration (although it is now optional). and, the annotations are always overriden by the xml configuration. thus, you can create different deployments with different the same compiled class files. you just need to override the annotation configuration with xml configuration (via ejb-jar.xml or whatever).Yes, we can do that. I've tested here, and it works. But, can we do better?
    The configuration via XML implies maintenance, and it's not good, because we have so many EJBs to maintain.
    And there is another problem... The EJB classes are in JARs, and these JARs are shared across the applications.
    Pretend that you have to maintain two versions of each EJB JAR. One with XML configured and other without. If we change one, the another must be changed too. How can it be productive?
    I have seen some EJB implementations that are more flexible with JNDI naming.
    See:
    - [http://openejb.apache.org/jndi-names.html|http://openejb.apache.org/jndi-names.html]
    - [http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html|http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html]
    Does it have a better solution in Glassfish?

  • Problem in setting up jndi name in servlet

    hi,
    I am using netbeans6.8, glassfishv3 with mysql5.1. I set up a new jdbc Resource & connection pool by using the glassifsh admin console, and associated the connection pool with jdbc resource
    when i ping the status of the connection pool , it is success.
    Following is the lines added from my config.xml file in glassfish domain
    <jdbc-resource pool-name="knockknock_poool" description="For connecting with knockknock for testing" jndi-name="jdbc/knockknock" />
    <jdbc-connection-pool datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" max-pool-size="250" res-type="javax.sql.DataSource" steady-pool-size="32" description="pool for contains connection to connect with knockknock" name="knockknock_poool" non-transactional-connections="true" ping="true">
    <property description="jdbcname" name="URL" value="jdbc:mysql://localhost:3306/knockknock" />
    <property description="knockknock" name="databaseName" value="knockknock" />
    <property description="knockknock" name="datasourceName" value="knockknock" />
    <property description="tcp" name="networkProtocol" value="tcp" />
    <property description="admin" name="password" value="admin" />
    <property description="3306" name="portNumber" value="3306" />
    <property description="localhost" name="serverName" value="192.168.2.36" />
    <property description="root" name="user" value="root" />
    </jdbc-connection-pool>
    My DB name is knockknock & jndi name of datasource is jdbc/knockknock and ping status is true
    when i try to make a datasource lookup from my servlet i am getting the following exception
    javax.naming.NamingException: Lookup failed for 'jdbc/knockknock' in SerialContext [Root exception is javax.naming.NameNotFoundException: knockknock not found]
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at knockingvideopackage.NewRegistration.init(NewRegistration.java:50)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1073)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.naming.NameNotFoundException: knockknock not found
    at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:197)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:168)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
    at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:58)
    at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:101)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
    ... 28 more
    and my servlet code is
    @Override
    public void init(ServletConfig config)
    try {
    InitialContext ctx = new InitialContext();
    // ctx.bind("java:comp/env/jdbc/knockknock", ctx);
    if(ctx == null )
    try {
    throw new Exception("Boom - No Context");
    } catch (Exception ex) {
    Logger.getLogger(NewRegistration.class.getName()).log(Level.SEVERE, null, ex);
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/knockknock");
    try {
    con = ds.getConnection();
    } catch (SQLException ex) {
    Logger.getLogger(NewRegistration.class.getName()).log(Level.SEVERE, null, ex);
    } catch (NamingException ex) {
    Logger.getLogger(NewRegistration.class.getName()).log(Level.SEVERE, null, ex);
    i believe that what i am doing is correct from this document of mysql
    http://dev.mysql.com/doc/refman/5.1/en/connector-j-usagenotes-j2ee.html
    But i cannot understand what is the problem. any help is appreciated
    thanks

    Hello there.
    Here's the ServiceLocator and delegates I am using....
    // LoginDelegate.as
    package com.myproj.products.business {
         import com.myproj.products.vo.LoginVO;
         import mx.rpc.IResponder;
         import com.adobe.cairngorm.business.ServiceLocator;
         public class LoginDelegate {
              // anything that implements the IResponder interface can act as a responder
              private var responder:IResponder;
              private var service:Object;
              public function LoginDelegate(responder:IResponder) {
                   this.responder = responder;
                   this.service = ServiceLocator.getInstance().getRemoteObject("loginService");
              public function login(loginAttempt:LoginVO):void {
                   // Call the method of service that resides on server
                   var call:Object = service.login(loginAttempt);
                   // Send the response to responder
                   call.addResponder(responder);
    // com/myproj/products/business/Services.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <cairngorm:ServiceLocator
         xmlns:mx="http://www.adobe.com/2006/mxml"
            xmlns:cairngorm="com.adobe.cairngorm.business.*">
         <!-- Login Service -->
         <mx:RemoteObject
              id="loginService"
              destination="zend"
              source="LoginService"
              showBusyCursor="true">
              <mx:method name="doLogin" />
         </mx:RemoteObject>
    </cairngorm:ServiceLocator>
    With kind regards
    ShiVik

  • JNDI - rebind required after server restart

    We are using a third party JMS Provider (we have to use this provider implementation as opposed to WLS Provider), which requires a JNDI implementation. We can use the Sun File JNDI implementation, but seeing as WLS is in the environment, binding the JNDI names into WLS seemed the natural thing to do. This works great, except that we have to bind after each server start up (as the WLS JNDI naming is not persistent across server restart).
    I was wondering if anyone had any 'neat' tricks or ideas around this, aside from startup class.

    JMS has a ForeignJMSProvider config option to do this I believe. 9.0 will also support this more generally.

  • Deploytool: Can't specify a JNDI name for RA

    Using j2eesdk1.4_beta2, it appears there is no way to specify a JNDI name for a Resource Adapter. Is there a default name I can use to look up my RA if I don't specify a name? The Deploy Tool help describes some tabbed panes appear to be missing from the appication. Is there a way to work around this problem until the final release comes out?

    Headache!... That's what is expecting you in the DeployTool.
    The deploytool generates invalid deployment descriptors for Resource Adaptors.
    As you mentioned, it doesn't allow you to select a ResourceAdaptor implementation. In my case, I'm using my own Connection and ConnectionFactory and it didn't allow me to choose an implementation class for either interface neither.
    I solved these problems by downloading XMLSpy and using the XML Schema to fill-in the gaps in the ra.xml descriptor. There I had also to include other mandatory elements that where not written by the deployTool, like: <display-name>
    <vendor-name>
    <eis-type>
    <resourceadapter-version>
    Regarding to the <<null>> error, it has to deal with an invalid sun-ra.xml. It's either empty or it's missing a mandatory element. I used again XML Spy here to give a JNDI to my adaptor.
    I thought I was through it but I still can't deploy on the server. When I try, I get the following error:
    <[INFO][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:22:351 CET][ADM5604:Processing config change [Domain:add to xpath=/domain/applications
    childXPath = /domain/applications/connector-module[@name='SimpleRAR1']]]>
    <[INFO][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:23:302 CET][ADM1041:Sent the event to instance:[ModuleDeployEvent -- deploy connector/SimpleRAR1]]>
    org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    [.... 200 lines stack trace ....]
    <[WARNING][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:24:043 CET][ADM5603:Event listener error [null]]>
    So far I haven't found a way to get solve this one. The <NAMESPACE_ERR> makes me think about the infamous 'locale' error of the deploytool, but I included the JVM parameters [USER_LANG=en,USER_REGION=US,USER_COUNTRY=US] in the server startup and it didn't change anything.
    If you get further than that, please let me know.
    -regards,
    Gerard.

  • Crystal Reports XI and Sun One 6.1 web server SP 5 Error finding JNDI name

    I am trying to create a Crystal Reports XI report in a JSP using Sun One 6.1 Web server sp 5.
    At this point I am getting the error �Error finding JNDI name� on Sun One
    The application will run on Netbeans/Tomcat
    I have done the following:
    I edited CRConfig.xml
    <?xml version="1.0" encoding="utf-8"?>
    <CrystalReportEngine-configuration>

    <DataDriverCommon>
         <JavaDir>C:\Program Files\Java\j2re1.4.2_10\bin</JavaDir>
    <Classpath>C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;�</Classpath>

    <JDBC>
         <CacheRowSetSize>100</CacheRowSetSize>
         <JDBCURL>jdbc:oracle:thin:@10.10.10.10:1521:dev</JDBCURL>
         <JDBCClassName>oracle.jdbc.driver.OracleDriver</JDBCClassName>
         <JDBCUserName>lab_ro</JDBCUserName>
         <JNDIURL></JNDIURL>

    </JDBC>
    I created a report using JDBC (JNDI) connection and have the JNDI Connection set to the name of DATA.
    The report works just fine in Crystal Reports.
    Then in Netbeans I created an application and it runs in the Tomcat part of Netbeans
    In context.xml I have:
    <Context path="/BOEnterpriseTest3">
    <Resource name="jdbc/dev" auth="Container" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev"
    username="theuserid" password="thepassword" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>
    In web.xml I have
    <web-app>
    <context-param>
    <param-name>crystal_image_uri</param-name>
    <param-value>crystalreportviewers11</param-value>
    </context-param>

    <taglib>
    <taglib-uri>/crystal-tags-reportviewer.tld</taglib-uri>
    <taglib-location>/WEB-INF/crystal-tags-reportviewer.tld</taglib-location>
    </taglib>
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.10.10:1521:dev</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.10.10:1521:dev</description>
    <res-ref-name>Data</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    </web-app>
    in web-inf\sun-web.xml I have
    <sun-web-app>
    <resource-ref>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <jndi-name>Data</jndi-name>
    </resource-ref>
    </sun-web-app>
    I have copied all of Common Files\Business Objects\3.0\java\lib and Common Files\Business Objects\3.0\java\lib\external to the lib folder
    I have copied crystalreportviewers11 to the root of my web application
    I have tried to load the JNDI information and display the report
    <%@page pageEncoding="UTF-8"
    import="com.crystaldecisions.reports.reportengineinterface.*,
    com.crystaldecisions.report.web.viewer.*,
    javax.naming.*,
    javax.sql.*,
    java.sql.*"%>
    <%
    InitialContext initContext = new InitialContext();
    DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    try{
         // Look up our data source
    DataSource ds = (DataSource)initCtx.lookup("Data");
    out.println("found ds under jdbc/Data");
    catch ( NamingException e ){
    // Look up our data source
    DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    initCtx.bind("Data", ds);     
    out.println("found ds under java:com/env:jdbc/Data - bound into root initial context for Crystal to find");
    %>
    <%
    //Use the relative path to the report; the physical or full qualified URL cannot be used.
    String reportName = "useridincluded.rpt";
    //Database username and password
    String userName = "theuserid";
    String password = "thepassword";
    //check to see if the Report Source Session Variable already exist
    Object reportSource = session.getAttribute("Report1");
    // Create a new ConnectionInfos and ConnectionInfo object
    com.crystaldecisions.sdk.occa.report.data.ConnectionInfos connectionInfos = new com.crystaldecisions.sdk.occa.report.data.ConnectionInfos();
    com.crystaldecisions.sdk.occa.report.data.ConnectionInfo connectionInfo = new com.crystaldecisions.sdk.occa.report.data.ConnectionInfo();
    //Set username and password for the report's database
    connectionInfo.setUserName(userName);
    connectionInfo.setPassword(password);
    //Add object to collection
    connectionInfos.add(connectionInfo);
    //---------- Create a ReportClientDocument -------------
    com.crystaldecisions.reports.sdk.ReportClientDocument reportClientDocument = new com.crystaldecisions.reports.sdk.ReportClientDocument();
    //---------- Set the path to the location of the report soruce -------------
    //Open report.
    reportClientDocument.open(reportName, 0);
    //Get the report source
    reportSource = reportClientDocument.getReportSource();
    //---------- Create the viewer and render the report -------------
    //create the CrystalReportViewer object
    com.crystaldecisions.report.web.viewer.CrystalReportViewer crystalReportViewer = new com.crystaldecisions.report.web.viewer.CrystalReportViewer();
    //set the reportsource property of the viewer
    crystalReportViewer.setReportSource(reportSource);
    //set the DB logon into the viewer
    crystalReportViewer.setDatabaseLogonInfos(connectionInfos);
    //set viewer attributes
    crystalReportViewer.setOwnPage(true);
    crystalReportViewer.setOwnForm(true);
    crystalReportViewer.refresh();
    //set the CrystalReportViewer print mode
    //crystalReportViewer.setPrintMode(com.crystaldecisions.report.web.viewer.CrPrintMode.ACTIVEX);
    crystalReportViewer.setPrintMode(com.crystaldecisions.report.web.viewer.CrPrintMode.PDF);
    //process the report
    crystalReportViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    %>
    On the Sun One Web server
    On the Java Tab
    JDBC Connection Pools
    Pool Name = dev10g
    Class name = oracle.jdbc.pool.OracleDataSource
    User id = theuserid
    url = 10.10.10.10
    password=thepassword
    JDBC Resources
    JNDI Name=dev10g
    Pool = dev10g
    I get the error finding JNDI name � how do I tell Sun One where the JNDI is to make Crystal Reports work?

    I tried the following to test the JNDI
    I am trying to do JNDI in Sun One Web server 6.1 sp 5 but I seem to be missing an important part. I get two different errors based on the JSP code, �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance� or �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance�.
    Context.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/BOTest">
      <Resource name="jdbc/dev10g" auth="Container" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev10g"
    username="userid" password="password" maxActive="20" maxIdle="10" maxWait="-1"/>
      <Resource name="Data" auth="Container" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev10g"
    username="userid" password="password" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>Sun-one.xml:
    <sun-web-app>
    <context-root>BOTest</context-root>
    <resource-ref>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <jndi-name>jdbc/dev10g</jndi-name>
    </resource-ref>
    </sun-web-app>web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
         <welcome-file>
                index.jsp
            </welcome-file>
        </welcome-file-list>
        <resource-ref>
            <description>jdbc:oracle:thin:@10.10.10.10:1521:dev10g</description>
            <res-ref-name>jdbc/dev10g</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
        <resource-ref>
            <description>jdbc:oracle:thin:@10.10.10.10:1521:dev10g</description>
            <res-ref-name>Data</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>server.xml has:
    <RESOURCES>
    - <JDBCCONNECTIONPOOL name="dev10g" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
      <PROPERTY name="URL" value="jdbc:oracle:thin:@10.45.3.197:1521:dev10g" />
      <PROPERTY name="User" value="lab_ro" />
      <PROPERTY name="Password" value="0asphalt1" />
      </JDBCCONNECTIONPOOL>
      <JDBCRESOURCE jndiname="jdbc/dev10g" poolname="dev10g" enabled="on" />
      <JDBCRESOURCE jndiname="Data" poolname="dev10g" enabled="on" />
    - <JDBCCONNECTIONPOOL name="Data" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
      <PROPERTY name="User" value="lab_ro" />
      <PROPERTY name="URL" value="jdbc:oracle:thin:@10.45.3.197:1521:dev10g" />
      <PROPERTY name="Password" value="0asphalt1" />
      </JDBCCONNECTIONPOOL>
      <JDBCRESOURCE jndiname="jdbc/Data" poolname="Data" enabled="on" />
      <JDBCRESOURCE jndiname="dev10g" poolname="dev10g" enabled="on" />
      </RESOURCES>I am getting the following error: �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance�
    With the following code:
    <%@page
       import="java.io.*,
               javax.sql.*,
               javax.naming.*,
               java.sql.*,
               java.util.*"%>
    <%
    Context init;
    Context ctx;
    DataSource datasource;
    Connection con;
    try
    init = new InitialContext();
    Context envCtx = (Context) init.lookup("java:comp/env");
    datasource = (DataSource)  envCtx.lookup("jdbc/dev10g");
    catch(NamingException ex)
        out.print("Cannot retrieve data source: " + ex.toString(true));
        return;
    try
        con = datasource.getConnection();
    catch (Exception e)
      out.print("Cannot retrieve connection: " + e.toString());
      return;
    try
        PreparedStatement pstmt = con.prepareStatement("SELECT PROJNO FROM MATERIALSLAB.VW_ASPHALTHEADERINFO");
        ResultSet results = pstmt.executeQuery();
        while (results.next())
        out.println(results.getString(1));
    catch(Exception ex)
    out.print("Got connection, can't execute query: " + ex.toString());
    return;
    %>I get the following error: Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance
    With the following code:
    <%@page
       import="java.io.*,
               javax.sql.*,
               javax.naming.*,
               java.sql.*,
               java.util.*"%>
    <%
    Context init;
    Context ctx;
    DataSource datasource;
    Connection con;
    try
        init = new InitialContext();
        ctx = (Context) init.lookup("java:comp/env");
        datasource = (DataSource) ctx.lookup("jdbc/dev10g");
    catch(NamingException ex)
        out.print("Cannot retrieve data source: " + ex.toString(true));
        return;
    try
        con = datasource.getConnection();
    catch (Exception e)
      out.print("Cannot retrieve connection: " + e.toString());
      return;
    try
        PreparedStatement pstmt = con.prepareStatement("SELECT PROJNO FROM MATERIALSLAB.VW_ASPHALTHEADERINFO");
        ResultSet results = pstmt.executeQuery();
        while (results.next())
        out.println(results.getString(1));
    catch(Exception ex)
    out.print("Got connection, can't execute query: " + ex.toString());
    return;
    %>

  • Override JNDI names in persistence.xml and @resource annotation

    I have a Java EE 7 application that I am developing for use with both GlassFish and WildFly, but I have discovered that both application servers use a slightly different format for specifying JNDI names.
    In GlassFish the persistence.xml file references the data source jdbc/myDataSouce, but in WildFly the data source needs to be java:/jdbc/myDataSource.The same is also true for classes that are annotated with @Resource. In GlassFish the annotation for a class using JavaMail would be @Resource(name = "mail/myMailSession"), but to deploy onto WildFly this would need to be @Resource(name = "java:mail/myMailSession").
    The only solution I've got at present is using Maven to create two different releases of the EAR file, with one EAR file containing a persistence.xml file with the data source jdbc/myDataSouce for use with GlassFish, and the second EAR file containing a persistence.xml file with the data source java:/jdbc/myDataSource for use with WildFly. Unfortunately, I haven't found a solution for the @Resource annotation.
    I've taken a look at the documentation for glassfish-application.xml and glassfish-ejb-jar.xml and have tried using resource-ref to override the JNDI names but the application fails to deploy due to an error in the name.
    My question is does GlassFish provide any capability to override the JNDI names specified in the persistence.xml file and classes with the @resource annotation?
    Many Thanks
    Paul

    Have you been able to solve this? I'm attempting to understand what Web Server 7 can do with regard to Java Persistence and what elements of it require Glassfish.
    I've also spent great amounts of time in WS6.1 trying to figure out why a JNDI resource couldn't be found. The rules of thumb I've learned are:
    - Try dropping the *'java:/comp/env/* prefix; just use jdbc/pact part
    - Make sure all referrences (in web.xml and sun-web.xml) are identical with regard to that name.
    I'm hoping you're not still dealing with this (it's been two months!) but if anybody else stumbles on this, maybe it'll help them.
    Dave

  • Problem with Database JNDI Name

    I have written an entity bean & tring to deploy it with CMP 1.0
    I have already included classes12.jar in my classpath.
    (I am using Oracle database)
    I have specified driver & datasource as follows
    j2eeadmin -addJdbcDriver oracle.jdbc.driver.Driver
    j2eeadmin -addJdbcDataSource jdbc/Oracle jdbc:oracle:[email protected]:1521:listorcl
    When I tried Deployment Settings I have given following specs
    Database JNDI Name : jdbc/Oracle
    User : username
    Password : password
    When I click on Generate SQL Now or Generate Default SQL the following exception occurs .
    NameNotFoundException : Oracle__pm not found
    Note : The J2EE server & Database Server are running.
    Pl Help Me.
    Thanks In Advance

    mmm I will try to explain it better:
    1) long time ago I created my account SDN, in "kind of relationship with SAP option", I indicated "partner"  (i work for consulting company, SAP partner), and register in the form our S000... number.
    2) From there, I login SDN with my personal mail, and in my profile my data OK and like SAP partner.
    3) from a few months ago, when I try to login using my ma.il as usual, I get an error message:
    The email address does not exist.  and that I must enter you user S000 ....
    4) but when I login user our S000.. (such as SAP partner), "Ariela" data appears (who is my boss), because she is the comercial contact person with SAP, and she manage the S000 account 
    5) the history, posts, points and others are mine (Leandro Balboni);
    6) but I do not want is to change this profile, because in this way would be modifying the data responsible for the SAP account as a partner.
    7) I wonder if I can still loing SDN as before,  perhaps must not indicate "partner", but simply put the name of my company.
    8) how can I fix it?
    thanks in advance,
    best regards,
    Leandro
    Edited by: Ariela Mara Fefer on Aug 25, 2009 1:03 PM

  • JNDI name is not displayed in server console JNDI tree

    Hi. I have two objects with similar JNDI names. Object 1 has JNDI name "abc.test1". Object 2 has JNDI name "Abc.test2". Here is difference in first char size: 'a' and 'A'.
    The issue is that in JNDI tree weblogic server console displays only Object 1. To see Object 2 I can change JNDI name for this object, but I do not want to change JNDI name.
    Is there any way to see both objects without renaming Object 2?
    I use WebLogic Server 8.1 SP4.
    JNDI tree is displayed from console left panel: <domain>-<server>-<server name>-<right mouse click>-"View JNDI tree"

    Someone finally found this one (Farhan I think) - I hope you can find this link: its in this forum - just a few weeks old do a search on jndi on this forum if you don't find it.
    http://forum.java.sun.com/thread.jsp?forum=136&thread=321971&start=15&range=15&hilite=false&q=

  • WLS10.3.1 : How to overload the jndi name of a stateless EJB

    Hi,
    I am trying to overload the jndi name of a stateless bean defined in an application by using a weblogic-ejb-jar.xml descriptor file.
    This does not work.
    The ear contains a jar that have a weblogic-ejb-jar.xml file in its META-INF directory. The file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar
    xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>HelloWorldBean</ejb-name>
    <enable-call-by-reference>true</enable-call-by-reference>
    <jndi-name>TOTO</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    This is the code of my bean :
    package test;
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    @Stateless( name = "HelloWorldBean", mappedName="HWBean")
    @Local( IHelloWorldLocal.class)
    @Remote( IHelloWorldRemote.class)
    public class HelloWorldBean implements IHelloWorldLocal, IHelloWorldRemote
    public void sayHello(String name) {
    System.out.println( "Hello " + name + "!!!!");
    The bean implements the following interfaces :
    package test;
    public interface IHelloWorldRemote extends IHelloWorld {
    package test;
    public interface IHelloWorldLocal extends IHelloWorld {
    package test;
    public interface IHelloWorld {
    public void sayHello( String name);
    When i browse the JNDI tree, i see the bean registered with the mapped name attribute (HWBean#test.IHelloWorldRemote) but i don't see any bean registered with the name provided by the weblogic-ejb-jar.xml (TOTO)
    My standalone client can't perform a lookup using the JNDI name 'TOTO' but reaches the bean when using 'HWBean#test.IHelloWorldRemote'
    It seem's that the overload of the Jndi name using the weblogic-ejb-jar file descriptor doesn't work.
    Can you help me to solve the problem.
    Thanks.

    Thank you, my sample works fine with the following weblogic-ejb-jar.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>HelloWorldBean</ejb-name>
    <enable-call-by-reference>true</enable-call-by-reference>
    <stateless-session-descriptor>
    <business-interface-jndi-name-map>
    <business-remote>test.IHelloWorldRemote</business-remote>
    <jndi-name>TOTO</jndi-name>
    </business-interface-jndi-name-map>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

  • Syntax error in ABAP query after implement patch

    Dear All,
    After implement patch from SAPKA46C39 to SAPKA46C53, we have syntax error in our query.
    our SAP release version is 46C.
    The error in query is -The data object "R01" does not have a component called "046" -
    We don't found any SAP notes that match for our error.
    Anyone ..please help...
    Thanks a lot...
    Budituta

    Hi,
    The query generated is based on the table structures available as they are used, etc.
    So please check if there is any difference in the fields available in the tables used, LDB used if any.
    In addition, may be few of the properties of the SAP query and info set does not get copied properly.
    and after activating the info set only, activate the query, etc...check them once again.
    Regards,
    Santhosh.

Maybe you are looking for