BC4J and JNDI DataSource Configuration

Hi,
I need help in making the BC4J use a DataSource for creating connections. Could you anyone tell me step by step instructions to do it?
I have created a Database Connection using JDBC for creating a BC4J App Module, View Objects etc.
Then I created a Business Component Package by using the wizard. Everything worked fine till now. But I was to use a connection pool that is created in my App Server which happens to be a WebLogic 7.0 App Server. I have created a JDBCConnection pool and a JDBCDataSource in the App Server. The configuration for it is as follows in the weblogic configuration file.
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
MaxCapacity="5" Name="OracleConnectionPool"
Password="{3DES}n51DlVgPmmQ="
Properties="user=empac;dll=ocijdbc9;protocol=oci"
Targets="myserver" URL="jdbc:oracle:oci:@DB921C"/>
<JDBCDataSource JNDIName="OCIDataSource" Name="OCIDataSource"
PoolName="OracleConnectionPool" Targets="myserver"/>
I wanted to edit the "Configurations" to specify the JDBC DataSource. When I saved the configuration for the App Module this is how my bc4j.xcfg looks.
<?xml version = '1.0' encoding = 'UTF-8'?>
<BC4JConfig>
<AppModuleConfigBag>
<AppModuleConfig name="BuyerModuleLocal">
<java.naming.security.principal>system</java.naming.security.principal>
<DeployPlatform>LOCAL</DeployPlatform>
<jbo.TypeMapEntries>Java</jbo.TypeMapEntries>
<JDBCDataSource>OCIDataSource</JDBCDataSource>
<jbo.project>BC4JTry</jbo.project>
<AppModuleJndiName>com.explore.bc4j.BuyerModule</AppModuleJndiName>
<ApplicationName>com.explore.bc4j.BuyerModule</ApplicationName>
<java.naming.security.credentials>security</java.naming.security.credentials>
</AppModuleConfig>
</AppModuleConfigBag>
<ConnectionDefinition name="DB921C">
<ENTRY name="JDBC_PORT" value="1521"/>
<ENTRY name="ConnectionType" value="JDBC"/>
<ENTRY name="HOSTNAME" value="joshua"/>
<ENTRY name="user" value="empac"/>
<ENTRY name="ConnectionName" value="DB921C"/>
<ENTRY name="SID" value="DB921C"/>
<ENTRY name="JdbcDriver" value="oracle.jdbc.driver.OracleDriver"/>
<ENTRY name="password" value="empac"/>
<ENTRY name="ORACLE_JDBC_TYPE" value="thin"/>
<ENTRY name="DeployPassword" value="true"/>
</ConnectionDefinition>
</BC4JConfig>
When I tried to run a testClient which uses the App Module it is failing giving me an exception saying could not lookup for the DataSource. In one of the detailed error messages, I got this error.
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
I checked the "Configurations" window and it was having
"oracle.jbo.common.JboInitialContextFactory" for the property "java.naming.factory.initial".
Could anyone tell me how to solve this issue. I did read the BC4J & JNDI Datasource configuration thread in the same forum and unfortunately that did not help.
Krish

What does you test client code look like and can you give us the complete stack trace.
Dhiraj

Similar Messages

  • Please Help With TopLink and JNDI datasource

    Hello
    I have been trying to figure this out for a while now and I am stuck. I have a simple J2EE project that uses toplink to access 1 table with 2 coulumns (JDev 10.1.3).
    I setup a sessions.xml and in there set my data Source Location to be my JNDI datasource.
    In my tlMap1 file I am required to put a Deployment Connection and no matter what I do it uses that connection. Is there some way I can make it use the JNDI connection that I specified in sessions.xml instead?
    i turned on debugging and it gives the following:
    [TopLink Config]: 2006.06.02 10:21:06.140--ServerSession(1216)--Connection(1242)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> "access_tst_d"
         connector=>JNDIConnector datasource name=>jdbc/accessEJB
    [TopLink Config]: 2006.06.02 10:21:06.328--ServerSession(1216)--Connection(1244)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--Connected: jdbc:oracle:thin:@access-web-test.admin.uni.edu:1525:WEBT
         User: ACCESS_TST_D
         Database: Oracle Version: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
    With the Partitioning and Data Mining options
         Driver: Oracle JDBC driver Version: 10.1.0.5.0
    [TopLink Info]: 2006.06.02 10:21:06.343--ServerSession(1216)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--default login successful
    [TopLink Finer]: 2006.06.02 10:21:06.343--ServerSession(1216)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--client acquired
    [TopLink Finest]: 2006.06.02 10:21:06.343--ClientSession(1246)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--Execute query ReadAllQuery(pl.model.PlLoginPrefixes)
    [TopLink Fine]: 2006.06.02 10:21:06.375--ServerSession(1216)--Connection(1229)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--SELECT LOGIN_PREFIX_ID, PREFIX FROM PL_LOGIN_PREFIXES
    [TopLink Finer]: 2006.06.02 10:21:06.953--ClientSession(1246)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--client released
    It looks like it sees the JNDI connection but it uses the "user name" parameter from tlMap1 instead. I am really getting desparate and any help would be greatly appreciated.
    Thanks
    troy

    Sorry to be such a pest about this but I have a bit more info now. If I go in to my tlMap file and select <none selected> for my deployment connection, the compiler gives me warnings and the mapping status report gives an error but it uses the jndi source from session.xml.
    Does anyone know of a way to do this (use the jndi datasource) without these compiler warnings? I just have this feeling I am doing something wrong, something that should be simple but nevertheless is turning out to be nearly impossible for me to figure out.
    thanks
    troy

  • JNDI DataSource Configuration Problem

    I configured the Tomcat so that I can use a Datasource to access a database according to the JNDI HOW TO instructions.
    I installed JDBC driver in %catalina_home%/common/lib, modified the web.xml in /WEB-INF and server.xml in /conf and coded the JSP page according to the instruction.
    But I get the following error when I run the app.
    Why this happens?
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred between lines: 14 and 33 in the jsp file: /jsp/track/ds-test.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.0.3\work\localhost\examples\jsp\track\ds_0002dtest$jsp.java:64: Class org.apache.jsp.Context not found.
    Context initCtx = new InitialContext();
    ^
    An error occurred between lines: 14 and 33 in the jsp file: /jsp/track/ds-test.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.0.3\work\localhost\examples\jsp\track\ds_0002dtest$jsp.java:64: Class org.apache.jsp.InitialContext not found.
    Context initCtx = new InitialContext();
    ^
    An error occurred between lines: 14 and 33 in the jsp file: /jsp/track/ds-test.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.0.3\work\localhost\examples\jsp\track\ds_0002dtest$jsp.java:66: Class org.apache.jsp.Context not found.
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    ^
    An error occurred between lines: 14 and 33 in the jsp file: /jsp/track/ds-test.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.0.3\work\localhost\examples\jsp\track\ds_0002dtest$jsp.java:66: Class org.apache.jsp.Context not found.
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    ^
    4 errors

    I imported the JNDI classes but I get a new error.
    java.lang.NullPointerException
         at org.apache.jsp.ds_0002dtest$jsp._jspService(ds_0002dtest$jsp.java, Compiled Code)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled Code)
         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, Compiled Code)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java, Compiled Code)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java, Compiled Code)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java, Compiled Code)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java, Compiled Code)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:472)

  • Connecting locally with BC4J and JDBC DataSource

    I have a BC4J project/module which I'm using as the data access layer for a web application, and that is deployed in 'local' mode on the OC4J server. In the config for the BC4J Module, I'm using the 'JDBC DataSource' connection type. When I deploy to OC4J, the appropriate entries are made in data-sources.xml and things run fine.
    W/in JDev, however, I'd like to be able to use the BC4J Tester and/or some local java classes (ie, run with a main method, outside the context of OC4J) to do some testing as I develop, including accessing the DB via my BC4J module, with the JDBC DataSource connection type. Currently, in order to run outside of the context of OC4J, I need to modify my config to use a connection type of 'JDBC URL' in order to successfully connect via the tester or via a main method driven class. (But then must be sure to change it back to 'JDBC DataSource' prior to redeploying.) If don't do this, and instead try to use the DataSource connection type, I get the errors "oracle.jbo.JboException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/ADD_OWNER_DEV2DS" and "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial" (among others)
    It seems pretty clear that I need to somehow/somewhere specify the context factory or such when running in JDev vs under OC4J, or somehow point the IDE to the local OC4J instance as the source of the info, etc?
    When trying to connect from the development environment, I have a local OC4J instance up and running, and I have what I think is an appropriate entry in data-sources.xml (I've tried this in 4 locations - j2ee\home\config, multi\system\oc4j-config, system9.0.3.1035\oc4j-config and as a new Data Sources Descriptor in the project.)
    Is there a way to set things up such that I can use the 'JDBC DataSource' connection type regardless of whether I'm running inside or outside of OC4J?
    Thanks,
    Jim

    Jim,
    You need some jndi implementation to bind(define) the datasource that can be looked up at runtime. Unfortunately, currently the only jndi implementation available in which you can bind datasources comes from oc4j. So you have to run in oc4j for using the datasource as your connection type.
    Dhiraj

  • BC4J and multiple datasources

    I'm attempting to explore JDeveloper 10g preview by re-implementing a small integration application that I worked on a few months ago. This application requires getting data from 3 different databases. When I attempt to drag a table from the second database onto the database diagram and create an entity object for it, I get the following error:
    Business Component projects can implement only one connection. You have dragged a table onto a diagram when the table is in a different database connection from that of the current project.
    I'm wondering if this is just a limitation of the preview edition, or if I'm going to need to use a different JDeveloper technology (like TopLink) to model this application.
    Thanks,
    Jonathan

    I had this same problem in 9i version. I worked around it by implementing a Database link in the database and creating views on my side of the link which pull data as I need it. As far as JDeveloper is concerned, these views are mapped as entities which can be read/updated as normal. Hope this helps!
    (BTW, if you find a way to do this completely within JDev let me know!)
    ~Rob Lundeen

  • How to use JNDI datasource instead of database connection settings JDev 10g

    Hi,
    In order to use the different database from other environments, we are not able to use the JNDI datasource configuration settings, all the time need to configure the database connection settings from JDeveloper by changing the database connectivity settings in the JDeveloper for each environment separately, need a solution on how to make the database connectivity unique using the JNDI datasource name for all the environments for database connectivity settings through the application server console rather than changing the database adapter configuration in JDeveloper.
    Please provide the update at the earliest. Your help is greatly appreciated. Thanks in advance..

    What are you not clear on?
    What you need to do is get your developers to conform to a database naming standard, as stated above, so if you have an oracle database that is for eBusiness Suite you get all developers to create a DB connection in JDev called, ora_esb as an example.
    When the developer creates a DB adapter this will create a JNDI name of eis/DB/ora_ebs. When the BPEL project is deployed it looks for the JNDI name in the oc4j-ra.xml file to see its connection details. If they don't exist then they use the developers connection details. The issue with this is that they generally always point to the development DB. It is best practice for the developers to remove the mcf settings in the DB adapter WSDL. This way if the JNDI name has not been configured it will fail.
    So when you migrate from dev-test-prod what you have is the JNDI name eis/DB/ora_ebs. The dev points to the dev instance of ebs, test points to the test instance and so on. This means that you don't need to adjust any code in the BPEL projects.
    cheers
    James

  • BC4J and J2EE Patterns (JNDI Datasource)

    Hallo Everybody,
    My Application reads from connections.xml the jdbc connection settings,
    in order to connect to the oracle database.
    I don't like the fact that I have to force my Customer to edit this File by Hand for the JDBC Settings.
    I would like to use a "JNDI Datasource Name" for example jdbc/MyDatabase that will evaluated
    from the Applicationserver (not from bc4j interal JNDI!!!!)
    In this case, the Customer can define the jdbc Connection Settings in his Applicationserver
    by creating a "Resource-Reference" for a javax.sqlDataSource with the name "jdbc/MyDatabase" .
    ( This is also Possible in Tomcat. )
    This is the usual way to configure jdbc Connections in a managed Enviroment.
    How can I say to the Applicaton Module "please obtain your jdbc-connections over the datasource java/MyDataBase" ???
    Is this in bc4j Framework possible ? ( note: I'm new to bc4j but not to j2ee )
    Thank for any Hint,
    regarts,
    Manolis
    (sorry for my bad english, learned it through compiler error messages ;-) )

    See
    Re: What software do I need to get started with GIS development

  • BC4J & JNDI Database Configuration Setting

    Hallo Everybody,
    My Application reads from connections.xml the jdbc connection settings,
    in order to connect to the oracle database.
    I don't like the fact that I have to force my Customer to edit this File by Hand for the JDBC Settings.
    I would like to use a "JNDI Datasource Name" for example jdbc/MyDatabase that will evaluated
    from the Applicationserver (not from bc4j interal JNDI!!!!)
    In this case, the Customer can define the jdbc Connection Settings in his Applicationserver
    by creating a "Resource-Reference" for a javax.sqlDataSource with the name "jdbc/MyDatabase" .
    ( This is also Possible in Tomcat. )
    This is the usual way to configure jdbc Connections in a managed Enviroment.
    How can I say to the Applicaton Module "please obtain your jdbc-connections over the datasource java/MyDataBase" ???
    Is this in bc4j Framework possible ? ( note: I'm new to bc4j but not to j2ee )
    Thank for any Hint,
    regarts,
    Manolis
    (sorry for my bad english, learned it through compiler error messages ;-) )

    It worked !!!
    Starting from a working Projekt that gets Connections over a JDBC Configuration,
    I changed then bc4j.xcfg (I had not to recompile)
    to
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <BC4JConfig>
    <AppModuleConfigBag>
    <AppModuleConfig name="SimpleAppModuleLocal">
    <ApplicationName>com.company.AppModule</ApplicationName>
    <DeployPlatform>LOCAL</DeployPlatform>
    <JDBCDataSource>DataSourceDef</JDBCDataSource>
    </AppModuleConfig>
    </AppModuleConfigBag>
    <ConnectionDefinition name="DataSourceDef">
    <ENTRY name="DsName" value=<b>"java:comp/env/jdbc/MyConcectionDS"</b>/>
    </ConnectionDefinition>
    </BC4JConfig>
    I'm using Tomcat, and my server.xml looks like :
    <context name="/examples" ....>
    <Resource name="jdbc/aixBOMSDS" auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name=<b>"jdbc/MyConcectionDS"</b>>
         <parameter><name>user</name><value>scott</value></parameter>
         <parameter><name>password</name><value>tiger</value></parameter>
         <parameter><name>driverClassName</name>
         <value>oracle.jdbc.driver.OracleDriver</value></parameter>
         <parameter><name>driverName</name>
         <value>jdbc:oracle:thin:@myhost:1521:mysid</value></parameter>
    <parameter>
              <name>maxActive</name>
              <value>8</value>
         </parameter>
         <parameter>
              <name>maxIdle</name>
              <value>4</value>
         </parameter>
    </ResourceParams>
    </context>
    and the web.xml in the /examples context :
    <webapp>
    <resource-ref>
    <res-ref-name><b>jdbc/MyConcectionDS</b></res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </webapp>
    thanks,
    Manolis Afentakis

  • Need Help in JNDI Datasource using tomcat and spring

    Hi,
    I am trying to connect my local database using JNDI datasource in tomcat and spring
    I have done the below configuration in Tomcat 7 server:
    In tomcat server.xml (Path: E:\apache-tomcat-7.0.35\conf) I added the below configuration
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/myApp" auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:hr@localhost:1521:XE>"
    username="testUser" password="password"
    maxActive="10" maxIdle="5"
    maxWait="60000" removeAbandoned="true"
    removeAbandonedTimeout="60" logAbandoned="true"/>
    In web.xml, I have added the below config:
    <resource-ref>
    <description>Oracle Spring JNDI Datasource</description>
    <res-ref-name>jdbc/myApp</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    And in my Spring context xml (ws-context.xml), added below config:
    <bean name="myDataSourceInJndi" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/jdbc/myApp"/>
    </bean>
    <jee:jndi-lookup id="dataSource" jndi-name="/jdbc/myApp" resource-ref="true"/>
    In my Java code, I am trying the below code to connect DataBase:
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/myApp");
    ds.getConnection();
    But I am getting the below exception while executing ****ds.getConnection();***
    java.lang.IllegalStateException: Connection factory returned null from createConnection
    at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:584)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    at com.wipro.spring.impl.EmployeeImpl.getDetails(EmployeeImpl.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
    at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.doPost(WSSpringServlet.java:52)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Can you please me to resolve this issue? Am I missing any configuration or any mistake in my java code please suggest your suggestions.
    Thanks

    Hi,
    I am trying to connect my local database using JNDI datasource in tomcat and spring
    I have done the below configuration in Tomcat 7 server:
    In tomcat server.xml (Path: E:\apache-tomcat-7.0.35\conf) I added the below configuration
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/myApp" auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:hr@localhost:1521:XE>"
    username="testUser" password="password"
    maxActive="10" maxIdle="5"
    maxWait="60000" removeAbandoned="true"
    removeAbandonedTimeout="60" logAbandoned="true"/>
    In web.xml, I have added the below config:
    <resource-ref>
    <description>Oracle Spring JNDI Datasource</description>
    <res-ref-name>jdbc/myApp</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    And in my Spring context xml (ws-context.xml), added below config:
    <bean name="myDataSourceInJndi" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/jdbc/myApp"/>
    </bean>
    <jee:jndi-lookup id="dataSource" jndi-name="/jdbc/myApp" resource-ref="true"/>
    In my Java code, I am trying the below code to connect DataBase:
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/myApp");
    ds.getConnection();
    But I am getting the below exception while executing ****ds.getConnection();***
    java.lang.IllegalStateException: Connection factory returned null from createConnection
    at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:584)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    at com.wipro.spring.impl.EmployeeImpl.getDetails(EmployeeImpl.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
    at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.doPost(WSSpringServlet.java:52)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Can you please me to resolve this issue? Am I missing any configuration or any mistake in my java code please suggest your suggestions.
    Thanks

  • How can I configure ang use JNDI datasource on Tomcat 4.0.x ?

    How can I configure ang use JNDI datasource on Tomcat 4.0.x ?
    Please help me , Thanks !

    Hello ,
    You need to go through the JNDI tutorial which you can access at the sun's site. It will explain all the things you need.
    By the way all you want to use JNDI datasource is JNDI class library and some naming or directory service provider, which also you can download from sun.
    Good Luck.

  • DataSource and JNDI

    Ight guys i am soo confused... I am creating a connection pool and i have used the little tool to create the pool and the datasource.. Now how do i call the datasource to be able to retrieve the connection.. Sorry for the question i just am not understanding everything that i have been reading

    Well, your question is how to connect to an established connection pool? Are you sure your pool is actually working? You didn't post any code on how you set that up.Also, without the setup portion, we don't know what reference name you gave your connection pool, so we don't know how to look it up. Please post the portion of your server.xml where you created the resource and the portion of your web.xml where you reference it, and we can take it from there.

  • How to use jndi datasource on Weblogic instead of adding a DB data source

    Hi All,
    version: 11.1.1.4
    I am trying to figure out how in my ADF applications I can use an existing jndi datasource out on our weblogic servers instead of having to bury the Database db source in my adf applications. Like SOA I would like to reference the DB directly during design so I can pull in entities and build view objects, but when I deploy I want it to reference the jndi datasource out on the weblogic server.
    Is this possible? If so I am not sure how to configure it like I would a DB adapter in SOA.
    As always appreciate the info.
    Thanks,
    S

    If you use ADF in the model layer (application modules) you can configure them to use JNDI Datasources. Just right click on the application module and select 'Configurations...'. In the next dialog you see all the configurations currently available (one named xxxxxlocal and one named xxxxxshared at least). Select the local and hit the edit button. This open the DB connect dialog where you can change the connection from JDBC URL to JDBC Datasource (JNDI). Save your work and when you now start the app it will use the JNDI name.
    Timo

  • EJB 3.0, BC4J and weblogic managed server

    Hi, I've got a problem using EJB 3.0 with a BC4J Application module in a weblogic managed server.
    My bean is a stateless session bean that use BC4J for database transaction.
    When I call the bean the first time, It returns de values I need, without problem. If I do the same call again, I always get "null". I deployed the same bean on the AdminServer, linking to the same DataSource, It works fine and I never got a null result.
    My application module is created insid my EJB abstract class by :
    _am = (BaseServiceImpl)Configuration.createRootApplicationModule(adfModel, adfConfiguration);*
    Where adfModel and adfConfiguration are configured through annotations in my EJB Implementation.
    In my abstract EJB, I have a methode with a +@PreDestroy+ method like that :
    +@PreDestroy+
    *protected void releaseModele() {*
    *if (_am != null) {*
    Configuration.releaseRootApplicationModule(_am, false);
    _am = null;*
    My Data Source on the server is defined as Supporting Global Transaction, one-phase commit. I activated the BC4J Logs on the server to see what was going on and I see that the JDBC seems to close after the first call :
    *** closing jdbc connection now **** (weblogic.jdbc.wrapper.JTSConnection_oracle_jdbc_driver_T4CConnection@0)
    And that is when I've got the error on the server :
    oracle.jbo.InvalidObjAccessException: JBO-25036: An invalid object operation was invoked on type View Object with name AppModAD
    So, my JDBC connection seems to close somewhere beetween the first and the second call, but only on a managed server... Someone has ever encountered a problem like that?
    Maybe there is something with the configuration of a datasource on a managed server? Or with the lifecycle of an

    The solution was to NOT have glabal transaction checked in the configuration of the data-source and "Failover Transaction State Upon Managed Release" uncked in the configuration of the Business component configuration.

  • CF8 with JBoss JNDI datasource

    After installing and configuring a CF8 for J2EE running on
    JBoss 4.2.2.GA with Java 6, I have created a JNDI datasource for
    Oracle 10g in the oracle-ds.xml file. I have configured a CF8
    datasource that uses the JNDI resource.
    Any query that is NOT using cfqueryparam works quite well.
    As soon as cfqueryparam is used, I get an "Error casting an
    object of type org.jboss.resource.adapter.jdbc.WrappedConnection
    cannot be cast to coldfusion.server.j2ee.sql.JRunConnectionHandle
    to an incompatible type.".
    The configuration and the exception is pretty much the same
    as described in
    Problem
    description.
    This is clearly a CF8 bug and I was wondering if there is any
    known workaround for it.

    In web.xml making the following entry:
    <web-app>
    <description>MySQL Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    Next, add a file jboss-web.xml under WEB-INF/ folder of the web-application. This file should contain entry as:
    <jboss-web>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <jndi-name>java:/jdbc/test</jndi-name>
    <res-auth>Container</res-auth>
    </resource-ref>
    </jboss-web>
    Next, in JBOSS_HOME/server/default/deploy folder make a xx-ds.xml file or else, a similiar file can be found in that same folder with the name hsqldb-ds.xml. Make following entries in that xml file:
    <datasources>
    <local-tx-datasource>
    <jndi-name>/jdbc/test</jndi-name>
    <type-mapping>MySQL</type-mapping>
    <connection-url>jdbc:mysql://localhost:3306/shopping_cart</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>root123</password>
    <min-pool-size>1</min-pool-size>
    <max-pool-size>5</max-pool-size>
    </local-tx-datasource>
    This should bind the jndi name.
    In our client application, we need to look up as:
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:/jdbc/test");
    Connection conn = ds.getConnection();
    This works perfectly.

  • Tomcat JNDI Datasources

    I tried to configure a JNDI datasource in tomcat 5.0,
    I am facing the following error
    java.sql.SQLException: Cannot load JDBC driver class 'null'
            at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
            at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
            at com.scb.controller.actions.TestAction.testDatasource(TestAction.java:70)
            at com.scb.controller.actions.TestAction.execute(TestAction.java:46)
            at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:53)
            at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:64)
            at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
            at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
            at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
            at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
            at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
            at com.scb.controller.ControllerServlet.process(ControllerServlet.java:157)
            at com.scb.controller.ControllerServlet.doGet(ControllerServlet.java:99)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:288)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:561)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1018)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:561)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1018)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2748)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:186)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:561)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1018)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:561)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1018)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:199)
            at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:294)
            at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:375)
            at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:664)
            at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:606)
            at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:777)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:631)
            at java.lang.Thread.run(Thread.java:534)My code :
                          System.out.println("Looking up for datasource!");
                   Context envContext  = (Context)context.lookup("java:comp/env");
                   System.out.println("Env context = " + envContext);
                 ds = (DataSource)envContext.lookup("jdbc/amadeus");
                   System.out.println("datasource obtained and trying to establish             connection");
                   System.out.println(" Ds = 1 " + ds);
                   connection = ds.getConnection();
                   statement = connection.createStatement();
                   System.out.println("Executing query");
                   rs = statement.executeQuery("SELECT SYSDATE FROM DUAL");Please help if you have any ideas.

    You forgot to specify the database driver in your datasource declaration (which should be in the context.xml file). The tomcat example lists this:
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
                   maxActive="100" maxIdle="30" maxWait="10000"
                   username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>So you probably have no driverClassName. Also, the jar file containing the driver needs to be in tomcat/common/lib.

Maybe you are looking for

  • Link to one keynote document from another

    Hi there, like many designers, I use Keynote for doing mobile/web design & prototyping. While never meant for this, it's actually one of the fastest tools out there. One of the things that is limiting though, is that you for sane reasons only can hav

  • Plugging in Headphones Sometimes "freezes" iPOD

    If my iPod is off and I plug in the headphones, it powers up like you'd expect it to. However, the time will show 12:00AM. In addition, if I select a song to play, the "Currently Playing" screen comes up and the play symbol displays in upper left, bu

  • Ethernet connection and airport failure

    I'm studying abroad in Madrid, Spain, and I'm having difficulty with my internet access. On campus, the IT director put in the airport location and password, and it won't log on. It says "failure to connect." Other Macs in the building are working fi

  • But my machine is setup for talktalk,so i have to open the wireless and click on my provider to get on line.

    hi, i have an intel based imac running lion,when i start it up the wireless connection sometimes starts trying to connect to bt,but my imac is setup for talktalk, so i have to open the wireless drop down to select my provider.hope someone can advise

  • Error when doing compression

    Dear All, Compression fails with the following error message after the job run for 4 to 5 hours .Please help to look into issue . System error: ORA-30036: unable to extend segment by 8 in undo t           System error: ablespace 'PSAPUNDO' System err