6 Replies Latest reply on Sep 18, 2014 7:10 AM by Harish Venkat

    Custom Datasource jar configuration..

    Harish Venkat Newbie

      Hi ,

       

      I am trying to integrate a custom data source jar in JBOSS EAP 6.2 i created the modules dir

       

      /usr/local/clo/ven/JBOSS/jboss-eap-6.2/modules/system/layers/base/org/com/xxx/xx/main

      my module.xml is

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.1" name="org.com.xxx.xx">

      <properties>

      <property name="jboss.api" value="private"/>

      </properties>

      <resources>

      <resource-root path="a1.jar" />

      <resource-root path="a2.jar" />

      <resource-root path="a3.jar" />

      <resource-root path="a4.jar" />

      <resource-root path="a5.jar" />

      <resource-root path="a6.jar" />

      <resource-root path="aa7.jar" />

      <resource-root path="mainjar.jar" />

      </resources>

      <dependencies>

      </dependencies>

      </module>

       

       

      and in my domain.xml under full-ha

       

      <subsystem xmlns="urn:jboss:domain:ee:1.1">

                      <global-modules>

                          <module name="org.com.xxx.xx" slot="main"/>

                      </global-modules>

                      <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>

                      <jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>

                  </subsystem>

       

      but i am not able to find this mainjar.jar or any  other jars in that main folder coming in console i tried for verbose:class but i am not able to find the classes in the jar

       

       

       

      Please do the needful

        • 1. Re: Custom Datasource jar configuration..
          Wolf-Dieter Fink Master

          First, you should place your modules direct in the modules folder, that mean modules/org/com.....

          And if the module get's picked up you  should see a error message if a jar is not found.

          • 2. Re: Custom Datasource jar configuration..
            Harish Venkat Newbie

            thanks i did the same i want to know whether my jar is loading or not i am not getting any errors

             

            and when i run the Java class with my new custom data source i am getting the error

            "

            Server:HelloWorld-Server_res] 07:58:22,810 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (http-/127.0.0.1:8082-1) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:288)

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:246)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:781)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:344)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:302)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:139)

            Server:HelloWorld-Server_res]  at org.apache.jsp.index_jsp._jspService(index_jsp.java:72)

            Server:HelloWorld-Server_res]  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)

            Server:HelloWorld-Server_res]  at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)

            Server:HelloWorld-Server_res]  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

            Server:HelloWorld-Server_res] Caused by: javax.resource.ResourceException: Failed to register driver for: com.xxx.xx.x.SampleDataSource

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:586)

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:259)

            Server:HelloWorld-Server_res]  ... 31 more

            Server:HelloWorld-Server_res] Caused by: java.lang.ClassCastException: com.ssc.faw.util.SampleDataSource cannot be cast to java.sql.Driver

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:577)

            Server:HelloWorld-Server_res]  ... 32 more

            Server:HelloWorld-Server_res]

            Server:HelloWorld-Server_res] 07:58:22,857 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Res2HelloWorld].[jsp]] (http-/127.0.0.1:8082-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.ssc.faw.util.SampleDataSource cannot be cast to java.sql.Driver

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:577)

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:259)

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:246)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:781)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:344)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:302)

            Server:HelloWorld-Server_res]  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

            Server:HelloWorld-Server_res]  at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:139)

            Server:HelloWorld-Server_res]  at org.apache.jsp.index_jsp._jspService(index_jsp.java:72)

            Server:HelloWorld-Server_res]  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)

            Server:HelloWorld-Server_res]  at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)

            Server:HelloWorld-Server_res]  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

            Server:HelloWorld-Server_res]  at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

             

             

            "

             

             

            • 3. Re: Custom Datasource jar configuration..
              Wolf-Dieter Fink Master

              Seems the class get's loaded but you have problems with the interface

                   java.lang.ClassCastException: com.ssc.faw.util.SampleDataSource cannot be cast to java.sql.Driver

               

              If you remove the module, did you see ClassNotFoundExceptions?

              • 4. Re: Custom Datasource jar configuration..
                Harish Venkat Newbie

                Yes I am getting the Error,

                 

                 

                but i am not able to find the Jar and the contents of jar(classes) in the console as i need to use the properties of this jar in the application classes

                • 5. Re: Custom Datasource jar configuration..
                  Wolf-Dieter Fink Master

                  Did not understand what you mean by the last question

                  • 6. Re: Custom Datasource jar configuration..
                    Harish Venkat Newbie

                    Ok lets Get it simple

                     

                    I have a custom Data-source jar say sampledatasource.jar i need to integrate with JBOSS EAP for connecting my Database so what i had done is

                     

                     

                    classic method i created a module folder in modules

                    JBOSS

                        |

                        |__modules

                            |

                            |__com

                                |

                                |__ssc

                                    |

                                    |__fwa

                                        |

                                        |__main

                                            |

                                            |__module.xml customdatasource.jar dependency1.jar dependency2.jar dependency3.jar

                     

                     

                     

                    and in modules.xml

                     

                     

                    <?xml version="1.0" encoding="UTF-8"?>

                    <module xmlns="urn:jboss:module:1.0" name="com.ssc.fwa">

                        <properties>

                            <property name="jboss.api" value="unsupported"/>

                        </properties>

                         <resources>

                            <resource-root path="dependencyjar1.jar"/>

                            <resource-root path="dependencyjar2.jar"/>

                            <resource-root path="dependencyjar3.jar"/>

                            <resource-root path="customdatasource.jar"/>

                            <resource-root path="dependencyjar4.jar"/>

                         </resources>

                        <dependencies>

                            <module name="javax.api"/>

                            <module name="javax.persistence.api"/>

                            <module name="javax.resource.api"/>

                            <module name="javax.security.auth.message.api"/>

                            <module name="javax.security.jacc.api"/>

                            <module name="javax.servlet.api"/>

                            <module name="javax.transaction.api"/>

                            <module name="javax.xml.bind.api"/>

                            <module name="javax.xml.stream.api"/>

                            <module name="org.jboss.logging"/>

                            <module name="org.infinispan"/>

                        </dependencies>

                    </module>

                     

                     

                    and my domain.xml in ha-ful

                     

                     

                    i added driver

                     

                     

                                        <driver name="SampleDs" module="com.ssc.fwa">
                                            <datasource-class>com.ssc.faw.util.SampleDatasourceDriver</datasource-class>
                                        </driver>

                     

                     

                    and in datasource

                     

                     

                     

                    <datasource jta="false" jndi-name="java:jboss/datasources/SampleDs2" pool-name="OOA2" enabled="true" spy="true" use-ccm="false">

                                            <connection-url>jdbc:oracle:thin:@//******:1521/OOA2</connection-url>

                                            <connection-property name="useExtendedJndiPropertyNames">

                                                false

                                            </connection-property>

                                            <connection-property name="abc">

                                                ABC-TDE

                                            </connection-property>

                                            <connection-property name="bcd">

                                                BCD

                                            </connection-property>

                                            <connection-property name="env">

                                                DEV

                                            </connection-property>

                                            <connection-property name="dataSourceImplementationType">

                                                POOLED

                                            </connection-property>

                                            <connection-property name="actionQualifier">

                                                MASTER

                                            </connection-property>

                                            <connection-property name="dataSourceName">

                                                esftdedev

                                            </connection-property>

                                            <connection-property name="resiliencyDataSourcesStr">

                                                String

                                            </connection-property>

                                            <driver>ResDs</driver>

                                            <security>

                                                <user-name>USERNAME</user-name>

                                                <password>PASSWORD</password>

                                            </security>

                                            <validation>

                                                <validate-on-match>false</validate-on-match>

                                                <background-validation>false</background-validation>

                                            </validation>

                                            <statement>

                                                <share-prepared-statements>false</share-prepared-statements>

                                            </statement>

                                        </datasource>

                     

                     

                     

                     

                    all these configurations are working fine

                     

                     

                     

                    I am able to connect the data base but the thing is we are not able to ,, and i can able to get the database data ,, I need to see the classes in jar to use it ,

                    I also used verbose:class to to check whether i can see the classes but i am not able to see it.

                     

                     

                     

                    now i need to use this jar to map the connections

                     

                    i think u can understand now.

                    Please tell me how to configure the custom jar