2 Replies Latest reply on Oct 18, 2009 11:18 PM by Gabriella Turek

    How do I package jdbc jar file in ear

    Gabriella Turek Newbie

      Hello, I'd like to pakacge my jdbc jar file in the ear file so I don't have to deploy it separately to the app server (in this case jboss). I've been able to do this with struts apps, but
      I've had no luck with seam.
      Thanx
      gaby

        • 1. Re: How do I package jdbc jar file in ear
          Nikos Paraskevopoulos Novice

          Hi,


          What's the error message? If the JDBC driver is in the EAR, so should the datasource definition (the -ds.xml file).


          But I would strongly advise against that... How many different db servers will there be in your installation? Put all the drivers in server/XXX/lib and share the classes. Then it is possible to deploy the datasource together with your application.

          • 2. Re: How do I package jdbc jar file in ear
            Gabriella Turek Newbie
            This is the error I get:

            2009-10-18 19:36:16,672 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] schema export unsuccessful
            org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceExc
            eption: Failed to register driver for: org.postgresql.Driver; - nested throwable: (java.lang.ClassNotFoundException: No
            ClassLoaders found for: org.postgresql.Driver)); - nested throwable: (org.jboss.resource.JBossResourceException: Could n
            ot create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: org
            .postgresql.Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.postgresql.Dri
            ver)))
                    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)

            Yes, the data source file is deployed in the ear.
            The ear file contents are as follow:

            META-INF/
            conf/ -> contains datasource file
            lib/ -> contains postgresql jar file
            jboss-seam.jar
            app.jar
            app.war