You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by mmquelo <mm...@gmail.com> on 2007/11/29 12:41:56 UTC

JNDI Persistence Manager on MySql DB via JBOSS 4.2.2

 
Hi Everybody!
 
It's making me waste all the day trying to set
"JNDIDatabasePersistenceManager" as mysql-repository persistence manager.
 
I show u the issue...
 
My Environment: Drools BRMS 4.0.3, JBossAS 4.2.2, MySql 5

In MySql I've got an empty "brms-db" schema.
 
In JBoss default workspace I've got the following datasource definition in
mysql-ds.xml:
 
<datasources>
 <local-tx-datasource>

  <jndi-name>jdbc/MySQLDB</jndi-name>
  <connection-url>jdbc:mysql:///brms-db</connection-url>
  <driver-class>com.mysql.jdbc.Driver </driver-class>
  <user-name>drools</user-name>
  <password>drools</password>
  <min-pool-size>5</min-pool-size>
  
  <max-pool-size>20</max-pool-size>
  
  <idle-timeout-minutes>5</idle-timeout-minutes>

  <exception-sorter-class-name>
  com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter
  </exception-sorter-class-name>
  
  <valid-connection-checker-class-name>
  com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker
  </valid-connection-checker-class-name>
  
 </local-tx-datasource>
</datasources> 
 
I've got the following persistence manager set-up in
<jboss_home>\bin\repository.xml:
 
 <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager">
  
  
  
     
 </PersistenceManager>  
 
 
Once I start JBoss I get back the following exception:
 
2007-11-28 16:48:36,766 INFO  [STDOUT] ERROR 28-11 16:48:36,743
(RepositoryImpl.java:initStartupWorkspaces:389)   Failed to initialize
workspace 'default'
javax.jcr.RepositoryException: Cannot instantiate persistence manager
org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager:
null: null
 at
org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1184)
 at org.apache.jackrabbit.core.RepositoryImpl.access$600
(RepositoryImpl.java:103)
 at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1758)
 at
org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:603)
 at
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:386)
 at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:293)
 at org.apache.jackrabbit.core.RepositoryImpl.create
(RepositoryImpl.java:584)
 at
org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:245)
...
 
I tried to replace
"org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager"
with "org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager"
and It DOES Work ....so I think we can exclude it's something related to
"JackRabbit API" null references...
 
Have U got any idea? 
What is the reason?
Did I miss any binding concernig the DataSource definition?????
Is it just impossible to bind JackRabbit to any datasources although JNDI
APIs do exist?????
Is it a matter related to the "weird JackRabbit JNDI client"??
Can I set the mysql DB as XA-datasource? Could it be a solution to this
issue?
 
Let me know.
 
Thank You again.
 
Massimiliano (Rome, IT)

-- 
View this message in context: http://www.nabble.com/JNDI-Persistence-Manager-on-MySql-DB-via-JBOSS-4.2.2-tf4896516.html#a14023752
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: JNDI Persistence Manager on MySql DB via JBOSS 4.2.2

Posted by mmquelo <mm...@gmail.com>.

Thank You.

I worked it out!


It's something up to JBoss 4.2.2

It seems that u can't define a jvm-local JNDI name to be used by jackrabbit.

U can find the solution here:
http://www.theserverside.com/discussions/thread.tss?thread_id=29813

Bye bye

Massi

(Sorry for my lack of english)






Thomas Mueller-6 wrote:
> 
> Hi,
> 
> The configuration looks OK. You have used pparam just in the mail? Why
> exactly?
> 
>> Did I miss any binding concerning the DataSource definition?????
> 
> Maybe!!!!! ;-)
> 
> Could you try if you can open the connection using JNDI in another
> way? The only way I know is to write a small code snippet, could be in
> a JSP page:
> 
>         InitialContext ic = new InitialContext();
>         DataSource dataSource = (DataSource)
> ic.lookup("java:jdbc/MySQLDB");
>         System.out.println("@@@Connection: " +
> dataSource.getConnection() + " @@@");
> 
> Or something similar. If you get "null", then there is something wrong.
> 
>> Is it a matter related to the "weird JackRabbit JNDI client"??
> 
> I wouldn't say weird, but when I have used JNDI with JBoss (a long
> time ago), configuration was difficult, and for some reason 'new
> InitialContext()' was not working (I don't remember why).
> 
>> Can I set the mysql DB as XA-datasource? Could it be a solution to this
>> issue?
> 
> I don't think so.
> 
> Regards,
> Thomas
> 
> 

-- 
View this message in context: http://www.nabble.com/JNDI-Persistence-Manager-on-MySql-DB-via-JBOSS-4.2.2-tf4896516.html#a14027435
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: JNDI Persistence Manager on MySql DB via JBOSS 4.2.2

Posted by Thomas Mueller <th...@gmail.com>.
Hi,

The configuration looks OK. You have used pparam just in the mail? Why exactly?

> Did I miss any binding concerning the DataSource definition?????

Maybe!!!!! ;-)

Could you try if you can open the connection using JNDI in another
way? The only way I know is to write a small code snippet, could be in
a JSP page:

        InitialContext ic = new InitialContext();
        DataSource dataSource = (DataSource) ic.lookup("java:jdbc/MySQLDB");
        System.out.println("@@@Connection: " +
dataSource.getConnection() + " @@@");

Or something similar. If you get "null", then there is something wrong.

> Is it a matter related to the "weird JackRabbit JNDI client"??

I wouldn't say weird, but when I have used JNDI with JBoss (a long
time ago), configuration was difficult, and for some reason 'new
InitialContext()' was not working (I don't remember why).

> Can I set the mysql DB as XA-datasource? Could it be a solution to this issue?

I don't think so.

Regards,
Thomas