RE: Location of Database driver

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: Location of Database driver

Katia Aresti Gonzalez

Hi!!

I think that you have to copy the driver to the repository directory. You have to create a folder in the repository of the M4 instalation folder, for example oracle. inside that folder, create another one with the name jar, and copy the driver there.

repostory/oracle/jars/your driver.

Hope this helps!!

Katia




>From: waimun <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Location of Database driver
>Date: Wed, 1 Jun 2005 10:08:42 -0400
>
>Hi,
>
>I am trying to test one of my applications against the M4 build.
>After deploying the application, I realize I do not have the
>database driver configured. Where do I copy the oracle driver to
>(eg. tomcat/common/lib)?
>
>I looked up the wiki FAQ but didn't find any info about this. I
>could have missed some details in the wiki. Thanks for any hints...
>
>--
>waimun
>


Acepta el reto MSN Premium: Env?a hasta 500 megas diarios de fotos desde Hotmail. Desc?rgalo y pru?balo 2 meses gratis.
Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Waimun Yeow
Hi...
I am still getting NoClassDefFound. Do I need any other configuration
other than creating the directory structure you have mentioned.

Thanks.
--
waimun

On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
 >
 >
 >
 > Hi!!
 >
 > I think that you have to copy the driver to the repository directory.
You
 > have to create a folder in the repository of the M4 instalation
folder, for
 > example oracle. inside that folder, create another one with the name
jar,
 > and copy the driver there.
 >
 > repostory/oracle/jars/your driver.
 >
 > Hope this helps!!
 >
 > Katia
 >

Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

David Jencks
I can't find your previous posts.
You need to include a dependency to the driver jar in your plan.  For
instance, default-database-plan has dependencies on the axion jar and 3
other jars it needs.  For oracle you should need only the oracle driver
jar.  If this doesn't fix the problem please post your entire plan.

thanks
david jencks


On Jun 3, 2005, at 2:45 PM, waimun wrote:

> Hi...
> I am still getting NoClassDefFound. Do I need any other configuration
> other than creating the directory structure you have mentioned.
>
> Thanks.
> --
> waimun
>
> On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
> >
> >
> >
> > Hi!!
> >
> > I think that you have to copy the driver to the repository
> directory. You
> > have to create a folder in the repository of the M4 instalation
> folder, for
> > example oracle. inside that folder, create another one with the name
> jar,
> > and copy the driver there.
> >
> > repostory/oracle/jars/your driver.
> >
> > Hope this helps!!
> >
> > Katia
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Waimun Yeow
I am modifying the default-database-plan by inserting another
dependency for the oracle jar directory. I feel that this might be
wrong as I only need the jar file to be exposed in the web context. I
am still getting the NoClassDefFound. How do I do this in the plan
file?

Thanks,
waimun

On Jun 3, 2005, at 7:11 PM, David Jencks wrote:

> I can't find your previous posts.
> You need to include a dependency to the driver jar in your plan.  For
> instance, default-database-plan has dependencies on the axion jar and
> 3 other jars it needs.  For oracle you should need only the oracle
> driver jar.  If this doesn't fix the problem please post your entire
> plan.
>
> thanks
> david jencks
>
>
> On Jun 3, 2005, at 2:45 PM, waimun wrote:
>
>> Hi...
>> I am still getting NoClassDefFound. Do I need any other configuration
>> other than creating the directory structure you have mentioned.
>>
>> Thanks.
>> --
>> waimun
>>
>> On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
>> >
>> >
>> >
>> > Hi!!
>> >
>> > I think that you have to copy the driver to the repository
>> directory. You
>> > have to create a folder in the repository of the M4 instalation
>> folder, for
>> > example oracle. inside that folder, create another one with the
>> name jar,
>> > and copy the driver there.
>> >
>> > repostory/oracle/jars/your driver.
>> >
>> > Hope this helps!!
>> >
>> > Katia
>> >
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

David Jencks
can you post the db plan, the web app plan, and the code that you use
to get a db connection?

thanks
david jencks

On Jun 8, 2005, at 4:00 PM, waimun wrote:

> I am modifying the default-database-plan by inserting another
> dependency for the oracle jar directory. I feel that this might be
> wrong as I only need the jar file to be exposed in the web context. I
> am still getting the NoClassDefFound. How do I do this in the plan
> file?
>
> Thanks,
> waimun
>
> On Jun 3, 2005, at 7:11 PM, David Jencks wrote:
>
>> I can't find your previous posts.
>> You need to include a dependency to the driver jar in your plan.  For
>> instance, default-database-plan has dependencies on the axion jar and
>> 3 other jars it needs.  For oracle you should need only the oracle
>> driver jar.  If this doesn't fix the problem please post your entire
>> plan.
>>
>> thanks
>> david jencks
>>
>>
>> On Jun 3, 2005, at 2:45 PM, waimun wrote:
>>
>>> Hi...
>>> I am still getting NoClassDefFound. Do I need any other
>>> configuration other than creating the directory structure you have
>>> mentioned.
>>>
>>> Thanks.
>>> --
>>> waimun
>>>
>>> On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
>>> >
>>> >
>>> >
>>> > Hi!!
>>> >
>>> > I think that you have to copy the driver to the repository
>>> directory. You
>>> > have to create a folder in the repository of the M4 instalation
>>> folder, for
>>> > example oracle. inside that folder, create another one with the
>>> name jar,
>>> > and copy the driver there.
>>> >
>>> > repostory/oracle/jars/your driver.
>>> >
>>> > Hope this helps!!
>>> >
>>> > Katia
>>> >
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Katia Aresti Gonzalez
In reply to this post by Waimun Yeow

Hi!!

I think that this might help you. To deploy the connection pool just for a web module, the only diference between a pool deployed as a server scope is how you deploy the database-plan.xml.

The oracle driver must be at the repository/oracle/jars/ on the installation directory. You have to do a new folder and copy the driver there. Then, you write a oracle-plan.xml.

If you want to deploy as server scope, then you have to deploy like this:

java -jar bin/deployer.jar deploy oracle-plan.xml \

repository/tranql/rars/tranql-connector-1.0-M3.rar

 

If you want to deploy as application scope you have to include at the EAR the oracle-plan.xml, and add this reference at geronimo-application.xml:

 

META-INF/geronimo-application.xml

 

<application

xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"

configId="MyApplication">

<module>

<connector>tranql-connector-1.0-SNAPSHOT.rar</connector>

<alt-dd>database-plan.xml</alt-dd>

</module>

</application>

 

If you want to deploy just as web app scope, then when you deploy you web app, what you have to do is include on the geronimo-jetty.xml the oracle-plan.xml and a external reference to the tranql.rar, and deploy the web app normal. Like this:

WEB-INF/geronimo-jetty.xml

<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty"

xmlns:naming="http://geronimo.apache.org/xml/ns/naming"

...>

...

<resource>

<external-rar>

tranql/rars/tranql-connector-1.0-SNAPSHOT.rar

</external-rar>

<connector>

       ?here oracle-plan.xml?

</connector>

</resource>

</web-app>

Hope this helps.

Katia




>From: waimun <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: Location of Database driver
>Date: Wed, 8 Jun 2005 19:00:43 -0400
>
>I am modifying the default-database-plan by inserting another
>dependency for the oracle jar directory. I feel that this might be
>wrong as I only need the jar file to be exposed in the web context.
>I am still getting the NoClassDefFound. How do I do this in the plan
>file?
>
>Thanks,
>waimun
>
>On Jun 3, 2005, at 7:11 PM, David Jencks wrote:
>
>>I can't find your previous posts.
>>You need to include a dependency to the driver jar in your plan.  
>>For instance, default-database-plan has dependencies on the axion
>>jar and 3 other jars it needs.  For oracle you should need only the
>>oracle driver jar.  If this doesn't fix the problem please post
>>your entire plan.
>>
>>thanks
>>david jencks
>>
>>
>>On Jun 3, 2005, at 2:45 PM, waimun wrote:
>>
>>>Hi...
>>>I am still getting NoClassDefFound. Do I need any other
>>>configuration other than creating the directory structure you have
>>>mentioned.
>>>
>>>Thanks.
>>>--
>>>waimun
>>>
>>>On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
>>> >
>>> >
>>> >
>>> > Hi!!
>>> >
>>> > I think that you have to copy the driver to the repository
>>>directory. You
>>> > have to create a folder in the repository of the M4 instalation
>>>folder, for
>>> > example oracle. inside that folder, create another one with the
>>>name jar,
>>> > and copy the driver there.
>>> >
>>> > repostory/oracle/jars/your driver.
>>> >
>>> > Hope this helps!!
>>> >
>>> > Katia
>>> >
>>>
>>
>


Acepta el reto MSN Premium: Env?a hasta 500 megas diarios de fotos desde Hotmail. Desc?rgalo y pru?balo 2 meses gratis.
Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Waimun Yeow
In reply to this post by David Jencks
Hi... Sorry for the late reply.

The part that is causing the error is the missing oracle.jdbc.OracleDriver.
As you can see below. I do not have a web app plan, and am not sure what it
is. If you can point me to any page, then it will be great. Is a web app plan
necessary? Let's say I have a .war from a vendor, and I want to deploy it
right away, just as it is, do I need to write a plan?

My db plan as follows (I am modifying the default-database-plan):

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
    version="1.5"
    configId="org/apache/geronimo/DefaultDatabase"
    parentId="org/apache/geronimo/Server">
    <dependency>
        <uri>oracle10g/jars/ojdbc14.jar</uri>
    </dependency>
</connector>

public void registerDriver() {
try {
//Context initCtx = new InitialContext();
//ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/LcssDB");
DriverManager.registerDriver(new OracleDriver());
}  catch (Exception ex) {
ex.printStackTrace();
}
}

I am not understanding the db plan even though you have told me to
include a dependency. I want the webapp just to do plain JDBC; just
getConnection(), that's all.

Thanks,
--
waimun

On 6/8/05, David Jencks <[hidden email]> wrote:

> can you post the db plan, the web app plan, and the code that you use
> to get a db connection?
>
> thanks
> david jencks
>
> On Jun 8, 2005, at 4:00 PM, waimun wrote:
>
> > I am modifying the default-database-plan by inserting another
> > dependency for the oracle jar directory. I feel that this might be
> > wrong as I only need the jar file to be exposed in the web context. I
> > am still getting the NoClassDefFound. How do I do this in the plan
> > file?
> >
> > Thanks,
> > waimun
> >
> > On Jun 3, 2005, at 7:11 PM, David Jencks wrote:
> >
> >> I can't find your previous posts.
> >> You need to include a dependency to the driver jar in your plan.  For
> >> instance, default-database-plan has dependencies on the axion jar and
> >> 3 other jars it needs.  For oracle you should need only the oracle
> >> driver jar.  If this doesn't fix the problem please post your entire
> >> plan.
> >>
> >> thanks
> >> david jencks
> >>
> >>
> >> On Jun 3, 2005, at 2:45 PM, waimun wrote:
> >>
> >>> Hi...
> >>> I am still getting NoClassDefFound. Do I need any other
> >>> configuration other than creating the directory structure you have
> >>> mentioned.
> >>>
> >>> Thanks.
> >>> --
> >>> waimun
> >>>
> >>> On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
> >>> >
> >>> >
> >>> >
> >>> > Hi!!
> >>> >
> >>> > I think that you have to copy the driver to the repository
> >>> directory. You
> >>> > have to create a folder in the repository of the M4 instalation
> >>> folder, for
> >>> > example oracle. inside that folder, create another one with the
> >>> name jar,
> >>> > and copy the driver there.
> >>> >
> >>> > repostory/oracle/jars/your driver.
> >>> >
> >>> > Hope this helps!!
> >>> >
> >>> > Katia
> >>> >
> >>>
> >>
> >
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Katia Aresti Gonzalez

I think that you need a external plan. You need to write a plan for the new service, and select the proper scope, because you are adding a new service to Geronimo, y new configuration... This is what i have always do. If you use the default plan, if its possible to do it like that, you should undeploy and deploy again the xml file (I have done this but with the system-jms-plan, adding a new resource to the jms server)

hope this helps :-)

Katia




>From: waimun <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: Location of Database driver
>Date: Sat, 11 Jun 2005 16:14:20 -0400 (EDT)
>
>Hi... Sorry for the late reply.
>
>The part that is causing the error is the missing oracle.jdbc.OracleDriver.
>As you can see below. I do not have a web app plan, and am not sure what it
>is. If you can point me to any page, then it will be great. Is a web app plan
>necessary? Let's say I have a .war from a vendor, and I want to deploy it
>right away, just as it is, do I need to write a plan?
>
>My db plan as follows (I am modifying the default-database-plan):
>
><connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
>     version="1.5"
>     configId="org/apache/geronimo/DefaultDatabase"
>     parentId="org/apache/geronimo/Server">
>     <dependency>
>         <uri>oracle10g/jars/ojdbc14.jar</uri>
>     </dependency>
></connector>
>
>public void registerDriver() {
>try {
>//Context initCtx = new InitialContext();
>//ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/LcssDB");
>DriverManager.registerDriver(new OracleDriver());
>}  catch (Exception ex) {
>ex.printStackTrace();
>}
>}
>
>I am not understanding the db plan even though you have told me to
>include a dependency. I want the webapp just to do plain JDBC; just
>getConnection(), that's all.
>
>Thanks,
>--
>waimun
>
>On 6/8/05, David Jencks <[hidden email]> wrote:
> > can you post the db plan, the web app plan, and the code that you use
> > to get a db connection?
> >
> > thanks
> > david jencks
> >
> > On Jun 8, 2005, at 4:00 PM, waimun wrote:
> >
> > > I am modifying the default-database-plan by inserting another
> > > dependency for the oracle jar directory. I feel that this might be
> > > wrong as I only need the jar file to be exposed in the web context. I
> > > am still getting the NoClassDefFound. How do I do this in the plan
> > > file?
> > >
> > > Thanks,
> > > waimun
> > >
> > > On Jun 3, 2005, at 7:11 PM, David Jencks wrote:
> > >
> > >> I can't find your previous posts.
> > >> You need to include a dependency to the driver jar in your plan.  For
> > >> instance, default-database-plan has dependencies on the axion jar and
> > >> 3 other jars it needs.  For oracle you should need only the oracle
> > >> driver jar.  If this doesn't fix the problem please post your entire
> > >> plan.
> > >>
> > >> thanks
> > >> david jencks
> > >>
> > >>
> > >> On Jun 3, 2005, at 2:45 PM, waimun wrote:
> > >>
> > >>> Hi...
> > >>> I am still getting NoClassDefFound. Do I need any other
> > >>> configuration other than creating the directory structure you have
> > >>> mentioned.
> > >>>
> > >>> Thanks.
> > >>> --
> > >>> waimun
> > >>>
> > >>> On 6/1/05, Katia Aresti Gonzalez <[hidden email]> wrote:
> > >>> >
> > >>> >
> > >>> >
> > >>> > Hi!!
> > >>> >
> > >>> > I think that you have to copy the driver to the repository
> > >>> directory. You
> > >>> > have to create a folder in the repository of the M4 instalation
> > >>> folder, for
> > >>> > example oracle. inside that folder, create another one with the
> > >>> name jar,
> > >>> > and copy the driver there.
> > >>> >
> > >>> > repostory/oracle/jars/your driver.
> > >>> >
> > >>> > Hope this helps!!
> > >>> >
> > >>> > Katia
> > >>> >
> > >>>
> > >>
> > >
> >
> >
>
>


Encuentra una aventura, un romance o al amor de tu vida. Date de alta gratis.
Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Waimun Yeow
I did that too. I copied the plan definition to a file named oracle-database-plan.xml,
and deploy it using the deploytool. But still unable to get a connection using jdbc.
What do you mean by "select the proper scope"? You mentioned writing a new plan
for the new service: do you refer to the db plan or web app plan. Can you
copy/paste a portion of the web plan that you think would work for this case.

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
    version="1.5"
    configId="org/apache/geronimo/DefaultDatabase"
    parentId="org/apache/geronimo/Server">
    <dependency>
        <uri>oracle10g/jars/ojdbc14.jar</uri>
    </dependency>
</connector>

I hope I can understand your spanish manual that you have published. At least it would have help me in understanding
more about geronimo. You did so well. I am impressed by the content and its verbosity. (I only took two spanish classes in college, but it is not enough for me to understand it entirely.)
Is there an english translation or its equivlent?

On 6/11/05, Katia Aresti Gonzalez <[hidden email]> wrote:

>
>  
>
> I think that you need a external plan. You need to write a plan for the new
> service, and select the proper scope, because you are adding a new service
> to Geronimo, y new configuration... This is what i have always do. If you
> use the default plan, if its possible to do it like that, you should
> undeploy and deploy again the xml file (I have done this but with the
> system-jms-plan, adding a new resource to the jms server)
>
> hope this helps :-)
>
> Katia
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Location of Database driver

Katia Aresti Gonzalez


Thank you about what you have said. Well, english translation no, because I did finish the documentation 15th may more or less. Aaron?s book its very good, it has help me a lot in some things, but well, its more for people very used to aplication servers, and i did understand things on the end xD I most looked at the wiki, irc and some articles on the net, for example in www.javaworld.net

If you want your database pool to be visible on all the server, you deploy just the oracle-plan.xml. If you want the pool to be visible just in you application (EAR), then deploy all togheter packed on the EAR, and if you want just to use it on a web application scope, i mean, just visible to a WAR single module, then need to put the connector on the geronimo-jetty.xml

WEB-INF/geronimo-jetty.xml

<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty"

xmlns:naming="http://geronimo.apache.org/xml/ns/naming"

...>

...

<resource>

<external-rar>

tranql/rars/tranql-connector-1.0-SNAPSHOT.rar

</external-rar>

<connector>

      <here the things of the mysql.plan>

</connector>

</resource>

</web-app>

 

This is the one you use if you deploy the resource, the oracle pool to all the server. Is the easyest way to start. Have you tryed to do it with MySQL?? Try first, and then see if works. And later try with oracle... I don know :-) David Jencks can help you more than me probably, I know just few things... They are developers hehe Just try to follow the steps of my documentation...

...

InitialContext ctx = new InitialContext();

DataSource ds = (DataSource)ctx.lookup("java:comp/env/MysqlDataSource");

Connection con = ds.getConnection();

Statement stmt = con.createStatement();

...

mysql-plan.xml

 <?xml version="1.0"?>

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"

   version="1.5" configId="MySQLPool" parentId="org/apache/geronimo/Server">

 

  <dependency>

    <uri>mysql/jars/mysql-connector-java-3.0.9-stable-bin.jar</uri>

  </dependency>

 

<resourceadapter>

    <outbound-resourceadapter>

      <connection-definition>

        <connectionfactory-interface>

          javax.sql.DataSource

        </connectionfactory-interface>

<connectiondefinition-instance>

          <name>MysqlDataSource</name>

          <config-property-setting name="UserName">

           root

          </config-property-setting>

          <config-property-setting name="Password">

            contrase?a

          </config-property-setting>

          <config-property-setting name="Driver">

            org.gjt.mm.mysql.Driver

          </config-property-setting>

          <config-property-setting name="ConnectionURL">

            jdbc:mysql://localhost:3306/test?autoReconnect=true

          </config-property-setting>

          <connectionmanager>

            <single-pool>

              <max-size>10</max-size>

              <min-size>2</min-size>

              <match-one/>

            </single-pool>

          </connectionmanager>

          <global-jndi-name>MySQLPool</global-jndi-name>

        </connectiondefinition-instance>

      </connection-definition>

    </outbound-resourceadapter>

  </resourceadapter>

</connector>




>From: waimun <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: Location of Database driver
>Date: Sat, 11 Jun 2005 18:01:16 -0400 (EDT)
>
>I did that too. I copied the plan definition to a file named oracle-database-plan.xml,
>and deploy it using the deploytool. But still unable to get a connection using jdbc.
>What do you mean by "select the proper scope"? You mentioned writing a new plan
>for the new service: do you refer to the db plan or web app plan. Can you
>copy/paste a portion of the web plan that you think would work for this case.
>
><connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
>     version="1.5"
>     configId="org/apache/geronimo/DefaultDatabase"
>     parentId="org/apache/geronimo/Server">
>     <dependency>
>         <uri>oracle10g/jars/ojdbc14.jar</uri>
>     </dependency>
></connector>
>
>I hope I can understand your spanish manual that you have published. At least it would have help me in understanding
>more about geronimo. You did so well. I am impressed by the content and its verbosity. (I only took two spanish classes in college, but it is not enough for me to understand it entirely.)
>Is there an english translation or its equivlent?
>
>On 6/11/05, Katia Aresti Gonzalez <[hidden email]> wrote:
> >
> >
> >
> > I think that you need a external plan. You need to write a plan for the new
> > service, and select the proper scope, because you are adding a new service
> > to Geronimo, y new configuration... This is what i have always do. If you
> > use the default plan, if its possible to do it like that, you should
> > undeploy and deploy again the xml file (I have done this but with the
> > system-jms-plan, adding a new resource to the jms server)
> >
> > hope this helps :-)
> >
> > Katia
> >
> >
>


Acepta el reto MSN Premium: incluye Antivirus y Firewall de McAffee. Desc?rgalo y pru?balo 2 meses gratis.