[jBPM Development] - SQL Exception throws in JBPM 3.1.4 while changing the Hibern
by darshgohel
Hi All,
We are developing a work flow based system using Struts and Hibernate 3. All is working good until we changed some configuration to implement the Threading and C3P0 for concurrent users. The configuration for this in hibernate.cfg.xml is as below:
| <property name="hibernate.connection.url">jdbc:oracle:thin:@<hostname>:1521:orcl</property>
| <property name="hibernate.connection.username">username</property>
| <property name="hibernate.connection.password">pass</property>
| <property name="hibernate.current_session_context_class">thread</property>
| <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
|
| <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
| <property name="hibernate.cache.use_second_level_cache">true</property>
| <property name="show_sql">false</property>
|
| <property name="hibernate.c3p0.max_size">4</property>
| <property name="hibernate.c3p0.min_size">4</property>
| <property name="hibernate.c3p0.timeout">5000</property>
| <property name="hibernate.c3p0.max_statements">0</property>
| <property name="hibernate.c3p0.idle_test_period">300</property>
| <property name="hibernate.c3p0.acquire_increment">1</property>
|
There are two types of errors throwing after implementing the same,
1) Closed ResultSet: Error Console for the error is as below:
| java.sql.SQLException: Closed Resultset: next
| at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
| at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
| at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:916)
| at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:181)
| at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)
| at com.elitecore.workorder.subscriberapplication.dao.SubscriberApplicationDao.getSearchedGroupCustomerByCustomerId(SubscriberApplicationDao.java:739)
| at com.elitecore.workorder.subscriberapplication.manager.BulkNewProvisionManager.getSearchedGroupCustomerByCustomerId(BulkNewProvisionManager.java:321)
| at com.elitecore.workorder.subscriberapplication.action.SearchCustomerAction.searchGroupCustomer(SearchCustomerAction.java:121)
| 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.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
| at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
| at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
| at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
| at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
| at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at com.elitecore.workorder.jbpm.session.JbpmSessionConversationFilter.doFilter(JbpmSessionConversationFilter.java:78)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
The code snap for the same is:
| JbpmContext jbpmContext = JbpmContextManager.getJbpmContext();
| PreparedStatement pst = null;
| StringBuffer sbQuery = new StringBuffer();
|
| sbQuery.append("select DISTINCT c.id,c.clientName,c.clientTitle, c.PANGIRNO,c.headquarteraddressid, ");
| sbQuery.append("c.customerid,c.PANGIRNO from tblmclient c ");
|
| if(accessLevel !=null && accessLevel.equalsIgnoreCase("LDCA")){
| sbQuery.append("join tbltassignedlocation al on al.locationtypeid=C.ldcabcaid ");
| }else if(accessLevel !=null && accessLevel.equalsIgnoreCase("Region")){
| sbQuery.append("join tbltassignedlocation al on al.locationtypeid=C.regionid ");
|
| }else if(accessLevel !=null && accessLevel.equalsIgnoreCase("Circle")){
| sbQuery.append("join tbltassignedlocation al on al.locationtypeid=c.circleid ");
| }
| sbQuery.append("where upper(c.customerid) like (?) ");
| sbQuery.append("and c.isdeleted like 'No' ");
| sbQuery.append("and al.staffid='"+staffId.trim()+"' order by c.CLIENTNAME ");
|
| pst = jbpmContext.getConnection().prepareStatement(sbQuery.toString());
| pst.setString(1,"%"+ customerId.toUpperCase()+"%");
| rs = pst.executeQuery();
|
| while(rs.next())// Error comes here.
| {
| searchGroupCustomer=new SearchGroupCustomer();
| searchGroupCustomer.setClientId(rs.getString("id"));
| searchGroupCustomer.setSubscriberName(rs.getString("CLIENTNAME"));
| searchGroupCustomer.setSubscriberTitle(rs.getString("clientTitle"));
| searchGroupCustomer.setCustomerId(rs.getString("customerId"));
| searchGroupCustomer.setPanGIRNo(rs.getString("PANGIRNO"));
| Address address1=(Address)abstractDao.initliaze(Address.class,rs.getString("headquarteraddressid"));
| searchGroupCustomer.setAddress(address1);
| lstCustomerName.add(searchGroupCustomer);
| }
|
2) Invalid Cursor:Error Console for the error is as below:
java.sql.SQLException: ORA-01001: invalid cursor
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.v8Odscrarr.receive(v8Odscrarr.java:192)
at oracle.jdbc.ttc7.TTC7Protocol.describe(TTC7Protocol.java:592)
at oracle.jdbc.driver.OracleStatement.describe(OracleStatement.java:5371)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5141)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:698)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1505)
at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342)
at com.elitecore.workorder.subscriberapplication.dao.SearchSubscriberApplicationDao.getSAStatusReport(SearchSubscriberApplicationDao.java:445)
at com.elitecore.workorder.subscriberapplication.manager.SubscriberApplicationManager.getSAStatusReport(SubscriberApplicationManager.java:114)
at com.elitecore.workorder.subscriberapplication.action.UpgradePostConnectionAction.listApplications(UpgradePostConnectionAction.java:259)
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.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.elitecore.workorder.jbpm.session.JbpmSessionConversationFilter.doFilter(JbpmSessionConversationFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
The code snap for the same is:
| PreparedStatement pst=null;
| JbpmContext jbpmContext = JbpmContextManager.getJbpmContext();
|
| pst = jbpmContext.getConnection().prepareStatement(getSAStatusReport);
| pst.setString(1, saId);
| rs = pst.executeQuery();
|
| while (rs.next())
| {
| saStatusInfo = new SaStatusInfo();
| AbstractDao abstractDao=new AbstractDao();
| Address endAAddress=(Address)abstractDao.initliaze(Address.class,rs.getString("endAAddressId"));
| Address endBAddress=(Address)abstractDao.initliaze(Address.class,rs.getString("endBAddressId"));//Error Comes here.
| log.debug(" endAAddress.getAddressAsString() "+endAAddress.getAddressAsString());
| log.debug(" endBAddress.getAddressAsString() "+endBAddress.getAddressAsString());
| saStatusInfo.setEndAInstallAddress(endAAddress.getAddressAsString());
| saStatusInfo.setEndBInstallAddress(endBAddress.getAddressAsString());
| }
|
As from basic debugging we identify that the problem arises when the anonymous wrote : abstractDao.initliaze() is used. This class basically fetch the data of a table and prepare an object for the same. The code snap for the same is as below:
| public Object initliaze(Class clazz, String id) throws Exception
| {
| JbpmContext jbpmContext = JbpmContextManager.getJbpmContext();
|
| return jbpmContext.getSession().get(clazz,id);
| }
|
We are at a very critical stage in the project and this Errors are started.
Kindly suggest us a way by which we can be out with this problems.
Note: All this errors removed if we commented the hibernate.cfg.xml configuration for Thread and C3P0.
Thanks in Advance.
Darshan Gohel.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265778#4265778
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265778
16 years, 4 months
[JBoss Remoting Development] - Can't load remote interface of ejb in my client from jboss
by vikram_khati
Hi,
I had written a client which is trying to call the ejb dynamically using reflection api. Instead of putting the home and remote interfaces in the classpath of the client application I am trying to load these interfaces from jboss server using RMI codebase. For this i had also added the security manager in my client so that it can load the interfaces from jboss server. This thing is working in jboss-4.0.3SP1 completly, but it is not working in jboss-eap-4.2 completely.
Client is loading the home interface but it is not loading the remote interface from jboss-eap-4.2 while Client is loading both home interface and remote interface from 4.0.3SP1. Those interfaces are present in RMI codebase URL(I am able to download those interfaces with the help of browser in that URL)
My Client code is as follow:
public class Client
{
public static void main(String args[])
{
System.setProperty("java.security.policy","D:\\VB\\policy.all");
SecurityManager sm=new SecurityManager();
System.setSecurityManager(sm);
String jndiName="CFFESBean",homeInterfaceName="nsdg.client.CFFESHome",remoteInterfaceName="nsdg.client.CFFESRemote";
String remoteMethodName="initialise";
Properties ps=new Properties();
ps.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
ps.put(InitialContext.PROVIDER_URL, "jnp://localhost:1099");
ps.put(InitialContext.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
try
{
Context ctx=new InitialContext(ps);
System.out.println("1");
Object homeObject=ctx.lookup(jndiName);
System.out.println("2");
EJBHome ejbHomeObject=(EJBHome)PortableRemoteObject.narrow(homeObject,EJBHome.class);
EJBMetaData ejbMetaData=ejbHomeObject.getEJBMetaData();
Class homeInterfaceClass=ejbMetaData.getHomeInterfaceClass();
System.out.println("ejbHomeObject= "+ejbHomeObject);
Class remoteInterfaceClass=ejbMetaData.getRemoteInterfaceClass();
System.out.println("Remote Interface Class= "+remoteInterfaceClass);
Method homeInterfaceMethod = homeInterfaceClass.getMethod("create",null);
homeInterfaceMethod.setAccessible(true);
System.out.println("3");
EJBObject remoteObject=(EJBObject)homeInterfaceMethod.invoke(homeObject, null);
System.out.println("4");
Method remoteInterfaceMethod = remoteInterfaceClass.getMethod(remoteMethodName,null);
remoteInterfaceMethod.setAccessible(true);
Object returnObject=remoteInterfaceMethod.invoke(remoteObject, null);
System.out.println("returning");
}catch (NamingException e)
{
System.out.println("Inside Naming Exception");
e.printStackTrace();
}catch (Exception e)
{
System.out.println("Inside Exception");
e.printStackTrace();
}
}
}
And the output is as follow:
1
2
ejbHomeObject= CFFESBeanHome
Remote Interface Class= interface nsdg.client.CFFESRemote
3
Inside Exception
java.lang.reflect.InvocationTargetException
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:597)
at cffes.client.Client.main(Client.java:45)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy0.create(Unknown Source)
... 5 more
Caused by: java.lang.ClassNotFoundException: nsdg.client.CFFESRemote
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.invocation.MarshalledValueInputStream.resolveProxyClass(MarshalledValueInputStream.java:159)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:195)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
... 6 more
What can be the solution of this problem so that it will work completly with
jboss-eap-4.2
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265774#4265774
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265774
16 years, 4 months
[Management Development] - Re: Simple Example using ManagedObjects and ProfileService
by rareddy
"emuckenhuber" wrote :
| Ok, just give it a try. Feel free to ask if something is not clear or just post a link to a svn repo where i can take a look.
|
So, my aim here is to some how extended the "DsDataSourceTemplate" template to add some custom properties specific to my "ConnectionFactory" and when I write the template write those properties as "config-properties" using "DsDataSourceTemplate" so that it generates "-ds.xml" file.
After few tries with configuration, I ended up like this configuration below
| <bean name="ConnectorTypeTemplate" class="org.teiid.templates.connector.ConnectorTypeTemplate">
| <property name="info"><inject bean="ConnectorTypeTemplateInfo"/></property>
| <property name="targetTemplate"><inject bean="NoTxConnectionFactoryTemplate"/></property>
| </bean>
| <bean name="ConnectorTypeTemplateInfo" class="org.teiid.templates.connector.ConnectorTypeTemplateInfo">
| <constructor factoryMethod="createTemplateInfo">
| <factory bean="DSDeploymentTemplateInfoFactory"/>
| <parameter class="java.lang.Class">org.teiid.templates.connector.ConnectorTypeTemplateInfo</parameter>
| <parameter class="java.lang.Class">org.jboss.resource.metadata.mcf.NoTxConnectionFactoryDeploymentMetaData</parameter>
| <parameter class="java.lang.String">ConnectorTypeTemplate</parameter>
| <parameter class="java.lang.String">A template for no-tx-connection-factory *-ds.xml deployments</parameter>
| </constructor>
| <property name="connectorXML">foo.xml</property>
| </bean>
|
Where in "ConnectorTypeTemplateInfo" template, I passed "NoTxConnectionFactoryDeploymentMetaData" as the attachment class, which supplied basic ConnectionFactory properties, then in the "ConnectorTypeTemplateInfo" it self I added my own property definitions. Then on the "ConnectorTypeTemplate", I passed the original "DSDataSourceTemplate" to my template, then in "applyTemplate" call I added all the custom properties defined on my template into "DSDataSourceTemplate" as "config-properties" and called DSDataSourceTemplate's applyTemplate call, and that created my "-ds.xml" file the way I wanted. This is cool.
"emuckenhuber" wrote :
| We are actually working on a meta data descriptor for ManagedObjects, where you would be able to define the view in an xml file. Where i will try to take you requirements into account as well. Although this will most likely go in one of the future releases and not in AS5.
|
This is exactly what I need, and what functionality we have in Teiid. Also, one another requirement we have is to dynamically add these templates based on the given XML file though admin functionality, which is important to support custom connectors.
Since these features are not currently available in AS 5, I will be looking into extending the above configuration to read the custom properties from a XML file. So, in this respect I have couple questions
1) Ideally I would like this XML file be the "ra.xml" in my RAR file, is there way I can access that file, management object or otherwise?
2) In case, if (1) is not possible, if I supply copy of "ra.xml" file in "deploy" directory, how can I get access to it? like how can I get file handle to it?
I could embed XML in a property in the above configuration with in a CDATA section, but I would like to avoid that.
Thank you again for your valuable help.
Ramesh..
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265763#4265763
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265763
16 years, 4 months