3 Replies Latest reply: May 23, 2012 6:17 PM by Ed Corners RSS

Using JDBC Datasource + Seam App Client

Ed Corners Newbie

Hi,

 

Haven't been able to connect the repository using a JDBC datasource. I seem to be having same problem reported here:

https://issues.jboss.org/browse/MODE-1239. Working with a seam app client too.

 

Been trying to use params:

 

            <mode:source jcr:name="store"

        mode:classname="org.modeshape.connector.store.jpa.JpaSource"

mode:driverClassName="org.postgresql.Driver"

mode:username="msuser"

mode:password="msuser"

mode:url="jdbc:postgresql:modeshape"

mode:maximumConnectionsInPool="5"

...

</mode:sources>

 

I get a java.lang.ClassNotFoundException: org.hibernate.connection.C3P0ConnectionProvider.

Where should i put C3P0 jar? server/default/lib didn't work.

 

Otherwise, is it any way to bind a datasource before modeshape.jar loads?. I keep getting Could not find datasource: jdbc/MyMSDatasource: javax.naming.NameNotFoundException: jdbc not bound

  • 1. Re: Using JDBC Datasource + Seam App Client
    Ed Corners Newbie

    Ok. I solved my problem with the datasources.

    Now, I'm using postgres instead of HSQL but i get the exception :

     

    ERROR [org.hibernate.transaction.JDBCTransaction] JDBC commit failed: java.sql.SQLException: You cannot commit during a managed transaction!
              at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:661) [:6.1.0.Final]
              at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:496) [:6.1.0.Final]
              at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:166) [:3.6.6.Final]
              at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:142) [:3.6.6.Final]
              at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:76) [:3.6.6.Final]
              at org.modeshape.connector.store.jpa.model.simple.SimpleJpaTransaction.commit(SimpleJpaTransaction.java:53) [:2.8.1.Final]
              at org.modeshape.connector.store.jpa.model.simple.SimpleJpaConnection.execute(SimpleJpaConnection.java:145) [:2.8.1.Final]
              at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:1124) [:2.8.1.Final]
              at org.modeshape.graph.Graph.execute(Graph.java:288) [:2.8.1.Final]
              at org.modeshape.graph.Graph$5.process(Graph.java:231) [:2.8.1.Final]
              at org.modeshape.graph.request.RequestBuilder.verifyWorkspace(RequestBuilder.java:75) [:2.8.1.Final]
              at org.modeshape.graph.Graph.useWorkspace(Graph.java:382) [:2.8.1.Final]
              at org.modeshape.graph.Graph.getCurrentWorkspace(Graph.java:357) [:2.8.1.Final]
              at org.modeshape.jcr.JcrRepository.sessionForContext(JcrRepository.java:1505) [:2.8.1.Final]
              at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1481) [:2.8.1.Final]
              at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1424) [:2.8.1.Final]
              at org.domain.msclient.session.RepositoryClientBean.increment(RepositoryClientBean.java:59) [:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_32]
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_32]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_32]
              at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_32]
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [:2.2.2.Final]
              ...
    
     GRAVE [javax.enterprise.resource.webcontainer.jsf.application] java.lang.IllegalStateException: Request is frozen and may not be changed: verify workspace default: javax.faces.el.EvaluationException: java.lang.IllegalStateException: Request is frozen and may not be changed: verify workspace default
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102) [:1.2_15-20100816-SNAPSHOT]
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [:1.2_15-20100816-SNAPSHOT]
              at javax.faces.component.UICommand.broadcast(UICommand.java:387) [:1.2_15-20100816-SNAPSHOT]
              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329) [:3.3.3.Final]
              at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304) [:3.3.3.Final]
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261) [:3.3.3.Final]
              at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474) [:3.3.3.Final]
              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82) [:1.2_15-20100816-SNAPSHOT]
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) [:1.2_15-20100816-SNAPSHOT]
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [:1.2_15-20100816-SNAPSHOT]
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) [:1.2_15-20100816-SNAPSHOT]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [:2.2.2.Final]
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) [:3.3.3.Final]
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) [:3.3.3.Final]
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) [:3.3.3.Final]
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) [:3.3.3.Final]
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [:2.2.2.Final]
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [:2.2.2.Final]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [:6.1.0.Final]
              at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
              at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
              at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
              at java.lang.Thread.run(Unknown Source) [:1.6.0_32]
    Caused by: java.lang.IllegalStateException: Request is frozen and may not be changed: verify workspace default
              at org.modeshape.graph.request.Request.checkNotFrozen(Request.java:176) [:2.8.1.Final]
              at org.modeshape.graph.request.Request.setError(Request.java:61) [:2.8.1.Final]
              at org.modeshape.connector.store.jpa.model.simple.SimpleJpaConnection.execute(SimpleJpaConnection.java:153) [:2.8.1.Final]
              at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:1124) [:2.8.1.Final]
              at org.modeshape.graph.Graph.execute(Graph.java:288) [:2.8.1.Final]
              at org.modeshape.graph.Graph$5.process(Graph.java:231) [:2.8.1.Final]
              at org.modeshape.graph.request.RequestBuilder.verifyWorkspace(RequestBuilder.java:75) [:2.8.1.Final]
              at org.modeshape.graph.Graph.useWorkspace(Graph.java:382) [:2.8.1.Final]
              at org.modeshape.graph.Graph.getCurrentWorkspace(Graph.java:357) [:2.8.1.Final]
              at org.modeshape.jcr.JcrRepository.sessionForContext(JcrRepository.java:1505) [:2.8.1.Final]
              at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1481) [:2.8.1.Final]
              at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1424) [:2.8.1.Final]
              at org.domain.msclient.session.RepositoryClientBean.increment(RepositoryClientBean.java:59) [:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_32]
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_32]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_32]
              at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_32]
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [:2.2.2.Final]
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [:2.2.2.Final]
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [:2.2.2.Final]
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [:2.2.2.Final]
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [:2.2.2.Final]
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [:2.2.2.Final]
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [:2.2.2.Final]
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [:2.2.2.Final]
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [:2.2.2.Final]
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [:2.2.2.Final]
              at org.domain.msclient.session.RepositoryClientBean_$$_javassist_seam_2.increment(RepositoryClientBean_$$_javassist_seam_2.java) [:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_32]
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_32]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_32]
              at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_32]
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335) [:1.0_02.CR5]
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348) [:1.0_02.CR5]
              at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) [:1.0_02.CR5]
              at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) [:1.0_02.CR5]
              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [:1.0_02.CR5]
              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68) [:1.1.15.B1]
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [:1.2_15-20100816-SNAPSHOT]
              ... 52 more
    
    

     

    at session = repo.login(credentials).

    Have no clue why is this happening.. appreciate any help .

  • 2. Re: Using JDBC Datasource + Seam App Client
    Randall Hauch Master

    Can you post your configuration, or shareable portions of it?

     

    Are you by chance using EJB or managed transactions?

  • 3. Re: Using JDBC Datasource + Seam App Client
    Ed Corners Newbie

    Well Randall thank you for the clue . I used @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) on my class and it worked.

    I might be bothering around a bit more as I keep working with modeshape .