java.lang.ClassNotFoundException: kodo.persistence.PersistenceProviderImpl - weblogic.developer.interest.kodo(Archived)

I'm trying to enhance my code by specifying the kodo.persistence.PersistenceProviderImpl provider in my persistence.xml file. However, when I run my enhance task I get the following error:
[jpac] WARNING: Unable to load persistence provider "kodo.persistence.PersistenceProviderImpl" due to "java.lang.ClassNotFoundException: kodo.persistence.PersistenceProviderImpl"
As a result, enhancing fails. Kodo.jar is in my classpath so I have no idea why I get a ClassNotFoundException. In addition, if I switch the provider to be org.apache.openjpa.persistence.PersistenceProviderImpl I can enhance my code successfully.
Any help is greatly appreciated.

Related

Problem with standalone Toplink Essentials (Spring/JPA)

I'm using the Glassfish/Toplink JPA implementation in combination with the new JPA code in 2.0M5. Works great when I run my web app from within Maven using the jetty6 maven plugin.
But, when I deploy my app as a WAR to an application server I get the following exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: URI scheme is not "file"
Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
at java.io.File.<init>(File.java:338)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getPersistentClassNamesFromURL(PersistenceUnitProcessor.java:556)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.buildPersistentClassSet(PersistenceUnitProcessor.java:401)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.buildEntityList(EntityManagerSetupImpl.java:159)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:492)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:154)
at org.springframework.orm.jpa.ContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(ContainerEntityManagerFactoryBean.java:181)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:232)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:901)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:870)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:393)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:256)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:332)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
at com.sun.enterprise.web.WebModule.start(WebModule.java:292)
...
This happens with both Glassfish and plain Tomcat.
I don't really understand the problem. It looks like some classpath issue, but it is not clear what Toplink is looking for.
S. 
Hello,
Does this work if you set the <exclude-unlisted-classes> tag to true and list your classes in the persistence.xml as described in:
http://www.oracle.com/technology/products/ias/toplink/jpa/howto/java-se-usage.html
If it works, the problem might be with searching the persistence context for entities using a non-url classloader.
Best Regards,
Chris

NullPointer in trying to read sessions.xml

Hi, I'm trying move to a new system and I'm having a hard time getting past this exception. The sessions.xml file is found but it doesn't seem to be parsing it at all. I've even changed the code to try to load a specific sessions.xml - mysessions.xml. No change. Maybe this error is more of a ClassNotFound than a NP?
Any ideas?
Thanks,
Bret
java.lang.NullPointerException
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.loadDocument(XMLSessionConfigLoader.java:166)
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.loadDocument(XMLSessionConfigLoader.java:156)
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:93)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:367)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:194) 
Perhaps the file is not there, or the session name does not exist in the file.
Include your call to SessionManager, your sessions.xml and its location.
-- James : http://www.eclipselink.org 
The above stacktrace was created when just using the defaults - sessions.xml
session = (ServerSession)SessionManager.getManager()          .getSession("TBS",false);
This code below over-rides the default and uses mysessions.xml.
oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader loader = new oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader("mysessions.xml");
session = (ServerSession)SessionManager.getManager().getSession(loader,"TBS",getClass().getClassLoader());
The stack I get there is:
java.lang.NullPointerException
at oracle.toplink.platform.xml.XMLPlatformFactory.getXMLPlatformClass(XMLPlatformFactory.java:51)
at oracle.toplink.platform.xml.XMLPlatformFactory.getXMLPlatform(XMLPlatformFactory.java:75)
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.loadDocument(XMLSessionConfigLoader.java:188)
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.loadDocument(XMLSessionConfigLoader.java:156)
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:93)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:367)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:269)
Thanks 
If I remove the sessions.xml I get a useful exception. So I know it's at least being found.
Exception Description: The sessions.xml resource [mysessions.xml] was not found on the resource path. Check that the resource name/path and classloader passed to the SessionManager.getSession are correct. The sessions.xml should be included in the root of the applications deployed jar, if the sessions.xml is deployed in a sub-directory in the applications jar ensure that the correct resource path using "/" not "\" is used.

weblogic 6.01 and crimson Sax parser

Hi,
I am using weblogic 6.01 and parsing xml data.
I am using both sax and dom to parse my xml in two different cases.
In my weblogic xml registry, I added these two entries
org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
org.apache.crimson.jaxp.SAXParserFactoryImpl
In case of dom, when I get new instance of factory, I am getting the correct
class,
but in case of sax I am not able to get above sax factory class.
I get this exception
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.AbstractMethodError
java.lang.AbstractMethodError
at
com.datamap.arch.datamap.BasicTransportableDelegate.convertToXml(Basi
cTransportableDelegate.java:550)
Both these factory classes are in same crimson.jar and that jar is in
classpath.
If I try to instantiate directly in program using
SAXParserFactory saxParserFactory = new
org.apache.crimson.jaxp.SAXParserFactoryImpl() , it works
But throw weblogic registry, it doesn't.
Any help would be greatly appriciated
Mahendra
Make sure that the crimson jar file is the first entry in the classpath.
ymk
Mahendra wrote:
Hi,
I am using weblogic 6.01 and parsing xml data.
I am using both sax and dom to parse my xml in two different cases.
In my weblogic xml registry, I added these two entries
org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
org.apache.crimson.jaxp.SAXParserFactoryImpl
In case of dom, when I get new instance of factory, I am getting the correct
class,
but in case of sax I am not able to get above sax factory class.
I get this exception
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.AbstractMethodError
java.lang.AbstractMethodError
at
com.datamap.arch.datamap.BasicTransportableDelegate.convertToXml(Basi
cTransportableDelegate.java:550)
Both these factory classes are in same crimson.jar and that jar is in
classpath.
If I try to instantiate directly in program using
SAXParserFactory saxParserFactory = new
org.apache.crimson.jaxp.SAXParserFactoryImpl() , it works
But throw weblogic registry, it doesn't.
Any help would be greatly appriciated
Mahendra

problem with Hibernate/WL 10.3/Eclipse while deploying

Hello
We have an enterprise application project with Eclipse. We use hibernate for persistence. While deploying I get the folowing error:
weblogic.deployment.EnvironmentException: Error processing persitence unit AwarePU of module TemplateStorage-ejb.jar: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit AwarePU: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence
I understand that WL 10.3 has Kodo - BEA’s former JPA implementation and is not shipped with hibernate. There might be an easy way to resolve this. Any reply would be highly appreciated.....
Thanks 
java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence
Add the Hibernate JARs to classpath. 
Thanks. I did inchude hibernate-entitymanager.jar into /root/bea/user_projects/domains/<project_name>/lib
and get the following error:
An error occurred during activation of changes, please see the log for details.
org.hibernate.proxy.EntityNotFoundDelegate
An error occurred during activation of changes, please see the log for details.
Could not initialize class org.hibernate.ejb.Ejb3Configuration
I am deploying an enterprise app with a few EJB modules.
Thanks 
org.hibernate.ejb.Ejb3Configuration is not getting initialized, because the class might have a dependency on classes in other jars. Add all the jars in the lib directory to classpath with lib/*, which is a new classpath feature in JDK 6.

Can't deploy composite with an added jar, says missing class....

I have created a soa composite app that has a spring context in it. I downloaded a jar called spring-ldap-1.3.1, and added it to the Libraries and classpath, then wrote some java classes using classes within the jar. I also created a bean that references a class in the jar. I have no compilation errors and everything seems to be fine, but when I try to deploy the composite I get the following error
There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: LDAPContext to service engine: implementation.spring, for composite: LDAPTest: SCA Engine deployment failure.: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wlsLdapUserRepository' defined in URL [oramds:/deployed-composites/default/LDAPTest_rev1.0/LDAPContext.xml]: Cannot resolve reference to bean 'ldapTemplate' while setting bean property 'ldapTemplate'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.ldap.core.LdapTemplate] for bean with name 'ldapTemplate' defined in URL [oramds:/deployed-composites/default/LDAPTest_rev1.0/LDAPContext.xml]; nested exception is oracle.classloader.util.AnnotatedClassNotFoundException:
       Missing class: org.springframework.ldap.core.LdapTemplate
     Dependent class: org.springframework.util.ClassUtils
              Loader: sun.misc.Launcher$AppClassLoader#26022015
         Code-Source: /C:/Oracle/MiddlewareNew/oracle_common/modules/org.springframework_2.5.jar
       Configuration: /C:/Oracle/MiddlewareNew/oracle_common/modules/org.springframework_2.5.jarThe missing class that it is looking for is in the jar file, is there something extra that I have to do with the jar when deploying besides adding it to the libraries and classpath in the project properties? 
I've tried adding the jar to the classpath, installing the jar on the weblogic server, adding all the dependencies, and adding the jar to the project sourcepath. None of these worked either. Any Help would be appreciated.

Categories

Resources