Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » custom SessionCustomizer cannot cast to org...config.SessionCustomizer
custom SessionCustomizer cannot cast to org...config.SessionCustomizer [message #380517] Tue, 26 August 2008 22:49
Bill Blalock is currently offline Bill BlalockFriend
Messages: 119
Registered: July 2009
Location: Alabama
Senior Member
I've written a custom SessionCustomizer to set user id, password etc.
I've tested it and it works.

I have been experimenting with a headless RCP based on the example
provided in the wiki.

Eclipselink API/workbench cast my custom SessionCustomizer ok.

Eclipselink JPA also could find my custom SessionCustomizer when it was in
a Java Project that was exported as a jar file and included in the runtime
classpath of the headless RCP.

I changed from using a Java Project for my domain objects and subclasses /
implemetation of Eclipselink classes to using a plug-in. I made the
change to avoid having to export the Java Project to a jar and copy the
jar into the Headless RCP each time a change was made.

Now the runtime fails to cast my custom SessionCustomizer. Defined in
persistence.xml

<property name="eclipselink.session.customizer"
value="eclipselink.SessionSysmonCustomizer"/>

adding to persistence.xml as <class> didn't help.

Problem goes away by copying SessionSysmonCustomizer into the headless RCP
and changing the property "eclipselink.session.customizer" to match the
new package in the headless RCP.

The domain model I am tinkering with is in the same plugin as my custom
Session customizer. Persistence.xml fines the enties as long as a
<class>entity</class> is in the persistence.xml file.

Where am I going wrong?

Thanks
Bill Blalock


!ENTRY org.eclipse.osgi 4 0 2008-08-26 17:21:09.531
!MESSAGE Application error
!STACK 1
Local Exception Stack:
Exception [EclipseLink-28014] (Eclipse Persistence Services - 1.0 (Build
1.0 - 20080707)):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
Exception Description: Exception was thrown while processing property
[eclipselink.session.customizer] with value
[eclipselink.SessionSysmonCustomizer].
Internal Exception: java.lang.ClassCastException:
eclipselink.SessionSysmonCustomizer cannot be cast to
org.eclipse.persistence.config.SessionCustomizer
at
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on.failedWhileProcessingProperty(EntityManagerSetupException .java:178)
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. processSessionCustomizer(EntityManagerSetupImpl.java:1222)
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. updateServerSession(EntityManagerSetupImpl.java:1198)
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. deploy(EntityManagerSetupImpl.java:237)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.getServerSession(EntityManagerFactoryImpl.java:69)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManagerImpl(EntityManagerFactoryImpl.java:118)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManagerImpl(EntityManagerFactoryImpl.java:112)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManager(EntityManagerFactoryImpl.java:100)
at eclipselinkrcp2.Application.start(Application.java:37)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: java.lang.ClassCastException:
eclipselink.SessionSysmonCustomizer cannot be cast to
org.eclipse.persistence.config.SessionCustomizer
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. processSessionCustomizer(EntityManagerSetupImpl.java:1219)
... 20 more
Previous Topic:Support for DB2 on iSeries?
Next Topic:Broken link on web site
Goto Forum:
  


Current Time: Sat Apr 20 01:24:48 GMT 2024

Powered by FUDForum. Page generated in 0.02526 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top