11 Replies Latest reply on Aug 20, 2014 1:42 AM by Farhad Mahigir

    how do i use infinispan caxche in my application.,

    Farhad Mahigir Newbie

      hello,

       

      i have an disribution application, ejb 3.1 (JEE 6) , with SLSBs, EAP 6.2.1 and

      JBoss as application server. This applivation ist in cluster form with two nodes.

      iI need a map for * 700 entries as KEY ---> VALUE. KEY ist USer-ID, and VALUE a Object.

       

      i am new in framework infinispan.

       

      Thank you

        • 1. Re: how do i use infinispan caxche in my application.,
          Wolf-Dieter Fink Master

          As I said in your other thread https://community.jboss.org/thread/243435

           

          The Infinispan cache included in EAP is not supposed to be used for custom caches. You need a separate JDG subscription and bundle the configuration in your application.

          See the JDG documentation for this.

          • 2. Re: how do i use infinispan caxche in my application.,
            Farhad Mahigir Newbie

            hi,

            it means, no configuration within standalone.xml, but within application.

            Therefore , no exists  infinispan jars in modules directory in EAP 6.2.1 JBoss application server ?

             

            I am new in this topic

            • 3. Re: how do i use infinispan caxche in my application.,
              Wolf-Dieter Fink Master

              Yes, there are no modules distributed with the EAP server.

              With JDG 6.3 there are EAP modules distributed, but here you need a Red Hat login to download the bits.

              If you use different JDG/Infinispan versions you need to pack the libraries in your application

              • 4. Re: how do i use infinispan caxche in my application.,
                Farhad Mahigir Newbie


                hi,

                now the stacktrace:

                 

                2014-08-07 08:44:13,318 ERROR [stderr] (EJB default - 40) java.lang.NullPointerException

                2014-08-07 08:44:13,318 ERROR [stderr] (EJB default - 40)  at org.infinispan.commands.read.KeySetCommand$FilteredKeySet$Itr.fetchNext(KeySetCommand.java:168)

                2014-08-07 08:44:13,318 ERROR [stderr] (EJB default - 40)  at org.infinispan.commands.read.KeySetCommand$FilteredKeySet$Itr.<init>(KeySetCommand.java:160)

                2014-08-07 08:44:13,319 ERROR [stderr] (EJB default - 40)  at org.infinispan.commands.read.KeySetCommand$FilteredKeySet.iterator(KeySetCommand.java:119)

                2014-08-07 08:44:13,319 ERROR [stderr] (EJB default - 40)  at com.talanx.postbox.server.service.JecFacadeBean.list(JecFacadeBean.java:388)

                2014-08-07 08:44:13,319 ERROR [stderr] (EJB default - 40)  at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)

                2014-08-07 08:44:13,319 ERROR [stderr] (EJB default - 40)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                2014-08-07 08:44:13,319 ERROR [stderr] (EJB default - 40)  at java.lang.reflect.Method.invoke(Method.java:606)

                2014-08-07 08:44:13,319 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:129)

                2014-08-07 08:44:13,320 ERROR [stderr] (EJB default - 40)  at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:137)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

                2014-08-07 08:44:13,321 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:93)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,322 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:259)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.tx.CMTTxInterceptor.never(CMTTxInterceptor.java:309)

                2014-08-07 08:44:13,323 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:234)

                2014-08-07 08:44:13,324 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,324 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79)

                2014-08-07 08:44:13,324 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,324 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

                2014-08-07 08:44:13,324 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,324 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

                2014-08-07 08:44:13,325 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,325 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

                2014-08-07 08:44:13,325 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,325 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

                2014-08-07 08:44:13,325 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,325 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:329)

                2014-08-07 08:44:13,326 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at java.util.concurrent.FutureTask.run(FutureTask.java:262)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at java.lang.Thread.run(Thread.java:744)

                2014-08-07 08:44:13,327 ERROR [stderr] (EJB default - 40)  at org.jboss.threads.JBossThread.run(JBossThread.java:122)

                2014-08-07 08:44:13,328 ERROR [com.talanx.postbox.server.service.JecFacadeBean] (EJB default - 40) Fehler beim Besorgen der Liste aller Eintraege mit dem Namen  >A5XA5D1< aus dem Container Cache: java.lang.NullPointerException

                • 5. Re: how do i use infinispan caxche in my application.,
                  Farhad Mahigir Newbie

                  Question:

                  ++++++++++

                  Infinispan API

                  The direct use of the Infinispan API is not supported in JBoss EAP 6. Infinispan is used as an implementation detail for various clustering technologies internal to JBoss EAP 6. The API's module.xml incorrectly indicates that direct use is possible, even though this is not the case. This will be fixed in a future release. Direct use of the Infinispan API requires a subscription to JBoss Data Grid.

                  ++++++++++

                  waht direct use means ?

                  • 6. Re: how do i use infinispan caxche in my application.,
                    Wolf-Dieter Fink Master

                    Direct use mean to configure your custom cache within the server's standalone/domain configuration files. The EAP Infinispan module (provided with the EAP distribution) is restricted (and stripped) for internal use only.

                    • 7. Re: how do i use infinispan caxche in my application.,
                      Wolf-Dieter Fink Master

                      Do you have a small reproducer for that to verify that your configuration is correct?

                      If the configuration and use is correct a NullPointer might be a bug

                      • 8. Re: how do i use infinispan caxche in my application.,
                        Farhad Mahigir Newbie

                        Hi Wolf,

                        what to do now ?

                        "From dokumentation of RedHat ":

                        Direct use of the Infinispan API requires a subscription to JBoss Data Grid.

                         

                        I understand there are two solutions.

                        1. what should i do, if i am a current subscriber ?

                         

                        2. If i am not subscriber.

                        The configuration of Data Grid takes place in the application.

                        Which version of JBoss Data Grid ist compatible to the EAP 6.3.0 ?

                        In this solution i need to remove the configuration fron the standalone.xml.

                        How to implements ?

                         

                         

                        Thank you

                        • 9. Re: how do i use infinispan caxche in my application.,
                          Farhad Mahigir Newbie

                          Hi Wolf,

                           

                          what do you think, if i take this configuration in standalone.xml,

                          +++++++++++++++++

                          ....................

                          <cache-container name="postbox"  default-cache="jec-registry">

                                          <transport lock-timeout="60000"/>

                                          <replicated-cache name="jec-registry" mode="SYNC" batching="true">

                                              <locking isolation="REPEATABLE_READ"/>

                                          </replicated-cache>

                                      </cache-container>

                           

                           

                          and

                          set ths  TransactionAttribute "Required" within Session Bean.

                          +++++++++++++++++

                           

                          tank in advance

                          • 10. Re: how do i use infinispan caxche in my application.,
                            Wolf-Dieter Fink Master

                            In any case, if you are using EAP the use of infinispan configured in the standalone.xml is only for internal use and not for custom caches.

                            If you have a subscription this will be not supported!

                            If you have no subsription you can do what you want, but consider that you can only use the EAP version without subscription for development purpose.

                            So it does not make sense to follow such approach as you need to change the implementation if you go to production.

                             

                            The compatible and supported JDG versions to use with EAP6.3 is JDG6.3/6.4, but I recommend to use the latest possible because you will have all bugfixes.

                            • 11. Re: how do i use infinispan caxche in my application.,
                              Farhad Mahigir Newbie


                              Hi Wolf,

                              I need your help:

                               

                              This is EAP inside configuration (old way)

                              ....................

                              the current situation with my application.

                              EAP 6.2.1, AS JBoss
                              EJB 3.1 with SLSBs and
                              ..
                              and EAP  the inside configuration for my cache


                              standalone.xml:
                              ..........................

                              <subsystem xmlns="urn:jboss:domain:infinispan:1.4">
                                          <cache-container default-cache="jec-registry" name="postbox">
                                              <transport lock-timeout="60000"/>
                                              <replicated-cache batching="true" mode="ASYNC" name="jec-registry">
                                                  <locking isolation="READ_COMMITTED"/>
                                              </replicated-cache>
                                          </cache-container>

                              ... within session bean:
                              ...
                              @Stateless
                              @Clustered
                              @Remote (JecFacade.class)
                              @LocalBean
                              @TransactionAttribute (TransactionAttributeType.NEVER)
                              public class JecFacadeBean implements JecFacade
                              {
                                  @Inject
                                  private Logger log;

                                  @Resource (name = "java:jboss/infinispan/cache/postbox/jec-registry")
                                  private Cache<String, Object> jecRegistry;
                                  .....

                              ......................