Problem in EJB module with picketLink
mitrandir May 24, 2015 7:40 AMHello,
i have just training with pocketlink.
I have tried to make simple getting started app. All worked ok.
Then i tried to make simble stateless local EJB bean.
I created standart netbeans Enterprise maven arche type.
Here is master pom:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>ru.heroicrealm.ejbtest</groupId> <artifactId>EjbTest</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>EjbTest</name> <modules> <module>EjbTest-ear</module> <module>EjbTest-web</module> <module>EjbTest-ejb</module> </modules> </project>
here is EjbTest-web pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>EjbTest</artifactId>
<groupId>ru.heroicrealm.ejbtest</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>ru.heroicrealm.ejbtest</groupId>
<artifactId>EjbTest-web</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>EjbTest-web</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ru.heroicrealm.ejbtest</groupId>
<artifactId>EjbTest-ejb</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink</artifactId>
<version>2.7.0.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
and all was ok.
then i tried to access identity from ejb module,
and make such EjbTest-ejb.pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>EjbTest</artifactId>
<groupId>ru.heroicrealm.ejbtest</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>ru.heroicrealm.ejbtest</groupId>
<artifactId>EjbTest-ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>ejb</packaging>
<name>EjbTest-ejb</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink</artifactId>
<version>2.7.0.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
all compiled well done ( ejb had simple ejb bean)
@Stateless
public class NewSessionBean implements NewSessionBeanLocal {
@Override
public String sayHello() {
return "Hello ";
}
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
}
but when i deployed this on my WildFly 9.0 i have this error:
Deployment failed: EjbTest-ear-1.0-SNAPSHOT.ear: { "outcome" : "failed", "failure-description" : {"WFLYCTL0080: Failed services" : {"jboss.deployment.unit.\"EjbTest-ear-1.0-SNAPSHOT.ear\".WeldStartService" : "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"EjbTest-ear-1.0-SNAPSHOT.ear\".WeldStartService: Failed to start service\n Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:\nException 0 :\njavax.enterprise.event.ObserverException\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:422)\r\n\tat java.lang.Class.newInstance(Class.java:442)\r\n\tat org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)\r\n\tat org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)\r\n\tat org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)\r\n\tat org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)\r\n\tat org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)\r\n\tat org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:306)\r\n\tat org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)\r\n\tat org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:284)\r\n\tat org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:262)\r\n\tat org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:271)\r\n\tat org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:260)\r\n\tat org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)\r\n\tat org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)\r\n\tat org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:54)\r\n\tat org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:42)\r\n\tat org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl.fire(BeforeBeanDiscoveryImpl.java:45)\r\n\tat org.jboss.weld.bootstrap.WeldStartup.startInitialization(WeldStartup.java:368)\r\n\tat org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:76)\r\n\tat org.jboss.as.weld.WeldStartService.start(WeldStartService.java:92)\r\n\tat org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)\r\n\tat org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.util.ServiceConfigurationError: org.apache.deltaspike.core.spi.config.ConfigSourceProvider: Provider org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider not a subtype\r\n\tat java.util.ServiceLoader.fail(ServiceLoader.java:239)\r\n\tat java.util.ServiceLoader.access$300(ServiceLoader.java:185)\r\n\tat java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)\r\n\tat java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)\r\n\tat java.util.ServiceLoader$1.next(ServiceLoader.java:480)\r\n\tat org.apache.deltaspike.core.util.ServiceUtils.loadServiceImplementations(ServiceUtils.java:66)\r\n\tat org.apache.deltaspike.core.util.ServiceUtils.loadServiceImplementations(ServiceUtils.java:46)\r\n\tat org.apache.deltaspike.core.api.config.ConfigResolver.resolveConfigSources(ConfigResolver.java:374)\r\n\tat org.apache.deltaspike.core.api.config.ConfigResolver.getConfigSources(ConfigResolver.java:353)\r\n\tat org.apache.deltaspike.core.api.config.ConfigResolver.getAllPropertyValues(ConfigResolver.java:306)\r\n\tat org.apache.deltaspike.core.util.ClassDeactivationUtils.initConfiguredClassDeactivators(ClassDeactivationUtils.java:152)\r\n\tat org.apache.deltaspike.core.util.ClassDeactivationUtils.getClassDeactivators(ClassDeactivationUtils.java:143)\r\n\tat org.apache.deltaspike.core.util.ClassDeactivationUtils.initDeactivatableCacheFor(ClassDeactivationUtils.java:88)\r\n\tat org.apache.deltaspike.core.util.ClassDeactivationUtils.isActivated(ClassDeactivationUtils.java:73)\r\n\tat org.apache.deltaspike.core.impl.config.ConfigurationExtension.init(ConfigurationExtension.java:55)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)\r\n\t... 21 more\r\n"}}, "rolled-back" : true }
If i remove dependency to picketlink all ok.
How can i fix this?