Bug 1264832 - Cache-API
Summary: Cache-API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Documentation
Version: 6.5.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Post GA
: 6.5.1
Assignee: Christian Huffman
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-21 10:42 UTC by Thomas Qvarnström
Modified: 2015-10-30 12:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Build Name: 12539, Getting Started Guide-6.5 Build Date: 14-09-2015 14:41:05 Topic ID: 40890-735981 [Specified]
Last Closed: 2015-10-30 12:33:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thomas Qvarnström 2015-09-21 10:42:41 UTC
Title: Run JBoss Data Grid (Remote Client-Server Mode)

Describe the issue:
When deploying infinispan-remote into for example EAP 6.4 without using modules it will through the following exception.

12:36:35,325 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "chat.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"chat.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"chat.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at java.lang.Class.newInstance(Class.java:379)
	at org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:344)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:173)
	at org.jboss.weld.util.reflection.SecureReflections.newInstance(SecureReflections.java:341)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:33)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:73)
	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:162)
	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)
	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)
	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)
	at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75)
	at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:46)
	at org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl.fire(BeforeBeanDiscoveryImpl.java:46)
	at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:335)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:62)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: javax/cache/annotation/CacheResult
	at org.infinispan.cdi.InfinispanExtension.registerInterceptorBindings(InfinispanExtension.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
	at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
	at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:164)
	at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
	... 13 more
Caused by: java.lang.ClassNotFoundException: javax.cache.annotation.CacheResult from [Module \"deployment.chat.war:main\" from Service Module Loader]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
	... 25 more
"}}

AFAIK this is because infinispan-remote does not include cache-api. The solution is to add the following to the pom.xml file:
  <dependency>
    <groupId>javax.cache</groupId>
    <artifactId>cache-api</artifactId>
  </dependency>



Suggestions for improvement:
Update the documentation and specify that in some use-cases it might be necessary to include dependency to the cache-api.

Additional information:

This may be related to https://bugzilla.redhat.com/show_bug.cgi?id=1231117

Comment 6 Christian Huffman 2015-10-30 12:33:48 UTC
This section has been published and is available on the customer portal at the following link:

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Data_Grid/6.5/html-single/Getting_Started_Guide/index.html#Run_JBoss_Data_Grid_Server_Mode


Note You need to log in before you can comment on or make changes to this bug.