JNLP and Tomcat JNDI DataSource

Software
JDK 1.5 Update 6
Tomcat 5.5.4
Requirements
I have a Client Side requirement and this project is going to be deployed to 5 users initially all in a lan but there are very chances of adding more users simultaneously.
I am thinking of deploying in JNLP Environment.
At present the Swing application though in development phase is running a little slow and therefore I required the way by which I could store the references of the Object in some server.Getting Connection Object is also a major time consumer and so I needed some way by which I can use the Tomcat DataSource and use the JNDI facility to store certain intermediate values in the server.
Can I use the JNDI in the JNLP Application.
Please provide me the way by which I can do this stuff
Thanks in advance
CSJakharia

.> I am using tomcat 5.5.9 and oracle 9i. I am hosting a
portal which uses connection pooling.
I have decided to use the connection pooling through
tomcat's JNDI naming lookup.Excellent idea.
for this i have used the following steps --
1) made entry of <resource-ref> in webapp's web.xml
2) made relevant and corresponding entry in tomcat's
${TOMCAT_HOME}/conf/context.xml (for JNDI
JDBC-datasource)No, don't do it that way.
.> my problems are--
1) making the entry for context.xml in tomcats
conf folder makes the application war dependent
on web server which i dont want to make.Yes, it does.
2) i have to put classes12.jar in tomcats
${TOMCAT_HOME}/common/lib folder and only then the
application connection pooling works else the
exception coming on tomcat console is --
org.apache.tomcat.dbcp.dbcp.SQLNestedException.
Why aren't you using the latest JDBC driver from Oracle? That's in ojdbc14.jar.
.> I dont want to put classes12.jar in web server i want
the web server's JNDI lookup to pick the driver frm
my webapps' internal lib folder. please help me on
these very pressing and immediate issues. all the
help coming from anyone in this regard is very much
welcome.
thanks in advance!
VaivYour instinct is correct.
(1) Put ojdbc14.jar in WEB-INF/lib of your WAR file.
(2) Edit the <Context> XML into a file named context.xml and put it in META-INF of your WAR. Tomcat should pick up the context information for the JNDI data source from that.
Everything is in the WAR, and you don't have any dependence on the server that way.
%

Similar Messages

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

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

  • 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

  • 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

  • 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

  • MySql and Tomcat 5.5

    I have read several threads, and others are having this problem but the resolutions do not seem to be posted or are different than what I am having. Hopefully someone can help me figure out...
    Cannot create JDBC driver of class '' for connect URL 'null'
    I verified that my url was correct here...
    http://dev.mysql.com/doc/connector/j/en/cj-driver-classname.html
    Here is my server.xml snippet
    <GlobalNamingResources>
    <Resource name="jdbc/mtshr" auth="Container"
    type="javax.sql.DataSource" username="xxxx" password="xxxx"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/mtshr?autoReconnect=true"
    maxActive="8" maxIdle="4"/>
    </GlobalNamingResources>
    in my WEB-INF/web.xml
    <resource-ref>
    <description>
    HRDB Deployment
    </description>
    <res-ref-name>
    jdbc/mtshr
    </res-ref-name>
    <res-type>
    javax.sql.DataSource
    </res-type>
    <res-auth>
    Container
    </res-auth>
    </resource-ref>
    I have tried moving the mysql-connector-java-3.1.7-bin.jar to both common/lib and WEB-INF/lib
    My code to connect is...
    java.sql.Connection Conn = null;
    javax.sql.DataSource ds = null;
    java.sql.Statement Stmt = null;
    java.sql.ResultSet rs = null;
    javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    javax.naming.Context envctx = (javax.naming.Context) ctx.lookup("java:comp/env");
    ds = (javax.sql.DataSource) envctx.lookup("jdbc/mtshr");
    Conn = ds.getConnection();
    Stmt = Conn.createStatement();
    (delete these last two statements and no errors)
    Any help is GREATLY appreciated. I had everything running in TC 3.2.3 and 4.1 I thought it would be a good idea and exercise to revisit my code and get some experience with j2se 5.0 and TC 5.5
    Not promising if I can't even get past the setup :) Thanks again!

    SO...
    I created a META-INF folder in my app, and then created a file called context.xml which contained the same code as I had in my server.xml file.
    In the documentation http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html#Common%20Problems
    it says that you can use global naming instead of context. Didn't work with global naming but it did work with context. No idea why, just know that it did.

  • JNDI datasource context LifeCycleException

    Any help with this would be greatly appreciated. I'm trying to set up connection pooling in Tomcat 4.1.27 on Linux using MySQL. I followed the directions from Jakarta here http://jakarta.apache.org/tomcat/tomcat-4.1-doc/printer/jndi-datasource-examples-howto.html
    And I put the mysql connector .jar file in Tomcat's common/lib directory.
    However, when I start up Tomcat, my webapp doesn't load. There is no error message in the logs or on the console at startup. It just silently fails. Then when I shutdown Tomcat this error appears:
    2003-10-17 11:31:12 StandardHost[localhost]: Removing web application at context path /budgetchallenge
    2003-10-17 11:31:12 StandardHost[localhost]: ContainerBase.removeChild: stop:
    LifecycleException:  Container StandardContext[/budgetchallenge] has not been started
            at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3644)
            at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1036)
            at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.java:470)
    etc...Here is the node in my web.xml per the directions...
        <resource-ref>
            <description>DB Connection</description>
            <res-ref-name>jdbc/budgetchallenge</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
        </resource-ref>Here is the setup in the server.xml...
    <Context path="/budgetchallenge" docBase="budgetchallenge"
            debug="5" reloadable="true" crossContext="true">
      <Logger className="org.apache.catalina.logger.FileLogger"
                 prefix="localhost_budgetchallenge_log." suffix=".txt"
                 timestamp="true"/>
      <Resource name="jdbc/budgetchallenge"
                   auth="Container"
                   type="javax.sql.DataSource"/>
      <ResourceParams name="jdbc/budgetchallenge">
        <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <!-- Maximum number of dB connections in pool. Make sure you
             configure your mysqld max_connections large enough to handle
             all of your db connections. Set to 0 for no limit.
             -->
        <parameter>
          <name>maxActive</name>
          <value>100</value>
        </parameter>
        <!-- Maximum number of idle dB connections to retain in pool.
             Set to 0 for no limit.
             -->
        <parameter>
          <name>maxIdle</name>
          <value>30</value>
        </parameter>
        <!-- Maximum time to wait for a dB connection to become available
             in ms, in this example 10 seconds. An Exception is thrown if
             this timeout is exceeded.  Set to -1 to wait indefinitely.
             -->
        <parameter>
          <name>maxWait</name>
          <value>10000</value>
        </parameter>
        <!-- MySQL dB username and password for dB connections  -->
        <parameter>
         <name>username</name>
         <value>...</value>
        </parameter>
        <parameter>
         <name>password</name>
         <value>...</value>
        </parameter>
        <!-- Class name for mm.mysql JDBC driver -->
        <parameter>
           <name>driverClassName</name>
           <value>com.mysql.jdbc.Driver</value>
        </parameter>
        <!-- The JDBC connection url for connecting to your MySQL dB.
             The autoReconnect=true argument to the url makes sure that the
             mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
             connection.  mysqld by default closes idle connections after 8 hours.
             -->
        <parameter>
          <name>url</name>
          <value>jdbc:mysql://10.1.1.45:3306/budgetsurvey_02</value>
        </parameter>
      </ResourceParams>
    </Context>

    Yeah, I've got those all set up.
    However, now the application is working, connecting to the DB and everything. The problem was that the deployed .war file was not expanding. The JNDI context specifies and directory with the app name, but there was none because the .war file was not expanded as it usually is automatically in Tomcat.
    So I manually expanded it and now the app works. However, I'd like to know why the .war archive was not being automatically expanded.
    Ethan

  • Dynamically set database url using tomcat jndi

    By using Tomcat JNDI, database url information needs to be hardcoded in server.xml file according to the documentation. Is there a way to change the URL information in the code dynamically if necessary?
    And also we need multiple connection pools and the connection information about those pools are only known during run time. So the TOMCAT JNDI is still the right way to go???
    By the way, does anybody ever use tomcat DBCP package to get datasource and set url dynamically?
    Thanks in advance.

    By using Tomcat JNDI, database url information needs
    to be hardcoded in server.xml file according to the
    documentation. Is there a way to change the URL
    information in the code dynamically if necessary?
    Not that I know of.
    And also we need multiple connection pools and the
    connection information about those pools are only
    known during run time. So the TOMCAT JNDI is still the
    right way to go???
    I think so. Since it's just a JDNI lookup, perhaps you can set up multiple data sources and decide on the lookup name at the last minute, depending on circumstances. That might work. I haven't tried it myself. - MOD
    By the way, does anybody ever use tomcat DBCP package
    to get datasource and set url dynamically?
    Thanks in advance.

  • Authentication problem with JWS and TOMCAT

    Hi everyone !
    I have a problem with Java Web Start (1.0.1) and Tomcat (4.0.4).
    I'm trying to call my application via Web server Tomcat with restricting access.
    My configuration is the following :
    The deployment descriptor web.xml is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!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>
    <mime-mapping>
    <extension>jar</extension>
    <mime-type>application/java-archive</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>java</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jnlp</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>JNLP</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    <!-- Define a Security Constraint on this Application -->
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Entire Application</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <!-- NOTE: This role is not present in the default users file -->
    <role-name>standard</role-name>
    </auth-constraint>
    </security-constraint>
    <!-- Define the Login Configuration for this Application -->
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>MY APPL</realm-name>
    </login-config>
    </web-app>
    And jnlp File is:
    <jnlp
    spec="1.0+"
    codebase="http://host:8080/Official/"
    href="Application.jnlp">
    <information>
    <title>Application release 0.10</title>
    <vendor> XXXX </vendor>
    <homepage href="/"/>
    <description>Application</description>
    <description kind="short">My Application</description>
    <icon href="Icon.gif"/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.3"/>
    <jar href="Jar1.jar"/>
    <jar href="Jar2.jar"/>
    <jar href="Jar3.jar"/>
    <jar href="Jar4.jar"/>
    <jar href="Jar5.jar"/>
    <jar href="Jar6.jar"/>
    <jar href="Jar7.jar"/>
    <jar href="Jar8.jar"/>
    <jar href="Jar9.jar"/>
    <jar href="Jar10.jar"/>
    <jar href="MyApplication.jar"/>
    </resources>
    <application-desc main-class="com.xxxx.tool.cm.MyApplication"/>
    </jnlp>
    With the above configuration the Java Web Start not work.
    I'm expecting the message box for insert username and password instead it returns the messagge error :
    An error occurred while launching/running the application.
    Vendor: XXXX
    Category: Download Error
    Unable to load resource: http://host:8080/Official/Application.jnlp
    The Exception error is:
    JNLPException[category: Download Error : Exception: java.lang.NullPointerException : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
         at com.sun.javaws.cache.DownloadProtocol.isLaunchFileUpdateAvailable(Unknown Source)
         at com.sun.javaws.LaunchDownload.getUpdatedLaunchDesc(Unknown Source)
         at com.sun.javaws.Launcher.downloadResources(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I have tried to remove the restrict access in the deployment descriptor (web.xml) and java Web Start WORKS !!!!!!
    I'll appreciate any idea or hint!
    Thanks in advance

    Check this out
    http://forum.java.sun.com/thread.jsp?forum=38&thread=456250
    Mad Einstein

  • 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

  • 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

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

  • [svn:bz-trunk] 15533: Back out some local changes to tomcat-users. xml and tomcat-users.xml. install I inadvertently checked in when upgrading ActiveMQ on BlazeDS/trunk .

    Revision: 15533
    Revision: 15533
    Author:   [email protected]
    Date:     2010-04-17 04:20:11 -0700 (Sat, 17 Apr 2010)
    Log Message:
    Back out some local changes to tomcat-users.xml and tomcat-users.xml.install I inadvertently checked in when upgrading ActiveMQ on BlazeDS/trunk.
    Modified Paths:
        blazeds/trunk/servers/apache-tomcat-6.0.14/conf/tomcat-users.xml
        blazeds/trunk/servers/apache-tomcat-6.0.14/conf/tomcat-users.xml.install

    i will not read all that!!!! Format it! Lots of useless information commented.
    java.net.SocketException: java.net.ConnectException: Connection timed out: connect
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
    Tells me you have a connection error on Mysql. Quick search show me this:
    <Resource name="jdbc/passport" auth="Container"
    type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://258.1.54.134:3306/xmnext_passport"
    username="dda" password="zhoussda" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    Can you connect to the server using thos setting with a mysql client in the server?

Maybe you are looking for

  • Interest calculation in Dunning Wizard

    Hi All, I have a question with regard to the calculation of Interest amount via Dunning wizard. Let us say I have a dunning term that issues Dunning Letter 1, 30 days past the due date. Dunning Letter 2 is issued 30 days past the dunning letter 1. Th

  • Pointing portal server from classes12.jar to ojdbc14.jar JDBC driver

    Hi,      Some time ago we upgraded our portal landscape from Oracle 9.2.0.7 to Oracle 10.2.0.2. Using OSS Notes 867176 and 915079, we pointed our portal servers to use the newer and recommended ojdbc14.jar driver. This included using Config manager t

  • User Exit for Delivery to add Profit Centre

    Hello All, I need the User Exit to Add the Profit Centre at Delivery level..! I tried in this MV50AFZ1 Form FORM userexit_move_field_to_lips. but its not working... So please let me know the userexit and the code..! Thanks in Advance Regards Babu

  • HT1338 I am trying to get IPhoto.

    I bought a 2011 MBP on ebay, have the reciepts and all. I have Applecare for two more years. I try to install Iphoto and it gives me an error message "These apps cannot be accepted on this computer." I have everything that came with the computer. I h

  • Rwcon60 can't find libjava.so

    I'm trying to use rwcon60 to convert a rdf file to an rep file on SunOS 5.9. I run it like this: {BRELCUST}oracle@-/home/oracle/product/ias1.0.2/6iserver/reports60> ../bin/rwcon 60 userid=lads/u0wnlad3 stype=RDFILE source=FinalSci.rdf DTYPE=REPFILE d