[
https://issues.jboss.org/browse/ISPN-2730?page=com.atlassian.jira.plugin....
]
Mircea Markus updated ISPN-2730:
--------------------------------
Summary: Not possible to instantiate org.infinispan.cdi.InfinispanExtension during
startup of appserver (was: Not possible to instanciate
org.infinispan.cdi.InfinispanExtension during startup of appserver)
Not possible to instantiate org.infinispan.cdi.InfinispanExtension
during startup of appserver
----------------------------------------------------------------------------------------------
Key: ISPN-2730
URL:
https://issues.jboss.org/browse/ISPN-2730
Project: Infinispan
Issue Type: Bug
Components: CDI integration
Affects Versions: 5.2.0.CR1
Environment: tested in openEJB
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Oracle JRockit(R) (build R28.2.4-14-151097-1.6.0_33-20120618-1634-windows-x86_64,
compiled mode)
Reporter: Michael Mellenthin
Assignee: Tristan Tarrant
Priority: Critical
Fix For: 5.3.0.Final
I have infinispan-cdi library in my appserver to be able to use JSR-107.
During startup of application server it loads the InfinispanExtension because the service
provider is declared in META-INF/services.
During startup I get the exception
{code}
Caused by: java.util.ServiceConfigurationError: javax.enterprise.inject.spi.Extension:
Provider org.infinispan.cdi.InfinispanExtension could not be instantiated:
java.lang.IllegalAccessException: Class java.util.ServiceLoader$LazyIterator can not
access a member of class org.infinispan.cdi.InfinispanExtension with modifiers
""
at java.util.ServiceLoader.fail(ServiceLoader.java:207)
at java.util.ServiceLoader.access$100(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353)
at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
{code}
The reason is that the InfinispanExtension only provides a package scoped constructor.
For sure the documentation of java.util.ServiceLoader is not very clear here. It just
says:
*"The only requirement enforced by this facility is that provider classes must have
a zero-argument constructor so that they can be instantiated during loading"*
But the implementation fails if the constructor is not public. Hence, we need a public
constructor for InfinispanExtension.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira