Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » carnotXaAuditTrailDataSource OracleXADataSource java.lang.InstantiationException(Stardust Spring configuration throws OracleXADataSource InstantiationException)
carnotXaAuditTrailDataSource OracleXADataSource java.lang.InstantiationException [message #743030] Fri, 21 October 2011 00:02 Go to next message
Srinivasan Iyer is currently offline Srinivasan Iyer
Messages: 35
Registered: October 2011
Member
I have created the Stardust schema in an Oracle database. When I start the Tomcat server in Eclipse the exception listed below is thrown.

Exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ag.carnot.db.jca.XaDataSourceMCF#15b0ff7' defined in ServletContext resource [/WEB-INF/config/ipp/spring/carnot-spring-context.xml]: Cannot resolve reference to bean 'carnotXaAuditTrailDataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'carnotXaAuditTrailDataSource' defined in ServletContext resource [/WEB-INF/config/ipp/spring/carnot-spring-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [oracle.jdbc.xa.OracleXADataSource]: Is it an abstract class?; nested exception is java.lang.InstantiationException

carnot.properties:
 AuditTrail.DataSource = java:comp/env/jdbc/AuditTrail.DataSource
 AuditTrail.Type = ORACLE9i
 AuditTrail.DriverClass = oracle.jdbc.OracleDriver
 AuditTrail.URL = jdbc:oracle:thin:@<hostname>:1521:<dbname>
 AuditTrail.Schema = <schemaname>
 AuditTrail.User = <username>
 AuditTrail.Password = <password>

server.xml:
  <GlobalNamingResources>
  <Resource
   name="jdbc/AuditTrail.DataSource"
   auth="Container"
   type="oracle.jdbc.xa.client.OracleXADataSource"
   factory="oracle.jdbc.pool.OracleDataSourceFactory"
   maxActive="50"
   maxIdle="10"
   maxWait="5000"
   user="<username>"
   password="<password>"
   defaultAutoCommit="false"
   driverClassName="oracle.jdbc.OracleDriver"
   url="jdbc:oracle:thin:@<hostname>:1521:<dbname>"/>

carnot-spring-context.xml:
   <bean id="carnotAuditTrailDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="java:comp/env/jdbc/AuditTrail.DataSource" />
   </bean>
  
   <bean id="carnotXaAuditTrailDataSource" class="oracle.jdbc.xa.OracleXADataSource" lazy-init="true">
      <property name="url" value="${AuditTrail.URL}" />
      <property name="user" value="${AuditTrail.User}" />
      <property name="password" value="${AuditTrail.Password}" />
   </bean>
Re: carnotXaAuditTrailDataSource OracleXADataSource java.lang.InstantiationException [message #743032 is a reply to message #743030] Fri, 21 October 2011 00:04 Go to previous messageGo to next message
Srinivasan Iyer is currently offline Srinivasan Iyer
Messages: 35
Registered: October 2011
Member
It seems you have two datasources in your carnot-spring-context.xml for the AuditTrail DB. One with local parameters and one via JNDI lookup. In this case you should only use the JNDI one and comment out the other. Just search through the file for references of carnotXaAuditTrailDataSource (the one you're removing) and change them to point to the one with the JNDI lookup.
Re: carnotXaAuditTrailDataSource OracleXADataSource java.lang.InstantiationException [message #743035 is a reply to message #743032] Fri, 21 October 2011 00:07 Go to previous messageGo to next message
Srinivasan Iyer is currently offline Srinivasan Iyer
Messages: 35
Registered: October 2011
Member
I made the suggested change and the server started fine. I deployed a model and when I click on the "My Startable Processes" link I get the following error:

 
12:01:29 WARN  [rocessor22] ApplicationException      - Error during flush.
java.sql.SQLException: ORA-00942: table or view does not exist
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
 at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
 at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
 at org.tranql.connector.jdbc.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:103)
 at ag.carnot.db.jdbc.Session.createLockTableEntry(Session.java:993)
 at ag.carnot.db.jdbc.Session.doBatchInsert(Session.java:680)
 at ag.carnot.db.jdbc.Session.flush(Session.java:1679)
 at ag.carnot.workflow.runtime.spring.SpringSessionInterceptor$1.doInConnection(SpringSessionInterceptor.java:105)
 at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:342)
 at ag.carnot.workflow.runtime.spring.SpringSessionInterceptor.invoke(SpringSessionInterceptor.java:52)
 at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
 at ag.carnot.workflow.runtime.spring.SpringConfigurationInterceptor.invoke(SpringConfigurationInterceptor.java:94)
 at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
 at ag.carnot.workflow.runtime.beans.interceptors.PropertyLayerProviderInterceptor.invoke(PropertyLayerProviderInterceptor.java:107)
 at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
 at ag.carnot.workflow.runtime.beans.interceptors.DebugInterceptor.invoke(DebugInterceptor.java:45)
 at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
 at ag.carnot.workflow.runtime.spring.SpringTxInterceptor$1.doInTransaction(SpringTxInterceptor.java:64)
 at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
 at ag.carnot.workflow.runtime.spring.SpringTxInterceptor.invoke(SpringTxInterceptor.java:49)
 at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
 at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.execute(MethodInvocationImpl.java:61)
 at ag.carnot.workflow.runtime.beans.InvocationManager.invoke(InvocationManager.java:46)
 at $Proxy83.startProcess(Unknown Source)
 at ag.carnot.workflow.runtime.spring.WorkflowServiceBean.startProcess(WorkflowServiceBean.java:274)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at ag.carnot.workflow.runtime.spring.SpringServiceFactory$SpringServiceInvocationHandler.invoke(SpringServiceFactory.java:172)
 at $Proxy83.startProcess(Unknown Source)
 at com.infinity.bpm.ui.web.processportal.common.PPUtils.startProcess(PPUtils.java:736)
 at com.infinity.bpm.ui.web.processportal.launchpad.StartableProcessModel.select(StartableProcessModel.java:78)
 at com.infinity.bpm.ui.web.processportal.launchpad.StartableProcessModel.selectAction(StartableProcessModel.java:52)
Re: carnotXaAuditTrailDataSource OracleXADataSource java.lang.InstantiationException [message #743037 is a reply to message #743035] Fri, 21 October 2011 00:08 Go to previous messageGo to next message
Srinivasan Iyer is currently offline Srinivasan Iyer
Messages: 35
Registered: October 2011
Member
Check out your carnot.properties. You probably have AuditTrail.UseLockTables enabled. That's not required using Oracle database. Just set above property to false.

Problem resolved after making this change.
Re: carnotXaAuditTrailDataSource OracleXADataSource java.lang.InstantiationException [message #743039 is a reply to message #743037] Fri, 21 October 2011 00:09 Go to previous message
Srinivasan Iyer is currently offline Srinivasan Iyer
Messages: 35
Registered: October 2011
Member
The above solution will take care of ~90 % of the cases. Another reason (~7%) for this can be a wrong value for the property AuditTrail.Schema. If this property value is left empty then Stardust will use the connecting users schema. If this is not intended, then the connecting user needs to have access rights to the specified schema and the schema has to contain an audit trail. Other rare reasons are: - the schema has not been created yet - you are connecting to the wrong database or database schema.
Previous Topic:Problem displaying BIRT reports when deployed under Websphere behind firewall
Next Topic:Retrieve Primitive Data instance value from Java code
Goto Forum:
  


Current Time: Thu Jul 31 17:45:58 EDT 2014

Powered by FUDForum. Page generated in 0.01738 seconds