5 Replies Latest reply on Feb 4, 2010 2:16 AM by Dmitry unlex

    IDM installing and deploying under JBOSS

    Dmitry unlex Newbie

      Hi!

      I'm quite new to the JBoss and IDM. May you provide a complete step-by-step instruction on how to install and deploy Picketlink IDM under JBoss AS 5, please?

       

      I've read the reference guide , there is described deployment process in Chapter 29 and 30. But I havn't understand the sequence of actions. I.e where all these config.xml, jars and deployer files should be placed, and so on to get this working.

       

      Thanks in advance.

        • 2. Re: IDM installing and deploying under JBOSS
          Boleslaw Dawidowicz Master
          Deploying IDM as a JBoss AS service may be usefull if you want to consume it from several apps. For a simple setup or for a single app you can bootstrap it easier manually. Please look at the provided examples. The example/simple is a maven project that bootstraps the service and perform some tests. The example/auth creates a simple sar archive that will start IDM service and populate it - then you can play with simple war secured with JAAS LoginModule leveraging IDM.
          • 3. Re: IDM installing and deploying under JBOSS
            Dmitry unlex Newbie

            Well. Finally, after hours of considerable effort I've managed to deploy the idm into the JBoss AS 5. Now I can obtain IdentitySession object by JNDI lookup:

            InitialContext ic = new InitialContext();            
            IdentitySessionFactory idmSessionFactory = (IdentitySessionFactoryImpl) ic.lookup("java:/IdentitySessionFactory");
            IdentitySession is = idmSessionFactory.getCurrentIdentitySession("realm://JBossIdentity");

             

            But when I try to start transaction by is.beginTransaction(), I obtain the folowing error

             

            ERROR [STDERR] org.hibernate.HibernateException: Unable to locate current JTA transaction
                at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:88)
                at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574)
                at org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreSessionImpl.startTransaction(HibernateIdentityStoreSessionImpl.java:77)
                at org.picketlink.idm.impl.repository.RepositoryIdentityStoreSessionImpl.startTransaction(RepositoryIdentityStoreSessionImpl.java:117)
                at org.picketlink.idm.impl.api.session.SimpleTransactionImpl.start(SimpleTransactionImpl.java:43)
                at org.picketlink.idm.impl.api.session.IdentitySessionImpl.beginTransaction(IdentitySessionImpl.java:203)
                at net.hcsg.subro.stripes.action.login.UserLoginActionBean.showLoginForm(UserLoginActionBean.java:87)
                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 net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:467)
                at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
                at org.stripesstuff.plugin.security.SecurityInterceptor.interceptEventHandling(SecurityInterceptor.java:188)
                at org.stripesstuff.plugin.security.SecurityInterceptor.intercept(SecurityInterceptor.java:120)
                at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
                at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
                at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
                at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)
                at net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:465)
                at net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:278)
                at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:160)
                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 net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)
                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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
                at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
                at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
                at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
                at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696)
                at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667)
                at org.apache.jsp.index_jsp._jspService(index_jsp.java:55)
                at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
                at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
                at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
                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 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                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:235)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                at java.lang.Thread.run(Thread.java:619)

             

            What can be the reason?

            • 4. Re: IDM installing and deploying under JBOSS
              Boleslaw Dawidowicz Master

              Your hibernate configuration is probably relying on JTA transaction. Try surrounding your code with:

               

              UserTransaction tx = (UserTransaction)ctx.lookup("UserTransaction");
              tx.begin();

               

              ...

               

              tx.commit();

               

              Then you should not begin transactions manually with the IdentitySession. This is mainly Hibernate configuration part.


              • 5. Re: IDM installing and deploying under JBOSS
                Dmitry unlex Newbie
                Thanks. Finally I successefuly configured my Hibernate settings. So it works fine now.