TopLink to EclipseLink migration - Missing class for indicator field value - eclipselink

I am migrating Toplink 11g to EclipseLink 12.1.3. I have EclipseLink.jar to the classpath. I have few mapping xml files. When executing the application, i am getting following error.
Exception [EclipseLink-9005] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.SessionLoaderException
Exception Description: An exception was thrown while loading the project-xml file [META-INF/Business.xml].
Internal Exception: Exception [EclipseLink-43] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [toplink:object-type-mapping] of type [class java.lang.String].
Descriptor: XMLDescriptor(org.eclipse.persistence.mappings.DatabaseMapping --> [DatabaseTable(attribute-mapping)]).
How to resolve this.

You are required to run package renamers etc as described here http://docs.oracle.com/middleware/1212/toplink/TLADG/migrnativetoplink.htm
If you have run the package renamer tools already, search your project.xml file for the toplink:object-type-mapping string which apparently wasn't converted correctly and the logs from running the renaming tool to determine why it wasn't converted.

Related

EclipseLink Moxy with Java11

I asked this questions already here:
https://www.eclipse.org/forums/index.php/t/1098133/
Now, after 3 weeks, i hope to have luck to reach a response here in stackoverflow.
I have a RCP applcation using MOXy to parse complex XML, the annotated classes are generated by XJC, and the package contains a ObjectFactory and a jaxb.properties pointing to MOXy.
The problem: The application works with Java8, but starting the application with Java11, i get this exception:
java.lang.RuntimeException: javax.xml.bind.JAXBException
- with linked exception:
[Exception [EclipseLink-50000] (Eclipse Persistence Services - 2.7.4.v20190115-ad5b7c6b2a): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The context path mypackage contains no ObjectFactory or jaxb.index, no external metadata was found in properties Map, and sessions.xml was found or was invalid.
Internal Exception: Exception [EclipseLink-7095] (Eclipse Persistence Services - 2.7.4.v20190115-ad5b7c6b2a): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The sessions.xml resource [sessions.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 application's deployed jar, if the sessions.xml is deployed in a sub-directory in the application's jar ensure that the correct resource path using "/" not "\" is used.]
My target platform contains:
org.eclipse.persistence.moxy_2.7.4....jar
jaxb-osgi-2.3.2.jar
jakarta.activation.jar
jakarta.xml.bind-api.jar
I use Multi-Release: true to be able to handle Java8 vs. Java9+.
In the main MANIFEST.FM i require org.eclipse.persistence.moxy.
In the versions/9/OSGI-INF/MANIFEST.FM I add the import packages: com.sun.xml.bind.v2, javax.xml.bind
To start the application in the Eclipse run configuration dialog, i switch the JRE Java8 vs Java11, and in the plugins tab, i remove (J8) or add (J11) com.sun.xml.bind.jaxb-osgi (jaxb-osgi.jar) to make it startable.
Can someone help?
regards
Frank

Exception while running Seedstack Application

I have used seedstack dependecies for Hibernate and JPA to create DAO services that performs crud operations on Database.
I am trying to Launch this Seedstack application module through Java application Launcher in eclipse, by SeedMain class.
In pom.xml - dependecy for undertow is given.
<dependency>
<groupId>org.seedstack.seed</groupId>
<artifactId>seed-web-undertow</artifactId>
</dependency>
When executing the SeedMain class, I am getting the below error snakeyaml error:-
Exception in thread "main" java.lang.NoSuchMethodError: org.yaml.snakeyaml.DumperOptions.setSplitLines(Z)V
at com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.buildDumperOptions(YAMLGenerator.java:259)
at com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.<init>(YAMLGenerator.java:232)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createGenerator(YAMLFactory.java:447)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createGenerator(YAMLFactory.java:397)
at org.seedstack.seed.core.internal.diagnostic.DefaultDiagnosticReporter.writeDiagnosticReport(DefaultDiagnosticReporter.java:75)
at org.seedstack.seed.core.internal.diagnostic.DefaultDiagnosticReporter.writeDiagnosticReport(DefaultDiagnosticReporter.java:67)
at org.seedstack.seed.core.internal.diagnostic.DiagnosticManagerImpl.dumpDiagnosticReport(DiagnosticManagerImpl.java:70)
at org.seedstack.seed.core.SeedMain.handleException(SeedMain.java:68)
at org.seedstack.seed.core.SeedMain.main(SeedMain.java:61)
As per my understanding the Error is due to some version inconsistency for snakeyaml, But for Seedstack as the versions for dependecies are resolved by seedstack-bom dependecy, so where exactly should I do the changes to resolve the error.
Thanks in Advance!
From reading the stacktrace, it seems that you have some error on startup which is handled by the handleException() method. This method then tries to write a YAML diagnostic report but ultimately fails due to the snakeyaml version issue you mentioned.
You should do two things:
Fix the snakeyaml dependency issue by looking into the dependency tree. This kind of problem is often caused by some library that makes Maven choose an older version. SeedStack needs at least jackson-dataformat-yaml version 2.9.4 which in turn needs at least snakeyaml 1.18.
Fix the other error by looking at the full stacktrace. When a diagnostic report cannot be written, the original exception is still printed on the console (on stderr).

When deploy a webapp to WebLogic12c encounters a JAXBException

I try to deploy a application on WebLogic 12c(version:12.1.2.0.0), when staring up it encounters an Exception as blow:
Failed to create the JAXB binder; nested exception is javax.xml.bind.JAXBException: provider org.eclipse.persistence.jaxb.JAXBContextFactory could not be instantiated: javax.xml.bind.JAXBException:
Exception Description: The java interface org.apache.camel.Endpoing can not be mapped by JAXB as it has multiple mappable parent interfaces. Multiple inheritence is not supported
- with linked exception:
[Exception [EclipseLink-50089] (Eclipse Persistence Service - 2.4.2.v2013-0514-5956486): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The java interface org.apache.camel.Endpoing can not be mapped by JAXB as it has multiple mappable parent interfaces. Multiple inheritence is not supported
But it doesn't happen when deploy to WebLogic11g(version:10.3.3.0).
Is this caused by a jar conflict?
I found a solution at the following threads:
http://camel.465427.n5.nabble.com/Spring-Camel-Context-initialization-error-in-weblogic-12c-td5733202.html
http://camel.465427.n5.nabble.com/Help-on-deploying-Camel-on-Weblogic-12c-Name-Collision-td5720837.html
After putting the jaxb.properties in my camel-spring-x.x.x.jar and redeploy, the problem has gone.

Ejb deployment to WebLogic Server 11g

I am using WebLogic 11g. I am using Eclipse. I have created a EJB project. This project is called 'remote-ejb'.
The bean class HelloWorldBean implements a remote interface HelloWorldBeanRemote with just on method; public String getName();
I then deployed this project as an application successfully.
I then created a second EJB project called cart-ejb. This project uses the bean from the first project. When I deploy this
project I get the following error:
Module named 'cart-ejb' failed to deploy. See Error Log view for more detail.
weblogic.application.ModuleException: java.lang.ClassNotFoundException: beans.HelloWorldBeanRemote
Exception received from deployment driver. See Error Log view for more detail.
How can I fix this error?

Error testing ejb 3.1 (netbeans-glassifish-junit4)

I'm trying to unit testing a EJB with entity crud operations. I already was capable of testing it just running my web application (and all works), but I want to do it with JUnit.
So, my environment is Netbeans 7, Glassfish 3.1 (JavaDB, EclipseLink), JUnit4.
When I create a test class for my EJB, the code template uses the following line of code that throw an exception when I run the code:
EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer();
the exception is:
java.lang.RuntimeException: Invalid resource : jdbc/mine__pm
Exception while preparing the app : Invalid resource : jdbc/mine__pm
My EJB has an injected EntityManager that points to my persistence unit. This persistence unit is referencing a data source that I JNDI named jdbc/mine created by Netbeans for my Glassfish. It runs and I can see it on my server. I tried using a glassfish-resource.xml to do the same thing too.
Why doesn't it work?