You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Per Newgro <pe...@gmx.ch> on 2006/11/30 13:51:14 UTC

HOWTO OpenEJB and HSqlDB

Hi *,

i try to build my j2ee appl as a standalone test version. I would like to 
create it with embedded openejb and embedded hsqldb.

The openejb (ejb) part is done.

Now i try to setup the database. I put a copy of hsqldb.jar into openejb/lib.
But my problem is that i do not know howto deploy the database by jndi.

Lets say my jndi deploy name is APPLDB. It will be looked up by my Persistence 
layer.

I've added to openejb.conf
<Connector id="APPLDB">
    #  HSqlDB example
    #
    #  This connector does work as is, the drivers are shipped
    #  with every OpenEJB distribution and should be in the
    #  OPENEJB_HOME/lib directory.
    #
    #  Information on HsqlDB can be found at:
    #  http://www.hsqldb.org

    JdbcDriver   org.hsqldb.jdbcDriver
    JdbcUrl      jdbc:hsql:file:conf/default.hsql_database.conf
    UserName     sa
    Password
</Connector>

ive put a conf/default.hsql_database.conf
#
# the path and file name of the first database file to use
#
server.database.0=database/myDB
#
#lowercase server alias for the first database file
#
server.dbname.0=""
#
#SqlTool urlid used by UNIX init script. (This property is not used if your 
are running Server/Webserver on a
#platform other than UNIX, or of you are not using our UNIX init script).
#
server.urlid.0=NONE
#
#no extensive messages displayed on console
#
server.silent=true
#
#JDBC trace messages displayed on console2~
#
server.trace=false

But all i get is
ERROR:  Testing driver failed.  
[jdbc:hsql:file:conf/default.hsql_database.conf]  Could not obtain a physical 
JDBC connection from the Driv
erManager.
The error message was:
Could not obtain a physical JDBC connection from the DriverManager
Possible cause:
        o JDBC driver classes are not available to OpenEJB
        o Relative paths are not resolved properly
FATAL:  OpenEJB has encountered a fatal error and cannot be started: Assembler 
failed to build the container system.
org.openejb.OpenEJBException: Could not initialize Connector 'APPLDB'.: null
        at 
org.openejb.alt.assembler.classic.AssemblerTool.assembleManagedConnectionFactory(AssemblerTool.java:215)
        at 
org.openejb.alt.assembler.classic.Assembler.buildContainerSystem(Assembler.java:294)
        at 
org.openejb.alt.assembler.classic.Assembler.build(Assembler.java:153)
        at org.openejb.OpenEJB.init(OpenEJB.java:247)
        at org.openejb.OpenEJB.init(OpenEJB.java:129)
        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:585)
        at org.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:76)
        at 
org.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:86)
        at 
org.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:72)
        at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at myown.common.ejb.EJBHelperBase.<init>(EJBHelperBase.java:41)
Root cause:
java.lang.NullPointerException
        at 
org.openejb.resource.jdbc.JdbcManagedConnectionFactory.init(JdbcManagedConnectionFactory.java:91)
        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:585)
        at 
org.openejb.alt.assembler.classic.AssemblerTool.applyProperties(AssemblerTool.java:324)
        at 
org.openejb.alt.assembler.classic.AssemblerTool.assembleManagedConnectionFactory(AssemblerTool.java:212)
        at 
org.openejb.alt.assembler.classic.Assembler.buildContainerSystem(Assembler.java:294)
        at 
org.openejb.alt.assembler.classic.Assembler.build(Assembler.java:153)
        at org.openejb.OpenEJB.init(OpenEJB.java:247)
        at org.openejb.OpenEJB.init(OpenEJB.java:129)
        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:585)
        at org.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:76)
        at 
org.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:86)
        at 
org.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:72)
        at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at myown.common.ejb.EJBHelperBase.<init>(EJBHelperBase.java:41)

Is there a howto or an example for my problem? I didnt found anything.
Maybe someone can help me

Cheers
Per

Re: HOWTO OpenEJB and HSqlDB

Posted by Per Newgro <pe...@gmx.ch>.
Hi David,

firstly: Thank you for support. It works.

I've never appreciated that its not a standard access. For me it looks clear 
to define a datasource by name and access it by java:name. But you absolutly 
right. I use java to create vendor and plattform undependend appls. And i 
dont want to use vendor specific things. But as i said before, i've never 
tried to use the appl with another AS. So it hasn't come to my mind until 
now :-).

The second datasource will be treated different in my code. I determine a 
unique id which never has to be determined twice. So the noTx datasource has 
autocommit true in connection usage. But its still the same physical 
datasource.

Thanks alot for help
Per

Re: HOWTO OpenEJB and HSqlDB

Posted by David Blevins <da...@visi.com>.
On Dec 2, 2006, at 3:47 PM, David Blevins wrote:

>
> On Dec 2, 2006, at 2:57 PM, David Blevins wrote:
>
>> Hi Per, the data you've posted helps quite a bit.  I think I have  
>> your answer....
>>
>> On Dec 2, 2006, at 12:55 AM, Per Newgro wrote:
>>
>>> I get the following exception
>>> javax.naming.NameNotFoundException: Name "java:/APPLDB" not found.
>>>         at
>>> org.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:184)
>>>         at org.openejb.core.ivm.naming.IvmContext.lookup 
>>> (IvmContext.java:147)
>>>         at javax.naming.InitialContext.lookup(InitialContext.java: 
>>> 351)
>>>
>>> if i do the following:
>>> DataSource db = (DataSource) myInitialContext.lookup("java:/ 
>>> APPLDB");
>
> Just a note on what I mention in my previous email below.  The  
> reason "java:/APPLDB" works in JBoss is they are letting you lookup  
> a datasource you haven't declared a reference to in your ejb- 
> jar.xml.  This is completely against the spec and results in non- 
> portable apps.  I will note you can do this OpenEJB too -- we're  
> not the kind to tell you what you can and can't do.  The name you  
> use to lookup a non-declared datasource is:
>
>  new InitialContext().lookup("java:openejb/connector/Default JDBC  
> Database");
>

Looks like I'm getting 1.x and 3.x confused.  This was added in 3.x  
but not in 1.x.  The tree exists in 1.x, but we didn't allow it to be  
exposed to beans till 3.x.

-David





Re: HOWTO OpenEJB and HSqlDB

Posted by David Blevins <da...@visi.com>.
On Dec 2, 2006, at 2:57 PM, David Blevins wrote:

> Hi Per, the data you've posted helps quite a bit.  I think I have  
> your answer....
>
> On Dec 2, 2006, at 12:55 AM, Per Newgro wrote:
>
>> I get the following exception
>> javax.naming.NameNotFoundException: Name "java:/APPLDB" not found.
>>         at
>> org.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:184)
>>         at org.openejb.core.ivm.naming.IvmContext.lookup 
>> (IvmContext.java:147)
>>         at javax.naming.InitialContext.lookup(InitialContext.java: 
>> 351)
>>
>> if i do the following:
>> DataSource db = (DataSource) myInitialContext.lookup("java:/APPLDB");

Just a note on what I mention in my previous email below.  The reason  
"java:/APPLDB" works in JBoss is they are letting you lookup a  
datasource you haven't declared a reference to in your ejb-jar.xml.   
This is completely against the spec and results in non-portable  
apps.  I will note you can do this OpenEJB too -- we're not the kind  
to tell you what you can and can't do.  The name you use to lookup a  
non-declared datasource is:

  new InitialContext().lookup("java:openejb/connector/Default JDBC  
Database");

or in your case:

  new InitialContext().lookup("java:openejb/connector/APPLDB");

So we do support this non-standard practice, but we put it under  
"java:openejb" so you are absolutely aware you are using a vendor  
specific feature, rather than putting them at "java:/APPLDB" which  
someone who doesn't read the spec everyday would totally think is a  
fine, portable, thing to do when in fact it's a vendor lock-in.

We don't really encourage people to use it as there's little upside  
in it for you, but it is supported.  You'll notice that the path  
"openejb/connector/[ConnectorName]" also matches the exact xml  
structure of the openejb configuration file:

  <openejb>
    ...
    <Connector id="APPLDB">
      ...

You can actually lookup a number of things from the "java:openejb"  
namespace, though we don't advertise it or really encourage it.  But  
you can if you like :)

-David


> You've got everything you need except you'll want to add the ejb  
> spec required resource refs to your ejb-jar.xml file like so:
>
>       <session>
>          ...
>             <resource-ref>
>                 <res-ref-name>APPLDB</res-ref-name>
>                 <res-type>javax.sql.DataSource</res-type>
>                 <res-auth>Container</res-auth>
>             </resource-ref>
>             <resource-ref>
>                 <res-ref-name>APPLDBnoTx</res-ref-name>
>                 <res-type>javax.sql.DataSource</res-type>
>                 <res-auth>Container</res-auth>
>             </resource-ref>
>       </session>
>
> Then you'll be able to look them up from that bean via "java:comp/ 
> env/APPLDB" and "java:comp/env/APPLDBnoTx"
>
> On a slightly different note, I'm curious why you'd have two  
> connectors with the exact same configuration.
>
> -David
>
>
>
>


Re: HOWTO OpenEJB and HSqlDB

Posted by David Blevins <da...@visi.com>.
Hi Per, the data you've posted helps quite a bit.  I think I have  
your answer....

On Dec 2, 2006, at 12:55 AM, Per Newgro wrote:

> I get the following exception
> javax.naming.NameNotFoundException: Name "java:/APPLDB" not found.
>         at
> org.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:184)
>         at org.openejb.core.ivm.naming.IvmContext.lookup 
> (IvmContext.java:147)
>         at javax.naming.InitialContext.lookup(InitialContext.java:351)
>
> if i do the following:
> DataSource db = (DataSource) myInitialContext.lookup("java:/APPLDB");

...

> file: openejb.conf
> ...
> <Connector id="APPLDB">
...
>     JdbcDriver   org.hsqldb.jdbcDriver
>     JdbcUrl      jdbc:hsqldb:file:conf/default.hsql_database.conf
>     UserName     sa
>     Password
> </Connector>
>
> <Connector id="APPLDBnoTx">
...
>     JdbcDriver   org.hsqldb.jdbcDriver
>     JdbcUrl      jdbc:hsqldb:file:conf/default.hsql_database.conf
>     UserName     sa
>     Password
> </Connector>
> ...

Data sources configured in your openejb.conf... Check.

>
>
> file: openejb-jar.xml
> <?xml version="1.0"?>
> <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
>   <ejb-deployment ejb-name="ExportDatabaseUC" deployment- 
> id="ExportDatabaseUC"
>                                    container-id="Default Stateful  
> Container">
>     <resource-link res-ref-name="APPLDB" res-id="APPLDB"/>
>     <resource-link res-ref-name="APPLDBnoTx" res-id="APPLDBnoTx"/>
>   </ejb-deployment>
> </openejb-jar>

Resource refs mapped to configured openejb.conf data sources... Check.
...
>
> file: ejb-jar.xml
> <ejb-jar>
>   <description></description>
>   <enterprise-beans>
>     <session>
>       <ejb-name>ExportDatabaseUC</ejb-name>
>       <home>my.common.ejb.UseCaseHome</home>
>       <remote>my.common.ejb.UseCaseRemote</remote>
>       <ejb-class>my.misc.backup.ejb.ExportDatabaseUcEJB</ejb-class>
>       <session-type>Stateful</session-type>
>       <transaction-type>Bean</transaction-type>
>     </session>
>   </enterprise-beans>
> </ejb-jar>

Resource refs in your ejb-jar.xml file... ERROR ERROR :)

You've got everything you need except you'll want to add the ejb spec  
required resource refs to your ejb-jar.xml file like so:

       <session>
          ...
             <resource-ref>
                 <res-ref-name>APPLDB</res-ref-name>
                 <res-type>javax.sql.DataSource</res-type>
                 <res-auth>Container</res-auth>
             </resource-ref>
             <resource-ref>
                 <res-ref-name>APPLDBnoTx</res-ref-name>
                 <res-type>javax.sql.DataSource</res-type>
                 <res-auth>Container</res-auth>
             </resource-ref>
       </session>

Then you'll be able to look them up from that bean via "java:comp/env/ 
APPLDB" and "java:comp/env/APPLDBnoTx"

On a slightly different note, I'm curious why you'd have two  
connectors with the exact same configuration.

-David





Re: HOWTO OpenEJB and HSqlDB

Posted by Per Newgro <pe...@gmx.ch>.
Hi Mohammad,

sorry but i dont see the light. I think my datasource is not deployed, but i 
dont get howto do it. I've already investigated the forum and mailing list 
and the examples i've found at search engine.

I get the following exception
javax.naming.NameNotFoundException: Name "java:/APPLDB" not found.
        at 
org.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:184)
        at org.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:147)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)

if i do the following:
DataSource db = (DataSource) myInitialContext.lookup("java:/APPLDB");


file: default.hsql_database.conf
#
# the path and file name of the first database file to use
#
server.database.0=database/Kollektiv
#
#lowercase server alias for the first database file
#
server.dbname.0=""
#
#SqlTool urlid used by UNIX init script. (This property is not used if your 
are running Server/Webserver on a
#platform other than UNIX, or of you are not using our UNIX init script).
#
server.urlid.0=NONE
#
#no extensive messages displayed on console
#
server.silent=true
#
#JDBC trace messages displayed on console
#
server.trace=false


file: openejb.conf
...
<Connector id="APPLDB">
    #  HSqlDB example
    #
    #  This connector does work as is, the drivers are shipped
    #  with every OpenEJB distribution and should be in the
    #  OPENEJB_HOME/lib directory.
    #
    #  Information on HsqlDB can be found at:
    #  http://www.hsqldb.org

    JdbcDriver   org.hsqldb.jdbcDriver
    JdbcUrl      jdbc:hsqldb:file:conf/default.hsql_database.conf
    UserName     sa
    Password
</Connector>

<Connector id="APPLDBnoTx">
    #  HSqlDB example
    #
    #  This connector does work as is, the drivers are shipped
    #  with every OpenEJB distribution and should be in the
    #  OPENEJB_HOME/lib directory.
    #
    #  Information on HsqlDB can be found at:
    #  http://www.hsqldb.org

    JdbcDriver   org.hsqldb.jdbcDriver
    JdbcUrl      jdbc:hsqldb:file:conf/default.hsql_database.conf
    UserName     sa
    Password
</Connector>
...


file: openejb-jar.xml
<?xml version="1.0"?>
<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
  <ejb-deployment ejb-name="ExportDatabaseUC" deployment-id="ExportDatabaseUC" 
                                   container-id="Default Stateful Container">
    <resource-link res-ref-name="APPLDB" res-id="APPLDB"/>
    <resource-link res-ref-name="APPLDBnoTx" res-id="APPLDBnoTx"/>
  </ejb-deployment>
</openejb-jar>


file: ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 
2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
  <description></description>
  <enterprise-beans>
    <session>
      <ejb-name>ExportDatabaseUC</ejb-name>
      <home>my.common.ejb.UseCaseHome</home>
      <remote>my.common.ejb.UseCaseRemote</remote>
      <ejb-class>my.misc.backup.ejb.ExportDatabaseUcEJB</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Bean</transaction-type>
    </session>
  </enterprise-beans>
</ejb-jar>

Cheers
Per

Re: HOWTO OpenEJB and HSqlDB

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Per...

Sorry this reply may not be enough but I am not at home and  don't have time
to make a full reply, but I think this may help. Take a look at these two
files

http://svn.apache.org/repos/asf/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/resources/default.openejb.conf

http://svn.apache.org/repos/asf/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/openejb-jar.xml

And I want you to notice how "*Default JDBC Database*" connector, has been
defined in the first file and referenced in the second one. I hope again
this will answer your question.


On 12/1/06, Per Newgro <pe...@gmx.ch> wrote:

> Hi David,
>
> > I think this might be a path problem.  You can try putting the
> > absolute file path in your jdbc url like so:
> >
> > jdbc:hsql:file:/home/pnewgro/myapp/conf/default.hsql_database.conf
>
> Yes. It was a path problem. But not the pathname was the cause. It has to
> be
> jdbc:hsqldb:file:/home/pnewgro/myapp/conf/default.hsql_database.conf
>             ^^
>
> >
> > Or you can grab this build i just made you and give it a try.  I
> > added a hack for HSqlDB that ensures the file path conf/
> > default.hsql_database.conf will be resolved relative to openejb.home.
> >
> >   http://people.apache.org/~dblevins/openejb/v1.1-20061130/
> >
> I took this version and wondered that nothing changed. But then i took
> KDiff3
> and surprise, surprise : "No suitable driver . 0 . 08001". That was new
> :-)
>
> Ok, i investigated for this and found (by try and error) the above
> solution
> (hsqldb).
> But now i run into the problem, that i can not find a datasource by
> lookup. I
> get a javax.naming.NameNotFoundException: Name "java:/APPLDB" not found.
> Names in openejb.conf and in lookup match (already checked). Is it
> possible to
> obtain the datasource by lookup? Do i have to add other elements to a
> config?
> In jboss i have to deploy the dataset.xml in the appl.ear. So maybe i have
> to
> add the datasource to my openejb-jar.xml?
>
> As i said before thanks for helping me.
> Cheers
> Per
>



-- 
Thanks
- Mohammad Nour

Re: HOWTO OpenEJB and HSqlDB

Posted by Per Newgro <pe...@gmx.ch>.
Hi David,

> I think this might be a path problem.  You can try putting the
> absolute file path in your jdbc url like so:
>
> jdbc:hsql:file:/home/pnewgro/myapp/conf/default.hsql_database.conf

Yes. It was a path problem. But not the pathname was the cause. It has to be
jdbc:hsqldb:file:/home/pnewgro/myapp/conf/default.hsql_database.conf
             ^^

>
> Or you can grab this build i just made you and give it a try.  I
> added a hack for HSqlDB that ensures the file path conf/
> default.hsql_database.conf will be resolved relative to openejb.home.
>
>   http://people.apache.org/~dblevins/openejb/v1.1-20061130/
>
I took this version and wondered that nothing changed. But then i took KDiff3 
and surprise, surprise : "No suitable driver . 0 . 08001". That was new :-)

Ok, i investigated for this and found (by try and error) the above solution 
(hsqldb).
But now i run into the problem, that i can not find a datasource by lookup. I 
get a javax.naming.NameNotFoundException: Name "java:/APPLDB" not found.
Names in openejb.conf and in lookup match (already checked). Is it possible to 
obtain the datasource by lookup? Do i have to add other elements to a config? 
In jboss i have to deploy the dataset.xml in the appl.ear. So maybe i have to 
add the datasource to my openejb-jar.xml?

As i said before thanks for helping me.
Cheers
Per

Re: HOWTO OpenEJB and HSqlDB

Posted by David Blevins <da...@visi.com>.
On Nov 30, 2006, at 4:51 AM, Per Newgro wrote:

> I've added to openejb.conf
> <Connector id="APPLDB">
>     #  HSqlDB example
>     #
>     #  This connector does work as is, the drivers are shipped
>     #  with every OpenEJB distribution and should be in the
>     #  OPENEJB_HOME/lib directory.
>     #
>     #  Information on HsqlDB can be found at:
>     #  http://www.hsqldb.org
>
>     JdbcDriver   org.hsqldb.jdbcDriver
>     JdbcUrl      jdbc:hsql:file:conf/default.hsql_database.conf
>     UserName     sa
>     Password
> </Connector>

I think this might be a path problem.  You can try putting the  
absolute file path in your jdbc url like so:

jdbc:hsql:file:/home/pnewgro/myapp/conf/default.hsql_database.conf

Or you can grab this build i just made you and give it a try.  I  
added a hack for HSqlDB that ensures the file path conf/ 
default.hsql_database.conf will be resolved relative to openejb.home.

  http://people.apache.org/~dblevins/openejb/v1.1-20061130/

Hope one of these suggestions helps.

-David


Re: HOWTO OpenEJB and HSqlDB

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Per...

This is my duty :), I will do my best and ping you later :)



On 11/30/06, Per Newgro <pe...@gmx.ch> wrote:

> Thank you for support
>
> I use HSQLDB 1.8.0.7. Dowloaded today from hsqldb.org server.
>
> Per
>



-- 
Thanks
- Mohammad Nour

Re: HOWTO OpenEJB and HSqlDB

Posted by Per Newgro <pe...@gmx.ch>.
Thank you for support

I use HSQLDB 1.8.0.7. Dowloaded today from hsqldb.org server.

Per

Re: HOWTO OpenEJB and HSqlDB

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Per...

Which version of hsqldb.jar you are using ?, I am trying to recreate ur
situation to provide u with the right steps to accomplish ur task.



On 11/30/06, Per Newgro <pe...@gmx.ch> wrote:

> Hi *,
>
> i try to build my j2ee appl as a standalone test version. I would like to
> create it with embedded openejb and embedded hsqldb.
>
> The openejb (ejb) part is done.
>
> Now i try to setup the database. I put a copy of hsqldb.jar into
> openejb/lib.
> But my problem is that i do not know howto deploy the database by jndi.
>
> Lets say my jndi deploy name is APPLDB. It will be looked up by my
> Persistence
> layer.
>
> I've added to openejb.conf
> <Connector id="APPLDB">
>   # HSqlDB example
>   #
>   # This connector does work as is, the drivers are shipped
>   # with every OpenEJB distribution and should be in the
>   # OPENEJB_HOME/lib directory.
>   #
>   # Information on HsqlDB can be found at:
>   # http://www.hsqldb.org
>
>   JdbcDriver org.hsqldb.jdbcDriver
>   JdbcUrl jdbc:hsql:file:conf/default.hsql_database.conf
>   UserName sa
>   Password
> </Connector>
>
> ive put a conf/default.hsql_database.conf
> #
> # the path and file name of the first database file to use
> #
> server.database.0=database/myDB
> #
> #lowercase server alias for the first database file
> #
> server.dbname.0=""
> #
> #SqlTool urlid used by UNIX init script. (This property is not used if
> your
> are running Server/Webserver on a
> #platform other than UNIX, or of you are not using our UNIX init script).
> #
> server.urlid.0=NONE
> #
> #no extensive messages displayed on console
> #
> server.silent=true
> #
> #JDBC trace messages displayed on console2~
> #
> server.trace=false
>
> But all i get is
> ERROR: Testing driver failed.
> [jdbc:hsql:file:conf/default.hsql_database.conf] Could not obtain a
> physical
> JDBC connection from the Driv
> erManager.
> The error message was:
> Could not obtain a physical JDBC connection from the DriverManager
> Possible cause:
>   o JDBC driver classes are not available to OpenEJB
>   o Relative paths are not resolved properly
> FATAL: OpenEJB has encountered a fatal error and cannot be started:
> Assembler
> failed to build the container system.
> org.openejb.OpenEJBException: Could not initialize Connector 'APPLDB'.:
> null
>   at
>
> org.openejb.alt.assembler.classic.AssemblerTool.assembleManagedConnectionFactory
> (AssemblerTool.java:215)
>   at
> org.openejb.alt.assembler.classic.Assembler.buildContainerSystem(
> Assembler.java:294)
>   at
> org.openejb.alt.assembler.classic.Assembler.build(Assembler.java:153)
>   at org.openejb.OpenEJB.init(OpenEJB.java:247)
>   at org.openejb.OpenEJB.init(OpenEJB.java:129)
>   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:585)
>   at org.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:76)
>   at
> org.openejb.client.LocalInitialContextFactory.init(
> LocalInitialContextFactory.java:86)
>   at
> org.openejb.client.LocalInitialContextFactory.getInitialContext(
> LocalInitialContextFactory.java:72)
>   at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
>   at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>   at javax.naming.InitialContext.init(InitialContext.java:223)
>   at javax.naming.InitialContext.<init>(InitialContext.java:197)
>   at myown.common.ejb.EJBHelperBase.<init>(EJBHelperBase.java:41)
> Root cause:
> java.lang.NullPointerException
>   at
> org.openejb.resource.jdbc.JdbcManagedConnectionFactory.init(
> JdbcManagedConnectionFactory.java:91)
>   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:585)
>   at
> org.openejb.alt.assembler.classic.AssemblerTool.applyProperties(
> AssemblerTool.java:324)
>   at
>
> org.openejb.alt.assembler.classic.AssemblerTool.assembleManagedConnectionFactory
> (AssemblerTool.java:212)
>   at
> org.openejb.alt.assembler.classic.Assembler.buildContainerSystem(
> Assembler.java:294)
>   at
> org.openejb.alt.assembler.classic.Assembler.build(Assembler.java:153)
>   at org.openejb.OpenEJB.init(OpenEJB.java:247)
>   at org.openejb.OpenEJB.init(OpenEJB.java:129)
>   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:585)
>   at org.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:76)
>   at
> org.openejb.client.LocalInitialContextFactory.init(
> LocalInitialContextFactory.java:86)
>   at
> org.openejb.client.LocalInitialContextFactory.getInitialContext(
> LocalInitialContextFactory.java:72)
>   at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
>   at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>   at javax.naming.InitialContext.init(InitialContext.java:223)
>   at javax.naming.InitialContext.<init>(InitialContext.java:197)
>   at myown.common.ejb.EJBHelperBase.<init>(EJBHelperBase.java:41)
>
> Is there a howto or an example for my problem? I didnt found anything.
> Maybe someone can help me
>
> Cheers
> Per
>



-- 
Thanks
- Mohammad Nour