jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phukan, Anit" <Anit_Phu...@intuit.com>
Subject JNDI datasource config help
Date Thu, 12 Nov 2009 01:21:36 GMT
Hi,

I am having some issues deploying my WAR on jboss server after I change
my repository.xml to include the JNDI lookup for the DB URL and Driver.

Following are the changes that I have done to change from a direct
JDBC.JTDS reference to a JNDI based lookup:

Repository.xml:
---------------
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
		 <param name="driver"
value="javax.naming.InitialContext" />
		 <param name="url"
value="java:comp/env/jdbc/DSName"/>
		 <param name="schemaObjectPrefix"
value="J_FS_${wsp.name}_" />
</FileSystem>

<PersistenceManager
	
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager>
		<param name="driver"
value="javax.naming.InitialContext"/>
		<param name="url" value="java:comp/env/jdbc/ DSName " />
		<param name="schema" value="mssql" />
		<param name="schemaObjectPrefix" value="J_V_PM_" />
		<param name="externalBLOBs" value="false" />
</PersistenceManager>

Jackrabbit Impl java class from where I am starting up the repository:
----------------------------------------------------------------------

InitialContext ctx = new InitialContext() ;
Repository repository = (Repository) ctx.lookup("java:comp/env/jdbc/
DSName") ;

session = repository.login(new
SimpleCredentials("username","password".toCharArray()));


jtds-ds.xml properties file which is placed at the
JBOSS_HOME/server/default/deploy folder:
----------------------------------------

<local-tx-datasource>
    <jndi-name>comp/env/jdbc/DSName</jndi-name>
 
<connection-url>jdbc:jtds:sqlserver://xxxxxx.xxx.xxxxx:1433/DBName</conn
ection-url>
    <rar-name>jackrabbit-jca-1.6.0.rar</rar-name>
    <connection-definition>javax.jcr.Repository</connection-definition>
    <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
    <user-name>xxxxx</user-name>
    <password>xxxxxx</password>
	<config-property name="homeDir"
type="java.lang.String">${JBOSS_HOME}/temp/jackrabbit</config-property>

    <config-property name="configFile"
type="java.lang.String">${JBOSS_HOME}/bin/repository.xml</config-propert
y>
	<config-property name="bindSessionToTransaction"
type="java.lang.Boolean">true</config-property>
  </local-tx-datasource>


This is the stack trace of the exception that I get while starting up
the server:

java.lang.NoClassDefFoundError: javax/jcr/RepositoryException
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
	at java.lang.Class.getConstructor0(Class.java:2699)
	at java.lang.Class.newInstance0(Class.java:326)
	at java.lang.Class.newInstance(Class.java:308)
	at
org.jboss.resource.connectionmanager.ManagedConnectionFactoryDeployment.
startService(ManagedConnectionFactoryDeployment.java:354)
	at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupp
ort.java:376)
	at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBean
Support.java:322)
	at
org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSu
pport.java:124)
	at
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
	at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at
org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:18
9)
	at $Proxy38.start(Unknown Source)

DEPLOYMENTS IN ERROR:
  Deployment
"vfsfile:/C:/jboss-5.1.0.GA/server/default/deploy/jtds-ds.xml" is in
error due to the following reason(s): java.lang.ClassNotFoundException:
javax.jcr.RepositoryException from BaseClassLoader@24ad8


I am not sure if I am missing some jndi related parameter setting
somewhere, and why the class loader is unable to load the
RepositoryException class even though all related jars are present.

Any advice/help would be appreciated.

Thanks
Anit



-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Wednesday, November 11, 2009 2:12 AM
To: users@jackrabbit.apache.org
Subject: Re: 1.0 or 2.0

On Wed, Nov 11, 2009 at 01:03, Phukan, Anit <Anit_Phukan@intuit.com>
wrote:
> Has anyone configured the repository.xml to use JNDI look up for
making DB connections instead of directly specifying DB URLs with
userid/password in the repository.xml?

See http://wiki.apache.org/jackrabbit/UsingJNDIDataSource

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message