x509.CertAndKeyGen is not found in JVM at OpenAM initial configuration - jvm

In the combination of OSX Mavericks, OpenAM 10.1.0, Tomcat8 and JDK8,
OpenAM initial GUI configuration doesn't success, resulting in an error:
[Click] [error] handleException: java.lang.RuntimeException: Error occurred invoking public method: public boolean com.sun.identity.config.wizard.Wizard.createConfig()
at org.apache.click.util.ClickUtils.invokeMethod(ClickUtils.java:3335)
at org.apache.click.util.ClickUtils.invokeListener(ClickUtils.java:2088)
at org.apache.click.control.AbstractControl$1.onAction(AbstractControl.java:228)
at org.apache.click.ActionEventDispatcher.fireActionEvent(ActionEventDispatcher.java:259)
at org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:236)
at org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:180)
at org.apache.click.ClickServlet.performOnProcess(ClickServlet.java:746)
at org.apache.click.ClickServlet.processAjaxPageEvents(ClickServlet.java:1860)
at org.apache.click.ClickServlet.processPage(ClickServlet.java:559)
at org.apache.click.ClickServlet.handleRequest(ClickServlet.java:383)
at org.apache.click.ClickServlet.doGet(ClickServlet.java:276)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.forgerock.openam.validation.ResponseValidationFilter.doFilter(ResponseValidationFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.sun.identity.setup.AMSetupFilter.doFilter(AMSetupFilter.java:99)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError: A security class cannot be found in this JVM because of the following reason: sun.security.x509.CertAndKeyGen
at org.opends.server.util.Platform$PlatformIMPL.(Platform.java:127)
at org.opends.server.util.Platform.(Platform.java:80)
at org.opends.server.util.CertificateManager.generateSelfSignedCertificate(CertificateManager.java:283)
at org.opends.server.admin.AdministrationConnector.createSelfSignedCertifIfNeeded(AdministrationConnector.java:698)
at org.opends.server.admin.AdministrationConnector.initializeAdministrationConnector(AdministrationConnector.java:181)
at org.opends.server.core.ConnectionHandlerConfigManager.initializeAdministrationConnectorConfig(ConnectionHandlerConfigManager.java:350)
at org.opends.server.core.DirectoryServer.initializeAdministrationConnector(DirectoryServer.java:2898)
at org.opends.server.core.DirectoryServer.startServer(DirectoryServer.java:1401)
at org.opends.server.util.EmbeddedUtils.startServer(EmbeddedUtils.java:88)
at com.sun.identity.setup.EmbeddedOpenDS.startServer(EmbeddedOpenDS.java:545)
at com.sun.identity.setup.EmbeddedOpenDS.setup(EmbeddedOpenDS.java:364)
at com.sun.identity.setup.AMSetupServlet.setupEmbeddedDS(AMSetupServlet.java:813)
at com.sun.identity.setup.AMSetupServlet.setupSMDatastore(AMSetupServlet.java:869)
at com.sun.identity.setup.AMSetupServlet.configure(AMSetupServlet.java:945)
at com.sun.identity.setup.AMSetupServlet.processRequest(AMSetupServlet.java:628)
at com.sun.identity.config.wizard.Wizard.createConfig(Wizard.java:294)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.click.util.ClickUtils.invokeMethod(ClickUtils.java:3317)
... 30 more
I also changed JDK to 7 or Tomcat to 7, it was useless.
A security class cannot be found in this JVM because of the following reason: sun.security.x509.CertAndKeyGen
I know JBoss seems to be fixed for this error, but I'm at a loss how to get over under my environment.

The CertAndKeyGen class issue is actually OPENDJ-1142, which happens when the configurator tries to set up the embedded OpenDJ (which does not support JDK8 yet). Even then, OpenAM does not run yet on JDK8 (doesn't even compile at the moment - mainly because of OPENAM-141), so you will certainly need to use JDK7 and a container that runs fine on JDK7.
The JDK7 and Tomcat 7 setup is actually supported, so you may want to provide more info on why that installation attempt failed and how.

We need to prepare jboss for openam deployments, by adding following contents to jboss-deployment-structure.xml:
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="webservices" />
</exclude-subsystems>
<dependencies>
<module name="sun.jdk" >
<imports>
<exclude-set>
<path name="com/sun/org/apache/xml/internal/security/transforms/implementations"/>
</exclude-set>
</imports>
</module>
<system>
<paths>
<path name="sun/security/x509" />
<path name="com/sun/org/apache/xpath/internal" />
<path name="com/sun/org/apache/xerces/internal/dom" />
<path name="com/sun/org/apache/xml/internal/utils" />
</paths>
</system>
</dependencies>

Related

ignite upgrade from 2.7 to 2.11 , error occurred during startup

I use ansible install ignite, just replace artiface zip. The error log for the startup script is as follows, it's strange ClassNotFoundException:ZkDiscoveryNodeFailEventData( which occur in 2.7 version).
Caused by: java.lang.ClassNotFoundException: org.apache.ignite.spi.discovery.zk.internal.ZkDiscoveryNodeFailEventData
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9064)
at org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9002)
at org.apache.ignite.marshaller.jdk.JdkMarshallerObjectInputStream.resolveClass(JdkMarshallerObjectInputStream.java:59)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
at java.util.TreeMap.buildFromSorted(TreeMap.java:2568)
at java.util.TreeMap.buildFromSorted(TreeMap.java:2551)
at java.util.TreeMap.buildFromSorted(TreeMap.java:2508)
at java.util.TreeMap.readObject(TreeMap.java:2454)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2176)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
at org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:124)
... 11 more
Failed to start grid: Failed to start manager: GridManagerAdapter [enabled=true, name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
Note! You may use 'USER_LIBS' environment variable to specify your classpath.
tail: /opt/rdx/log/ignite/ignite_console.out: file truncated
I have solved this problem , just change zkRootPath from /apacheIgnite to /otherPath, or connect zookeeper shell and rmr /apacheIgnite
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpi">
<property name="zkConnectionString" value="ip1:2181,ip2:2181,ip3:2181"/>
<property name="zkRootPath" value="/apacheIgnite"/>
<property name="sessionTimeout" value="400000"/>
</bean>
</property>
besides, you need to delete the data for the paths in the following properties
<property name="storagePath" value="/xxx/persistent" />
<property name="walPath" value="/xxx/wal_store"/>
<property name="walArchivePath" value="/xxx/wal_archive"/>

Unable to load fontawesome library to Intellij Idea despite connected library

I am new to JavaFX but I have already watched so much tutorials on YT how to do stuff and such, including connecting fontawesome to JavaFX project.
My icons appear properly in the scene builder, but when I launch the app - there are a lot of errors telling that probably library was not found(?).
SCENE BUILDER VERSION: 8.5 (because fontawesome icons dont work with higher versions)
Java SDK: 11
Fontawesome version: 8.9
I tried to connect jar file as a global library in the project's structure - is this a correct way to do that?
This is the error (actually the most valuable part of it)
"C:\Program Files\Java\jdk-11.0.2\bin\java.exe" --add-modules javafx.base,javafx.graphics --add-reads javafx.base=ALL-UNNAMED --add-reads javafx.graphics=ALL-UNNAMED "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\lib\idea_rt.jar=63160:C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\bin" -Dfile.encoding=UTF-8 -p "C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.base.jar;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.graphics.jar;C:\Users\ekoal\Documents\Aplikacja\DigitalSchoolDiary\out\production\DigitalSchoolDiary;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx-swt.jar;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.controls.jar;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.fxml.jar;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.media.jar;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.swing.jar;C:\Program Files\Java\javafx-sdk-11.0.2\lib\javafx.web.jar;C:\Users\ekoal\Downloads\fontawesomefx-8.9.jar;C:\Users\ekoal\Documents\Aplikacja\DigitalSchoolDiary\lib\jfoenix-9.0.8.jar" -m DigitalSchoolDiary/main.Launch
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javafx.fxml.LoadException:
/C:/Users/ekoal/Documents/Aplikacja/DigitalSchoolDiary/out/production/DigitalSchoolDiary/views/LoginUI.fxml
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2863)
at javafx.fxml/javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2707)
at javafx.fxml/javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2676)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2542)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3237)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3194)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3163)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3136)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3113)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3106)
at DigitalSchoolDiary/main.Launch.start(Launch.java:22)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
Caused by: java.lang.ClassNotFoundException: de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at javafx.fxml/javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2931)
at javafx.fxml/javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2920)
at javafx.fxml/javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2861)
... 20 more
Exception running application main.Launch
Process finished with exit code 1
And this is my fxml import part of the font awesome:
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
EDIT:
IML file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="JavaFX11" level="application" />
<orderEntry type="library" name="javaFX11" level="application" />
<orderEntry type="library" name="fontawesomefx-8.9" level="project" />
<orderEntry type="library" name="JFoenix-9.0.8" level="project" />
</component>
</module>
I am not sure if this is what you were asking about - because I have read a lot about dependencies right now and it seems like the more I read about it, the more confused I am.
I have added JAR file to the project's libraries folder in the modules section.
Also I found post on other site where guy had a similar problem and at the end he said: "I fixed the issue by just updating my jfoenix to version 9.0.6 from 8.0.7"
Unfortunately it didn't worked for me.
Could you tell me please - am I connecting this library in a right way?
I am using JDK.12.0.1 and it works good for me but you should add a JAR file from this website. Add it to your current project.
You have to modify also your module-info.java with requires fontawesomefx.
I hope that will helps you.

tomee persistence.xml in EJB JAR META-INF crashes my application deployment

I am using TomEE to deploy an EAR file, that contains one EJB JAR and one WAR.
I want to add entities using the default provider. I have created a resource in tomee.xml to use MySQL DB.
Then I would like to use entity manager so I am trying to create the following persistence.xml in the EJB JAR META-INF directory:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="MyProjectDataBase" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>MyProjectDS</jta-data-source>
<non-jta-data-source>MyProjectDSUnmanaged</non-jta-data-source>
<properties>
<property name="openjpa.jdbc.DBDictionary" value="mysql" />
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
</properties>
</persistence-unit>
</persistence>
MyProject & MyProjectUnmanaged are the resources Ids I created in tomee.xml.
Once I add this persistence.xml I get the following exception in catalina.out and my app is not deployed:
SEVERE: Application could not be deployed: /Users/avitale/Development/apache-tomee-jaxrs-1.5.0/apps/projecteam-ear
org.apache.openejb.OpenEJBException: Creating application failed: /Users/avitale/Development/apache-tomee-jaxrs-1.5.0/apps/projecteam-ear: loader (instance of org/apache/catalina/loader/StandardClassLoader): attempted duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:940)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:532)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:433)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:341)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:231)
at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:131)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:113)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
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 org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Caused by: java.lang.LinkageError: loader (instance of org/apache/catalina/loader/StandardClassLoader): attempted duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.openejb.cdi.OptimizedLoaderService.loadWebBeansPlugins(OptimizedLoaderService.java:70)
at org.apache.openejb.cdi.OptimizedLoaderService.load(OptimizedLoaderService.java:53)
at org.apache.openejb.cdi.OptimizedLoaderService.load(OptimizedLoaderService.java:47)
at org.apache.webbeans.plugins.PluginLoader.startUp(PluginLoader.java:75)
at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:159)
at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:150)
at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:44)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:794)
... 20 more
Once I remove the persistence.xml then the application is successfully deployed.
Please help me as I don't understand how to proceed :(
Thanks in advance.
Would be helpful if you could specify the version you are actually using.
More over, did you check you won't deliver TomEE or any related dependencies in your EAR file (I mean lib/ or WEB-INF/lib)?
For your information, TomEE 1.5.1 will be released shortly with some fixes around EAR deployments.

com.impetus.kundera.utils.InvalidConfigurationException: Could not find any META-INF/persistence.xml file in the classpath

I am trying to deploy sample war file build using Kundera on jboss AS7.1.1.final.
Here are the steps which I have followed:
1. created a module (com.impetus.kundera), here is module.xml
<module xmlns="urn:jboss:module:1.1" name="com.impetus.kundera" slot="2.0.7">
<resources>
<resource-root path="kundera-core-2.0.7-SNAPSHOT.jar"/>
<resource-root path="cglib-2.2.jar"/>
<resource-root path="commons-logging-1.1.1.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="org.javassist"/>
<module name="org.slf4j"/>
<module name="org.apache.commons.lang"/>
<module name="org.apache.commons.collections"/>
</dependencies>
Copied resource root path jars under 2.0.7 folder.
Modified persistence.xml for:
<property name="jboss.as.jpa.providerModule"
value="com.impetus.kundera:2.0.7" />
Note: My persistence.xml is under deployment/KunderaSampleApp.war/WEB-INF/classes/META-INF folder, but somehow I am getting given below error:
org.jboss.msc.service.StartException in service
jboss.persistenceunit."KunderaSampleApp.war#personnel_cass_pu": Failed
to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_15]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_15]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_15] Caused by: com.impetus.kundera.loader.PersistenceLoaderException:
com.impetus.kundera.utils.InvalidConfigurationException: Could not
find any META-INF/persistence.xml file in the classpath
at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:102)
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:63)
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:96)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:71)
at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:58)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more Caused by: com.impetus.kundera.utils.InvalidConfigurationException: Could not
find any META-INF/persistence.xml file in the classpath
at com.impetus.kundera.configure.PersistenceUnitConfiguration.findPersistenceMetadatas(PersistenceUnitConfiguration.java:130)
at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:86)
... 11 more
19:17:46,590 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service
jboss.persistenceunit."KunderaSampleApp.war#address_mongo_pu":
org.jboss.msc.service.StartException in service
jboss.persistenceunit."KunderaSampleApp.war#address_mongo_pu": Failed
to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_15]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_15]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_15] Caused by: com.impetus.kundera.loader.PersistenceLoaderException:
com.impetus.kundera.utils.InvalidConfigurationException: Could not
find any META-INF/persistence.xml file in the classpath
at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:102)
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:63)
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:96)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:71)
at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:58)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more Caused by: com.impetus.kundera.utils.InvalidConfigurationException: Could not
find any META-INF/persistence.xml file in the classpath
at com.impetus.kundera.configure.PersistenceUnitConfiguration.findPersistenceMetadatas(PersistenceUnitConfiguration.java:130)
at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:86)
... 11 more
It is working absolutely fine with JBoss AS5CR2.
Any pointer to issue will be a great help!
-Vivek
I'm not sure you can just replace the JPA implementation like that. You can have a look at https://community.jboss.org/wiki/HowToUseEclipseLinkWithAS7 which may give some help, but I'm not sure it of any details.
You might have better luck asking in the JBoss Comunity forums.
Also you shouldn't need to add the commons-logging library. Just use <module name="org.apache.commons.logging"/>.

javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found with maven tomcat plugin

i am running on maven 2 and i am using the Apache Tomcat Maven Plugin for tomcat 7
with the following configuration:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-beta-1</version>
<configuration>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
but when trying to run the application with mvn tomcat7:run
i am getting the following exception:
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
please advise how to fix this exception.
It seems that is a problem in the tomcat version bundled with the tomcat7-maven-plugin (which is fixed to 7.0.25). See this answer on a similar question.