Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » ClassLoader, GlassFish for Java SE and Eclipse-RichClient
ClassLoader, GlassFish for Java SE and Eclipse-RichClient [message #433633] Wed, 29 March 2006 14:56 Go to next message
Eclipse UserFriend
Originally posted by: traykov.yahoo.com

Hi,
My question is "Do I need in Daly a personal ClassLoader if i use it from
within an Eclipse plugin and how is solved this specification issue in
Dali?

I know here is not the place for such question but I am already desparate
after two days of trying.
I am trying to use the glassfish-implementation for an Eclipse RichClient
application and I get always the same ClassCast exception (given at the
end of this posting). From a TestCase in the same directory it works
(within eclipse). I have debugged the application with the source code
from glassfish (class Persistence : line 88) and I really dont understand
why I cannot cast the returned (not null) object from type
EntityManagerFactoryProvider to the PersistenceProvider :

providers.add((PersistenceProvider)loader.loadClass(s).newIn stance());

I tried to start the application also without the LazyStart option and
also by setting the default class loader to the one which eclipse (current
thread) uses (also loading with it the EntityManagerFactoryProvider).
Didn't help. It has in my opinion to do with the runtime-properties of the
project, so I will really appreciate an opinion about the meaning of this
exception.

java.lang.ClassCastException:
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
at javax.persistence.Persistence.findAllProviders(Persistence.j ava:88)
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:55)
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:48)
...
Re: ClassLoader, GlassFish for Java SE and Eclipse-RichClient [message #433637 is a reply to message #433633] Thu, 30 March 2006 21:29 Go to previous messageGo to next message
Shaun Smith is currently offline Shaun SmithFriend
Messages: 197
Registered: July 2009
Senior Member
Rumen Traykov wrote:

> Hi,
> My question is "Do I need in Daly a personal ClassLoader if i use it from
> within an Eclipse plugin and how is solved this specification issue in
> Dali?

I haven't got any experience building rich clients but I have no problems
building and running application managed persistence apps using TopLink
Essentials inside Eclipse.

I have the glassfish jars in my classpath, I have a persistence.xml
defining a persistence unit called "default", and my application
bootstraps persistence with:

Persistence.createEntityManagerFactory("default");

When running out of container you also need to boot with the essentials
agent jar to support load time weaving:
https://glassfish.dev.java.net/javaee5/persistence/entity-pe rsistence-support.html#Java_SE

Are you using -javaagent when you boot the RCP program? I can imagine
Eclipse does some fancy classloader manipulation due to plugins so I'm not
sure if it'll work "out of the box" or not.

If you don't use lazy OneToOne's you don't have to use weaving so perhaps
you can try running the plugin without it?

--Shaun
Re: ClassLoader, GlassFish for Java SE and Eclipse-RichClient [message #433638 is a reply to message #433637] Fri, 31 March 2006 04:28 Go to previous message
Eclipse UserFriend
Originally posted by: traykov.yahoo.com

Hi,

thanks for the help.

>Are you using -javaagent when you boot the RCP program?
Yes, I start it as eclipse application and set this parameter as
VM-argument in the run-configuration. When I use glassfish from my
test-cases it's running without any problems.
How can I shut off the weaving when not from the persistence.xml? What I
mean is that it doesn't come to parsing the persistence.xml file, but I
also don't get the exception when the agent is missing.

thanks
rumen
Re: ClassLoader, GlassFish for Java SE and Eclipse-RichClient [message #578130 is a reply to message #433633] Thu, 30 March 2006 21:29 Go to previous message
Shaun Smith is currently offline Shaun SmithFriend
Messages: 197
Registered: July 2009
Senior Member
Rumen Traykov wrote:

> Hi,
> My question is "Do I need in Daly a personal ClassLoader if i use it from
> within an Eclipse plugin and how is solved this specification issue in
> Dali?

I haven't got any experience building rich clients but I have no problems
building and running application managed persistence apps using TopLink
Essentials inside Eclipse.

I have the glassfish jars in my classpath, I have a persistence.xml
defining a persistence unit called "default", and my application
bootstraps persistence with:

Persistence.createEntityManagerFactory("default");

When running out of container you also need to boot with the essentials
agent jar to support load time weaving:
https://glassfish.dev.java.net/javaee5/persistence/entity-pe rsistence-support.html#Java_SE

Are you using -javaagent when you boot the RCP program? I can imagine
Eclipse does some fancy classloader manipulation due to plugins so I'm not
sure if it'll work "out of the box" or not.

If you don't use lazy OneToOne's you don't have to use weaving so perhaps
you can try running the plugin without it?

--Shaun
Re: ClassLoader, GlassFish for Java SE and Eclipse-RichClient [message #578157 is a reply to message #433637] Fri, 31 March 2006 04:28 Go to previous message
Eclipse UserFriend
Originally posted by: traykov.yahoo.com

Hi,

thanks for the help.

>Are you using -javaagent when you boot the RCP program?
Yes, I start it as eclipse application and set this parameter as
VM-argument in the run-configuration. When I use glassfish from my
test-cases it's running without any problems.
How can I shut off the weaving when not from the persistence.xml? What I
mean is that it doesn't come to parsing the persistence.xml file, but I
also don't get the exception when the agent is missing.

thanks
rumen
Previous Topic:Questions about M1, I2 drop of Dali
Next Topic:Mising Persistence Class
Goto Forum:
  


Current Time: Fri Mar 29 06:34:58 GMT 2024

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

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

Back to the top