MappedSuperClass

Hi *,
I'm having some trouble with a MappedSuperClass I defined. Let me build up...
Node, which keeps a reference to a Reading object:
@Entity
public class Node implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long id;
    @EmbeddedId
    private NodePK nodePK;
    @ManyToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
    private Network network;
    @OneToOne
    private Reading latestReading;
    ...//(constructors and methods)
}Unit, which is the superclass of Reading:
@MappedSuperclass
public abstract class Unit implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @OneToOne
    private Node node;
    public Unit() {}
    ...//(constructors and methods)
}Reading, which inherits from Unit
@Entity
public class Reading extends Unit implements Serializable {
    //private Node node;                         <- PROBLEM
    public Reading() {}
    ...//(constructor and methods)
}So, I create a Node object which stores its latest Reading-object, which is a subclass of Unit. To make Unit a MappedSuperClass, I annotated the class accordingly and extend its subclass Reading.
I further have a stateless session bean which does the following:
Node n1 = new Node(1, net1);
em.persist(n1);
Reading reading1 = new Reading(n1, null, 1, 2, 3);
em.persist(reading1);
n1.setLatestReading(reading1);
removeNode(1);
private void removeNode(int address) {
        Node node = (Node) em.createQuery("SELECT x " +
                "FROM Node x " +
                "WHERE x.nodePK.nodeAddress = :addr").setParameter("addr", address).getSingleResult();
        em.remove(node);
}So basically just creating a node, creating a reading, set this reading as the nodes latest reading and finally remove this all from persistence. And there it goes wrong! When running my app I get:
Caused by: org.apache.derby.client.am.SqlException: DELETE on table 'NODE' caused a violation of foreign key constraint 'READINGNODEADDRESS' for key (1,321).  The statement has been rolled back.
...I tried a bunch off stuff including adding AssociationOverride statements and moving the node property from the superclass to its subclasses. The latter works, but is kind of foolish because then the superclass has no other significant properties and I could as well not use a superclass (FYI, Reading will not be the only class extending Unit).
Something that also seems to work, is adding the node attribute both to the superclass and the subclass (so uncommenting the problem line I indicated above).
Can someone help me with this? I've been struggling for days with this and about to give up so...
Thanks!
Vaak

I am currently using TopLink Essential build 17. I was able to take my standard Employee demo model and refactor a BaseEntity class out of the Employee class.
BaseEntity
@MappedSuperclass
@TableGenerator(name = "emp-seq-table", table = "SEQUENCE",
                pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT",
                pkColumnValue = "EMP_SEQ", allocationSize=50)
public abstract class BaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "emp-seq-table")
    private int id;
    @Version
    private long version;
    public BaseEntity() {
    public void setId(int id) {
        this.id = id;
    public int getId() {
        return id;
    public void setVersion(long version) {
        this.version = version;
    public long getVersion() {
        return version;
}The Employee class now looks basically like:
@Entity
@AttributeOverride(name="id", column=@Column(name="EMP_ID"))
public class Employee extends BaseEntity implements Serializable {Doug

Similar Messages

  • Two MappedSuperClass in a hiierarchy

    @MappedSuperClass
    public class A{
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public int getMyId(...)
    @MappedSuperClass
    public class B extends A{
    @Entity
    @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
    public class C extend B{
    I have the above object hierarchy. When I start kodo, it gives the following error about class B
    <4|true|4.0.0> kodo.persistence.ArgumentException "Type class B does not declare the same identity-type as its persistent superclass."
    I have no idea what happens. your help is appreciated.
    Thank you in advance.
    Siyamed

    Thank you for finding this problem. We've confirmed this is a bug and fixed it internally for our upcoming 4.1 release (the fix is in OpenJPA). The bug only affects deep hierarchies with more than one @MappedSuperclass in them.

  • How to unmap a mapping inheried from a @MappedSuperclass

    Hi,
    I have a superclass (annotated with @MappedSuperclass) which defines mappings for several fields.
    Is it possible for me to inherit all of these mappings except one? Is it at all possible to eliminate a mapping that comes from the mapped superclass?
    I tried with:
    @AttributeOverride(name="theFieldToBeUnmapped", column=@Column(name=""))but, of course, it didn't work.
    The mapped superclass is used by several other classes, so I shouldn't remove any fields from it. But in my concrete case one of the fields is not present in the underlying table and I should somehow eliminate its mapping.
    Best regards,
    Bisser
    P.S. Something like:
    @AttributeOverride(name="theFieldToBeUnmapped", column=@Transient)would have been great, had it been able to compile.

    Hi James,
    Thank you for replying.
    Currently, the mapped superclass contains the definitions of five separate fields. All of them are mapped to the database.
    There's some very specific logic for each of these fields. The logic is implemented in the class' methods. In order to avoid the duplication of that logic in many places, it was put in one single class that can be subclassed as needed.
    In normal situations (that do not involve DB persistence), that would have to be implemented via the Strategy pattern for each of these fields. However, currently I don't know whether it's possible to make a JPA Entity that employs the Strategy pattern to encapsulate variation. I think it's not possible and I realize how hard it would have been to include such a feature in JPA.
    However, as the class stands at the moment, it's not quite flexible. I will either get all the fields it contains or none at all. I cannot implement all possible field combinations in separate @MappedSuperclasses because (1) there will be a combinatorial explosion, (2) I cannot have multiple inheritance in Java, and (3) the idea is to have the specific methods in one place, not in many places. So, I can take this field out into a separate @MappedSubclass, but then over time somebody else will need to take some other field out and we'll have to create many combinations.
    It seems that the best JPA-enabled solution (that is, without the Strategy pattern being involved) is to be able to unmap some of the fields that I don't need. For that purpose, it seems, I should go for the DescriptorCustomizer as you suggest.
    Thank you!
    Best regards,
    Bisser

  • MappedSuperclass inheritance problem

    Using Oracle TopLink Essentials - 2006.6 (Build 060608)
    Here is the hierarchy:
    @MappedSuperclass
    public abstract class AbstractEntity implements Serializable, Persistable {
    @Version
    @Column(name="VERSION")
    private Integer version;
    @Entity
    @TableGenerator(name = "event", table = "ID_GEN", pkColumnName = "GEN_KEY", valueColumnName = "GEN_VALUE", pkColumnValue = "EVENT_POID", allocationSize = 1)
    @Table(name = "EVENT")
    @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
    @DiscriminatorColumn(name = "EVENT_TYPE")
    public abstract class Event extends AbstractEntity {
    @Entity
    @DiscriminatorValue(value = "APPOINTMENT")
    public class Appointment extends Event {
    Results in the following exception
    Exception Description: Multiple writable mappings exist for the field [EVENT.VERSION]. Only one may be defined as writable, all others must be specified read-only.
    What am I missing? I am using field annotations, I do not override the version on any subclass nor add any further annotation for VERSION, where in the heck is it getting a second mapping?
    This does not occur when using Toplink essentials v2 b56. However I am unable to query for the Appointments in the DB using find(Appointment.class,1).
    Thanks.

    Ignore the reference to search for the Appointment class. That was a separate issue.

  • MappedSuperClass problem on Weblogic 12c

    Hello.
    I'm trying to use @MappedSuperClass in myApp.
    When I deploy my app to weblogic 12c, it gives me following error.
    in my experience it occures error when i write Country.class in the code.
    *[HTTP:101216]Servlet: "TestSuperService" failed to preload on startup in Web application: "MyApp". java.lang.NoSuchMethodError: data.GeneralEntity.pcGetManagedFieldCount()I at myApp.entity.Country.<clinit>(Country.java) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:119) at org.eclipse.persistence.mappings.foundation.AbstractCompositeCollectionMapping.convertClassNamesToClasses(AbstractCompositeCollectionMapping.java:352) at org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1534) at org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:432) at*
    Here is GeneralEntity class in data project :
    *@MappedSuperclass*
    *public abstract class GeneralEntity implements Serializable  {*
    *@Id*
    private BigDecimal pkId;
    *@Column*
    private String Id;
    *public void setPkId(BigDecimal pkId) {*
    this.pkId = pkId;
    *public BigDecimal getPkId() {*
    return pkId;
    *public void setId(String Id) {*
    this.Id = Id;
    *public String getId() {*
    return Id;
    Here is Country class in myApp.entity project :
    *@Entity*
    *public class Country extends GeneralEntity{*
    *public Country() {*       
    *@Column*
    private String region;
    *public void setRegion(String region) {*
    this.region = region;
    *public String getRegion() {*
    return region;
    Please everyone help me to solve this problem
    thanks
    Edited by: 896641 on Jan 2, 2012 12:20 PM

    There isn't much to go on. My first guess was that Country.class is in code that is run before the persistence unit is deployed causing a classloader issue. Googling the error brings up CR370788
    in : http://docs.oracle.com/cd/E15051_01/wls/docs103/pdf/issues.pdf
    which suggests this can occur in a particular situation that seems related - the modules you are using will need to be reordered.
    You can also try using static weaving as a workaround if the above does not work, described here:
    http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Configure_Static_Weaving_for_JPA_Entities
    weaving is described here:
    http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Weaving
    Static weaving may not work though as the pcGetManagedFieldCount method is not added by EclipseLink weaving anyway. If neither work, please post the application structure and the persistence.xml being used.
    Best Regards,
    Chris

  • EclipseLink 1.0 & Spring 2.5 - Exception entity extending @MappedSuperclass

    Hi All
    I'm attempting to leverage EclipseLink in combination with Spring 2.5 using J2SE (via Jetty server). I've adapted the petclinic/eclipselink sample found at http://blog.springsource.com/main/2008/07/17/using-eclipselink-on-the-springsource-application-platform .
    I'm getting an exception with an entity object that extends a superclass marked with @MappedSuperclass.
    The superclasses provide the name and id attributes respectively. The entity that is failing, does not actually introduce any additional attributes (id/name are sufficient for it).
    Anyway, I have an extremely cutdown version of the petclinic project with just the domain objects and a business interface at the following location that can quickly reproduce the error. (33k in size) http://rapidshare.com/files/136814768/petclinic_oracle.zip
    The zip file contains a maven2 project - so all the dependencies should download automatically - assuming one has maven2 configured.
    It is configured to work with an Oracle Database. The readme file in the zip contains 4 simple steps to try the thing out.
    I would be greateful if anyone can take a quick look and see if they can work out what is at fault - spring configuration or eclipselink.
    Here is the exception:-
    2008-08-13 02:36:28.633::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
    2008-08-13 02:36:29.743::INFO:  jetty-6.1.12rc1
    2008-08-13 02:36:29.024::INFO:  No Transaction manager found - if your webapp requires one, please configure one.
    2008-08-13 02:36:29.587:/:INFO:  Initializing Spring root WebApplicationContext
    2008-08-13 02:36:31.040::WARN:  Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@1d1082f{/,C:\Documents and Settings\Administrator\Desktop\petclinic on oracle db\target\petclinic-1.0-SNAPSHOT}
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/applicationContext-persistence.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext-persistence.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0 (Build 1.0 - 20080707)): org.eclipse.persistence.exceptions.EntityManagerSetupException
    Exception Description: Predeployment of PersistenceUnit [PetClinic] failed.
    Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0 (Build 1.0 - 20080707)): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Entity class [class org.springframework.petclinic.domain.PetType] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
         at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
         at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:597)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:366)
         at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
         at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
         at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
         at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:547)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
         at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1233)
         at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:516)
         at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:459)
         at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
         at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
         at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
         at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
         at org.mortbay.jetty.Server.doStart(Server.java:222)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
         at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
         at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:371)
         at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:307)
         at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:203)
         at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
         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:585)
         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)cheers
    Matt.

    Hello,
    This could be related to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=240679 which is fixed in the 1.0.1 and 1.1 streams.
    Can you try using the latest build?
    Best Regard,
    Chris

  • @MappedSuperclass example wanted

    I am attempting to use a JPA MappedSuperclass where I can define the basic data fields and relationships for an entity, then have subclasses override it with explicit table and column names.
    To this point, I have had no success. I can get it to compile and deploy, but any data objects I get back seem to be uninitialized (all fields are null).
    Does anyone have a working example of using a MappedSuperclass in OAS 10.1.3.1.0?

    I am currently using TopLink Essential build 17. I was able to take my standard Employee demo model and refactor a BaseEntity class out of the Employee class.
    BaseEntity
    @MappedSuperclass
    @TableGenerator(name = "emp-seq-table", table = "SEQUENCE",
                    pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT",
                    pkColumnValue = "EMP_SEQ", allocationSize=50)
    public abstract class BaseEntity {
        @Id
        @GeneratedValue(strategy = GenerationType.TABLE, generator = "emp-seq-table")
        private int id;
        @Version
        private long version;
        public BaseEntity() {
        public void setId(int id) {
            this.id = id;
        public int getId() {
            return id;
        public void setVersion(long version) {
            this.version = version;
        public long getVersion() {
            return version;
    }The Employee class now looks basically like:
    @Entity
    @AttributeOverride(name="id", column=@Column(name="EMP_ID"))
    public class Employee extends BaseEntity implements Serializable {Doug

  • @MappedSuperclass and relations

    In order to minimize work, I generate by Javaclass from the DB. But to allow custom code to be present, I make another class persistent. For example article:
    @Entity
    @Table(name="article")
    public class Article extends nl.reinders.bm.generated.Article
    ... <custom code here>
    @MappedSuperclass
    package nl.reinders.bm.generated;
    public class Address
    ... <generated from db code (=properties) here>
    When there is a ManyToOne relationship between two classes, I generate both sides using @ManyToOne @JoinColumn(name=...) and @OneToMany(mappedBy...).
    The ManyToOne works, but the OneToMany not. If the code is this:
    public java.util.Collection<nl.reinders.bm.Sellorderline> iSellorderlinesWhereIAmArticle;
    The following error occurs:
    The attribute [iSellorderlinesWhereIAmArticle] in entity class [class nl.reinders.bm.Article] has a mappedBy value of [iArticlenr] which does not exist in its owning entity class [class nl.reinders.bm.Sellorderline]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
    nl.reinders.bm.Sellorderline is not a MappedSuperclass, but does not contain the iArticlenr. However referring to nl.reinders.bm.generated.Sellorderline gives the following error:
    Exception Description: [class nl.reinders.bm.Article] uses a non-entity [class nl.reinders.bm.generated.Sellorderline] as target entity in the relationship attribute [public java.util.Collection nl.reinders.bm.generated.Article.iSellorderlinesWhereIAmArticle].
    What is going on?

    Ah, nevermind, it turned out that I stripped the "nr" postfix from the property name. Problem solved.

  • JPA Generic entities classes Mappedsuperclass are not possible!

    Hi,
    I have came to understand this:
    You can use generics with fields in a class, but you cannot make the class generic or a collection in a generic form. I hope that I stated what I wanted correctly.
    This is the normal generics known to JPA!
    public class MyEntity{
    @OneToMany
    List<OtherEntity> others;But the next is not allowed!
    public class MyEntity<T extends OtherEntity>{
    @OneToMany List<T> other;
    }Please comment on this if this is true or false, as I have encountered this error while trying the same!
    I am using Toplink for a desktop Application
    Thank you
    javax.persistence.PersistenceException: No Persistence provider for EntityManager named Access1: Provider named oracle.toplink.essentials.PersistenceProvider threw unexpected exception at create EntityManagerFactory:
    oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
    Local Exception Stack:
    Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
    Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@fabe9
    Internal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: predeploy for PersistenceUnit [Access1] failed.
    Internal Exception: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
            at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:143)
            at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:169)
            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)
            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
            at edu.acis.ccms.ui.MainRMIServerInterface.connectDB(MainRMIServerInterface.java:342)
            at edu.acis.ccms.ui.MainRMIServerInterface.<init>(MainRMIServerInterface.java:102)
            at edu.acis.ccms.ui.MainRMIServerInterface.main(MainRMIServerInterface.java:1804)
            at edu.acis.ccms.main.Main.runCCMSServer(Main.java:18)
            at edu.acis.ccms.main.Main.main(Main.java:35)
    Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: predeploy for PersistenceUnit [Access1] failed.
    Internal Exception: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:643)
            at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:171)
            at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:239)
            at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:255)
            at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)
            ... 7 more
    Caused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: predeploy for PersistenceUnit [Access1] failed.
    Internal Exception: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
            at oracle.toplink.essentials.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:228)
            ... 12 more
    Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.objects.MetadataAccessibleObject.getRawClass(MetadataAccessibleObject.java:120)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataHelper.isEmbedded(MetadataHelper.java:732)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.buildAccessor(ClassAccessor.java:193)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessorFields(ClassAccessor.java:541)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessors(ClassAccessor.java:567)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processMappedSuperclass(ClassAccessor.java:1128)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MappedSuperclassAccessor.process(MappedSuperclassAccessor.java:63)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processMappedSuperclasses(ClassAccessor.java:1138)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:495)
            at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:240)
            at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:370)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:607)
            ... 11 moreEdited by: hmulhim on Feb 27, 2008 3:00 AM
    Edited by: hmulhim on Feb 27, 2008 3:01 AM

    No you will be unable to make the Entities generic. The provider will be unable to map the relationship to the specific type defined by the generic definition as this type is assigned when the Entity is created in code not where the Entity is defined. Remember when designating Generics the Collection (in this case) is limited only to those types. The Provider can not possibly be this restrictive on a per Entity instance basis. In some cases changing the type may result in entirely different tables being mapped for a single Entity instance and that is definitely not supported.
    Having said that this is a pretty poor exception that I will file a bug for.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • EJB3.0 Entity cannot get attributes of extended class

    Hi ,
    Have a very simple issue ..quite baisc one. So hopefully I"ll get an answer !
    Am using EJB3.0 with WL10.3. Like any other application , every entity has id and version column. So I decided to put these fields in EntityBase.java
    Other Entities will extend this entity .
    For EG : Entity Organisation extends EntityBase. Organisation will have only other setter/getter for attributes. Setter/Getter for id/version will be in EntityBase. Application is deployed sucessfully and I dont get any exception, But when I try to getOrganisation Entity , id and version is null. Looks like WL is not able set id and version in EntityBase.
    Am I missing something here ? How can we make an Entity extends any other class and at the same time tell the container to set/get inhertied values ? Code for EntityBase and Organisation goes something like below
    public class EntityBase implements Serializable{
         private static final long serialVersionUID = 1L;
         // ---- Entity id
         @Id     
         @GeneratedValue(strategy=GenerationType.SEQUENCE ,generator="ID_SEQ")
         @SequenceGenerator(name="ID_SEQ" ,sequenceName="OBJECT_ID_SEQ" )
         @Column(name="ID")
         private int id ;
         public int getId() {
              return this.id;
         // ---- Entity version
         @Version
         private int version ;
         public int getVersion() { return this.version; }
    Organisation.java is
    @Entity
    @Table(name="TYPED_T")
    @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
    public class Organisation extends EntityBase{
         private static final long serialVersionUID = 1L;
    ..setter/getter for other attributes
    Thanks in advance

    Hi, if you want your entity to inherit from a superclass that provides persistent entity state and mapping information, please use @MappedSuperclass.
    You can find the definition and example from EJB3.0 Spec, chapter 2.1.9.2.
    E.g.
    @MappedSuperclass
    public class Employee {
    @Id protected Integer empId;
    @Version protected Integer version;
    @ManyToOne @JoinColumn(name="ADDR")
    protected Address address;
    public Integer getEmpId() { ... }
    public void setEmpId(Integer id) { ... }
    public Address getAddress() { ... }
    public void setAddress(Address addr) { ... }
    // Default table is FTEMPLOYEE table
    @Entity
    public class FTEmployee extends Employee {
    // Inherited empId field mapped to FTEMPLOYEE.EMPID
    // Inherited version field mapped to FTEMPLOYEE.VERSION
    // Inherited address field mapped to FTEMPLOYEE.ADDR fk
    // Defaults to FTEMPLOYEE.SALARY
    protected Integer salary;
    public FTEmployee() {}
    public Integer getSalary() { ... }
    public void setSalary(Integer salary) { ... }
    Thanks,
    Amy

  • EJB 3.0 and  creating bean .xml files for DataControl

    In entity beans I haven't parameter updateble in source for column witch represent Id. I generate Id with TableGenerator strategy.
    @TableGenerator(name="TEST_SEQ", initialValue=1, allocationSize=1)
    @Column(nullable = false)
    @GeneratedValue(strategy=GenerationType.TABLE,generator="TEST_SEQ")
    @Id
    private Long id;When I create DataControl why some <entity bean>.xml files have IsUpdateable="0" parameter for attribute witch represent Id (primary key) column in entity bean?
    <Attribute Name="id" Type="java.lang.Long" IsUpdateable="0"/>In some files this parameter have default value (true), that is it does not show in source!
    If I use datacontrol (method findAll for example) with selectOneChoiche component error is:
    The selected target attribute has read-only access.Please select an updatable attributeWhen I modify files and after that refresh or create new DataControl I loss my changes in files.

    Hi Ric,
    This is the test case which describe my problem.
    Test entity:
    @Entity()
    @Table(name="TEST")
    @NamedQueries({
        @NamedQuery(name = "Test.findAll", query = "select o from Test o"),
        @NamedQuery(name = "Test.findById ", query = "select o from Testo where o.id = :id")
    public class Test extends BaseTest implements Serializable {
        @Id
        @TableGenerator(name="TEST_SEQ", initialValue=1, allocationSize=1)
        @Column(name = "ID", nullable = false)
        @GeneratedValue(strategy=GenerationType.TABLE,generator="TEST_SEQ")
        private Long id;
        private String test;
    public String getTest() {
    return test;
    public String setTest(String param) {
    this.test=param;
        public Long getId() {
            return id;
        private void setId(Long id) {
            this.id = id;
       }Base entity:
    @MappedSuperclass
    public abstract class BaseTest implements Serializable {
        @Column(name = "LASTCHANGE")
        private Timestamp lastChange;
        public MasterEntity() {
        public void setLastChange(Timestamp param) {
          this.lastChange = param;
        public Timestamp getLastChange() {
            return lastChange;
    }Main entity:
    @Entity()
    @Table(name="MAIN")
    @NamedQueries({
        @NamedQuery(name = "Test.findAll", query = "select o from Test o"),
        @NamedQuery(name = "Test.findById", query = "select o from Test o where o.id = :id")
    public class Main extends BaseTest implements Serializable {
        @Id
        @TableGenerator(name="MAIN_SEQ", initialValue=1, allocationSize=1)
        @Column(name = "ID", nullable = false)
        @GeneratedValue(strategy=GenerationType.TABLE,generator="MAIN_SEQ")
        private Long id;
        @ManyToOne
        @JoinColumn(name = "IDTEST", referencedColumnName="ID")
        private Test test;
        public Long getId() {
            return id;
        private void setId(Long id) {
            this.id = id;
        public Long getTest() {
            return test;
        private void setTest(Test test) {
            this.test = test;
       }The part code of session bean:
    public Main findById(Long id){
    return em.find(Main.class, id);
    }When I create DataControl from this sessionBean, the Test.xml(ENTITY->Test) file is generated.
    Test.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <JavaBean xmlns=" http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.45.24"
              id="Test" Package="package.test"
              BeanClass="package.test.Test"
              isJavaBased="true">
      <Attribute Name="id" IsUpdateable="0" Type="java.lang.Long"/>
      <ConstructorMethod IsCollection="false" Type="void"
                         id="Test"/>
    </JavaBean>Questions:
    Why attribute "id" have property isUpdatable="0" ?
    I didn't specify "update=false" on my entity 'Test' for that column.
    In witch case propery isUpdateble have value "0", "1", "2", "true", "false"?

  • How to create dynamic entity beans at runtime (experts welcome)

    Hi,
    i have a question that i have been trying to figure out however i am still in search of an appropriate solution and thus ask you experts for guidance...
    I am developing a system to house data using ejbs.. however a have a problem i am trying to make the system very dynamic and some of the data that i am trying to store is dynamic in its nature..
    let me explain: i am searching for a solution that would allow a entity ejb to have a dynamic set of properties
    e.g.
    DataEntity could have one or many attributes but those attributes may be string, string, int, int
    or could be int, int, int
    or long, long
    or double..... or any configuration
    this DataEntity would linked to a TypeEntity that would act as a reference to know how to store and retrieve data..
    I have just come across JMX and dynamic Mbeans, and at first glance this seemed like it may be able to help but after further research i think this handles a different problem than i am facing.. (however might be wrong?)
    At the moment i am using toplink as the OR mapping but have also jsut started looking into hibernate..
    So far all i have come up with is to have a FieldEntity as a mappedsuperclass and have sub classes such as IntFieldEntity, LongFieldEntity.... which simple contain one field i.e int value, or long value..
    . and have DataEntity have a one to many relationship with the field superclass..
    the problem with this is how this gets mapped
    my ideal solution would be to have a dynamic DataEntity which could be generated at runtime and have all the required attributes for the particular type..
    so DataEntity would be a mappedsuperclass and then at runtime new types of DataEntity's could get spawned, database table created and OR mapping created linking?
    e.g.
    DataEnity1
    String attribute1;
    String attribute2;
    int attribute3;
    DataEnity2
    int attribute1;
    int attribute2;
    long attribute3;
    Has anyone ever created a structure like this or seen anything like this before?
    any advice would be appreciated
    regards,
    fg

    You cant add controls to the visual tree a runtime which persist beyond the lifetime of the application.  You will have to persist an indicator to your program which tells it to add the control.  Adding a control is as simple as initializing
    it and adding it to a parent already on the tree.  Controls can be created programmatically or using the XamlReader.Load static method.  You can find XamReader.Load in Windows.UI.Xaml.Markup in windows 8.1, Windows 8.1/Windows Phone unified
    projects.  For old windows phone ad just Silverlight I believe it is in System.Windows.Markup.
    Hope this helps.

  • OneToMany Mapping Exception - can anybody help

    SEVERE: >>java.lang.ExceptionInInitializerError: null
    javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupExceptionException Description: predeploy for PersistenceUnit [dmsPU] failed.
    Internal Exception: Exception [TOPLINK-7154] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [mPackagepartses] in entity class [class com.adityas.jpa.masters.part.MPart] has a mappedBy value of [part] which does not exist in its owning entity class [class com.adityas.jpa.masters.packageParts.MPackageparts]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
    oracle.toplink.essentials.exceptions.EntityManagerSetupException: Exception Description: predeploy for PersistenceUnit [dmsPU] failed.
    Internal Exception: Exception [TOPLINK-7154] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [mPackagepartses] in entity class [class com.adityas.jpa.masters.part.MPart] has a mappedBy value of [part] which does not exist in its owning entity class [class com.adityas.jpa.masters.packageParts.MPackageparts]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
    Local Exception Stack:
    Exception [TOPLINK-7154] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [mPackagepartses] in entity class [class com.adityas.jpa.masters.part.MPart] has a mappedBy value of [part] which does not exist in its owning entity class [class com.adityas.jpa.masters.packageParts.MPackageparts]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
         at oracle.toplink.essentials.exceptions.ValidationException.noMappedByAttributeFound(ValidationException.java:1118)
         at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidator.throwNoMappedByAttributeFound(MetadataValidator.java:297)
         at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.RelationshipAccessor.getOwningMapping(RelationshipAccessor.java:127)

    @Entity
    @Table(name = "m_part", catalog = "dms_dev")
    public class MPart implements java.io.Serializable {
         // Fields
         private static final long serialVersionUID = -7784550511312653300L;
         private Integer partPk;
         private MWarehouse warehouse;
         private String partNo;
         private String venderPartNo;
         private String partName;
         private Integer group2;
         private Integer issueUom;
         private Integer purchaseUom;
         private String warrantyAppl;
         private String returnable;
         private String salvageValue;
         private Double mrp;
         private Double ndp;
         private Double venderPrice;
         private String partLocation;
         private Double stockInHand;
         private Double minQty;
         private Double openQty;
         private String decsription;
         private Integer crtBy;
         private Date crtDt;
         private Integer updBy;
         private Date updDt;
         private Integer partGroup;
         private Set<TReqApprDtl> reqApprDtls = new HashSet<TReqApprDtl>(0);
         private Set<TPcrInfo> pcrInfos = new HashSet<TPcrInfo>(0);
         private Set<TPoReceive> poReceives = new HashSet<TPoReceive>(0);
         private Set<MPackageparts> packagepartses = new HashSet<MPackageparts>(0);
         private Set<TPoReturn> poReturns = new HashSet<TPoReturn>(0);
         private Set<TAncillaryDtls> ancillaryDtlses = new HashSet<TAncillaryDtls>(0);
         private Set<TPoDetails> poDetailses = new HashSet<TPoDetails>(0);
         // Constructors
         /** default constructor */
         public MPart() {
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "part")
         public Set<MPackageparts> getMPackagepartses() {
              return this.packagepartses;
         public void setMPackagepartses(Set<MPackageparts> packagepartses) {
              this.packagepartses = packagepartses;
    @Entity
    @Table(name = "m_packageparts", catalog = "dms_dev")
    public class MPackageparts implements java.io.Serializable {
         // Fields
         private static final long serialVersionUID = -3528271808797143260L;
         private Integer packagePartPk;
         private MPart part;
         private MComplaint complaint;
         private Double reqQuantity;
         private Integer crtBy;
         private Date crtDt;
         private Integer updBy;
         private Date updDt;
         // Constructors
         /** default constructor */
         public MPackageparts() {
    @ManyToOne(fetch = FetchType.EAGER)
         @JoinColumn(name = "PART_PK", nullable = false)
         public MPart getMPart() {
              return this.part;
         public void setMPart(MPart part) {
              this.part = part;
    Yes it is mentioned as ManyToOne mapping.

  • @oneToMany issues

    CREATE TABLE `stats` (
    `stats_id` bigint(20) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
    CREATE TABLE 'custom_fields'(
    `stats_id` bigint(20) unsigned NOT NULL,
    CONSTRAINT `FK_stats_id` FOREIGN KEY (`stats_id`) REFERENCES `stats` (`stats_id`)
    @Entity
    @Table(name = "stats")
    public class Stats implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "stats_id")
    private Long statsId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "stats")
    private Collection<CustomFields> customFieldsCollection;
    @Entity
    @Table(name = "custom_fields")
    public class CustomFields implements Serializable {
    @JoinColumn(name = "stats_id", referencedColumnName = "stats_id")
    @ManyToOne(optional = false)
    private Stats stats;
    Exception Description: The attribute [customFields] in entity class [class com.soleo.flexiq.statsmanager.persistence.entity.Stats] has a mappedBy value of [statsId] which does not exist in its owning entity class [class com.soleo.flexiq.statsmanager.persistence.entity.CustomFields]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:809)
    Have spent several days on it.. Any help would be appreciated!

    wlin wrote:
    If I change "private Long statsId" to "private Long stats_id", also change get and set methods, it works. But it is not the right way to do it.I'd agree with you there, this smells like a bug in EclipseLink (or at least the version provided by Glassfish). If you want to make the effort, I'd check here if a bug report that matches your description already exists, and if not file a new one:
    https://bugs.eclipse.org/bugs/

  • Problem whith JDeveloper 11g to startup EJB Client

    When i Run the EJBBean display this error message:
    1/02/2008 10:03:54 AM oracle.j2ee.xml.XMLMessages warningException
    ADVERTENCIA: Exception Encountered
    1/02/2008 10:03:55 AM oracle.oc4j.util.SystemLog log
    GRAVE: Server start failed processing configuration
    java.security.AccessControlException: access denied ( CredentialAccessPermission credstoressp.credstore.default.systemuser read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    at java.security.AccessController.checkPermission(AccessController.java:427)
    at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$3.checkPermission(JpsAuth.java:256)
    at oracle.security.jps.util.JpsAuth$Diagnostic.checkPermission(JpsAuth.java:180)
    at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$6.checkPermission(JpsAuth.java:280)
    at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:315)
    at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:338)
    at oracle.security.jps.internal.credstore.util.CsfUtil.checkPermission(CsfUtil.java:527)
    at oracle.security.jps.internal.credstore.ssp.SspCredentialStore.getCredential(SspCredentialStore.java:412)
    at oracle.security.jps.fmw.util.JpsFmwUtil.findSystemUser(JpsFmwUtil.java:218)
    at oracle.security.jps.fmw.JpsUserManager.init(JpsUserManager.java:235)
    at oracle.security.jps.fmw.JpsUserManager.<init>(JpsUserManager.java:247)
    at oracle.security.jps.fmw.JpsUserManagerFactory$JpsUserManagerFactoryI.create(JpsUserManagerFactory.java:252)
    at com.evermind.server.deployment.UserManagerConfig$JAZN.construct(UserManagerConfig.java:635)
    at com.evermind.server.deployment.UserManagerConfig.delegatee(UserManagerConfig.java:253)
    at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    at com.evermind.server.XMLApplicationServerConfig.setPassword(XMLApplicationServerConfig.java:3157)
    at com.evermind.server.XMLApplicationServerConfig.<init>(XMLApplicationServerConfig.java:244)
    at com.evermind.server.ApplicationServer.createConfig(ApplicationServer.java:648)
    at oracle.oc4j.server.ServerFactory$Worker.prepareConfig(ApplicationServerFactory.java:201)
    at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:220)
    at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:235)
    at java.lang.Thread.run(Thread.java:595)
    1/02/2008 10:03:55 AM oracle.oc4j.util.SystemLog logNoStack
    GRAVE: Server exiting: ApplicationServer entered state FAILED_IN_CONFIG
    Process exited with exit code 1.
    when i Run the EJBClient:
    "C:\Archivos de programa\JDeveloper 11g\jdk\bin\javaw.exe" -client -classpath "C:\HR_EJB_JPA_App\.adf;C:\HR_EJB_JPA_App\EJBModel\classes;C:\Archivos de programa\JDeveloper 11g\lib\java\shared\oracle.toplink\11.1.1.0.0\toplink-core.jar;C:\Archivos de programa\JDeveloper 11g\lib\java\shared\oracle.toplink.ojdbc\11.1.1.0.0\toplink-ojdbc.jar;C:\Archivos de programa\JDeveloper 11g\lib\java\internal\toplink-oc4j.jar;C:\Archivos de programa\JDeveloper 11g\lib\java\internal\toplink-agent.jar;C:\Archivos de programa\JDeveloper 11g\lib\java\shared\oracle.toplink\11.1.1.0.0\antlr.jar;C:\Archivos de programa\JDeveloper 11g\j2ee\home\lib\persistence.jar;C:\Archivos de programa\JDeveloper 11g\lib\xmlparserv2.jar;C:\Archivos de programa\JDeveloper 11g\lib\xml.jar;C:\Archivos de programa\JDeveloper 11g\j2ee\home\lib\ejb.jar;C:\Documents and Settings\damacelo\Datos de programa\JDeveloper\system11.1.1.0.22.47.96\o.j2ee\embedded-oc4j\.client;C:\Archivos de programa\JDeveloper 11g\j2ee\home\oc4j.jar;C:\Archivos de programa\JDeveloper 11g\j2ee\home\oc4jclient.jar;C:\Archivos de programa\JDeveloper 11g\j2ee\home\lib\oc4j-internal.jar;C:\Archivos de programa\JDeveloper 11g\opmn\lib\optic.jar" -Dhttp.proxyHost=10.2.0.1 -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=10.2.2.117|127.0.0.1|*.10.2.*|*.dinamotos.com|www.etesa.com|*.intranet|*.dinamo|*.etesa -Dhttps.proxyHost=10.2.0.1 -Dhttps.proxyPort=3128 -Dhttps.nonProxyHosts=10.2.2.117|127.0.0.1|*.10.2.*|*.dinamotos.com|www.etesa.com|*.intranet|*.dinamo|*.etesa oracle.SessionEJBClient
    javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
    at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:313)
    at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:64)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at oracle.SessionEJBClient.main(SessionEJBClient.java:13)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:208)
    at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:756)
    at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:60)
    at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:95)
    at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:70)
    at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:720)
    at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:252)
    at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:235)
    at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:302)
    ... 3 more
    Process exited with exit code 0.
    Anybody can help Me???
    Thanks.

    I JCRuiz
    the error now is:
    [TopLink/JPA Client] Adding Java options: -javaagent:C:\JDeveloper11g\lib\java\internal\toplink-agent.jar
    C:\JDeveloper11g\jdk\bin\javaw.exe -client -classpath "C:\MiPrimeraAplicacion\.adf;C:\MiPrimeraAplicacion\ModeloEJB\classes;C:\JDeveloper11g\lib\java\shared\oracle.toplink\11.1.1.0.0\toplink-core.jar;C:\JDeveloper11g\lib\java\shared\oracle.toplink.ojdbc\11.1.1.0.0\toplink-ojdbc.jar;C:\JDeveloper11g\lib\java\internal\toplink-oc4j.jar;C:\JDeveloper11g\lib\java\internal\toplink-agent.jar;C:\JDeveloper11g\lib\java\shared\oracle.toplink\11.1.1.0.0\antlr.jar;C:\JDeveloper11g\j2ee\home\lib\persistence.jar;C:\JDeveloper11g\lib\xmlparserv2.jar;C:\JDeveloper11g\lib\xml.jar;C:\JDeveloper11g\j2ee\home\lib\ejb.jar;C:\Documents and Settings\damacelo\Datos de programa\JDeveloper\system11.1.1.0.22.47.96\o.j2ee\embedded-oc4j\.client;C:\JDeveloper11g\j2ee\home\oc4j.jar;C:\JDeveloper11g\j2ee\home\oc4jclient.jar;C:\JDeveloper11g\j2ee\home\lib\oc4j-internal.jar;C:\JDeveloper11g\opmn\lib\optic.jar;C:\JDeveloper11g\jlib\trinidad-api.jar;C:\JDeveloper11g\jlib\trinidad-impl.jar;C:\JDeveloper11g\lib\java\shared\oracle.jsf\1.2\jsf-api.jar;C:\JDeveloper11g\lib\java\shared\oracle.jsf\1.2\jsf-ri.jar;C:\JDeveloper11g\lib\java\shared\oracle.jsf\1.2\sun-commons-beanutils.jar;C:\JDeveloper11g\lib\java\shared\oracle.jsf\1.2\sun-commons-collections.jar;C:\JDeveloper11g\lib\java\shared\oracle.jsf\1.2\sun-commons-digester.jar;C:\JDeveloper11g\lib\java\shared\oracle.jsf\1.2\sun-commons-logging.jar;C:\JDeveloper11g\lib\java\shared\oracle.jstl\1.2\jstl-api-1_2.jar;C:\JDeveloper11g\jlib\adf-richclient-api-11.jar;C:\JDeveloper11g\jlib\adf-richclient-impl-11.jar;C:\JDeveloper11g\BC4J\lib\adf-share-support.jar;C:\JDeveloper11g\BC4J\lib\adf-share-ca.jar;C:\JDeveloper11g\BC4J\lib\adf-share-base.jar;C:\JDeveloper11g\jlib\identitystore.jar;C:\JDeveloper11g\lib\java\api\jaxb-api.jar;C:\JDeveloper11g\lib\java\api\jsr173_api.jar;C:\JDeveloper11g\j2ee\home\lib\activation.jar;C:\JDeveloper11g\lib\java\shared\sun.jaxb\2.0\jaxb-xjc.jar;C:\JDeveloper11g\lib\java\shared\sun.jaxb\2.0\jaxb-impl.jar;C:\JDeveloper11g\lib\java\shared\sun.jaxb\2.0\jaxb1-impl.jar;C:\JDeveloper11g\webcenter\jlib\relationship-service-taglib.jar;C:\JDeveloper11g\adfp\lib\pageeditor.jar;C:\JDeveloper11g\adfp\lib\pageeditor-ext-taskflow.jar;C:\JDeveloper11g\adfp\lib\pageeditor-ext-portlet.jar;C:\JDeveloper11g\adfdt\lib\adf-transactions-dt.jar;C:\JDeveloper11g\adfdt\lib\adf-dt-at-rt.jar;C:\JDeveloper11g\adfc\lib\adf-pageflow-dtrt.jar;C:\JDeveloper11g\adfdt\lib\adf-faces-databinding-dt-core.jar;C:\JDeveloper11g\adfdt\lib\adf-view-databinding-dt-core.jar;C:\JDeveloper11g\jdev\lib\velocity-dep-1.3.jar;C:\JDeveloper11g\jlib\adf-faces-databinding-rt.jar;C:\JDeveloper11g\BC4J\lib\adfm.jar;C:\JDeveloper11g\BC4J\jlib\adfui.jar;C:\JDeveloper11g\BC4J\lib\groovy-all-1.0.jar;C:\JDeveloper11g\jlib\ojmisc.jar;C:\JDeveloper11g\jlib\commons-el.jar;C:\JDeveloper11g\jlib\jsp-el-api.jar;C:\JDeveloper11g\jlib\oracle-el.jar;C:\JDeveloper11g\BC4J\lib\adfshare.jar;C:\JDeveloper11g\adfdt\lib\adfdt_common.jar;C:\JDeveloper11g\BC4J\lib\db-ca.jar;C:\JDeveloper11g\jlib\jdev-cm.jar;C:\JDeveloper11g\j2ee\home\lib\ojsp.jar;C:\JDeveloper11g\j2ee\home\lib\servlet.jar;C:\JDeveloper11g\j2ee\home\lib\el-ri.jar;C:\JDeveloper11g\jdev\lib\ojc.jar;C:\JDeveloper11g\mds\lib\mdsrt.jar;C:\JDeveloper11g\adfrc\lib\rcsrt.jar;C:\JDeveloper11g\adfrc\lib\jr_dav.jar;C:\JDeveloper11g\adfrc\lib\rcv.jar;C:\JDeveloper11g\adfp\lib\custComps.jar;C:\JDeveloper11g\adfp\lib\portlet-client-adf.jar;C:\JDeveloper11g\adfp\lib\portlet-client-rc.jar;C:\JDeveloper11g\adfp\lib\adfp-portletdt-share.jar;C:\JDeveloper11g\adfp\lib\portlet-client-core.jar;C:\JDeveloper11g\adfp\lib\portlet-client-mds.jar;C:\JDeveloper11g\adfp\lib\portlet-client-web.jar;C:\JDeveloper11g\adfp\lib\portlet-client-wsrp.jar;C:\JDeveloper11g\adfp\lib\tidy.jar;C:\JDeveloper11g\adfp\lib\wce.jar;C:\JDeveloper11g\adfp\lib\wsrp-types.jar;C:\JDeveloper11g\adfp\lib\wsrp-jaxb.jar;C:\JDeveloper11g\adfp\lib\namespace.jar;C:\JDeveloper11g\jlib\adf-faces-changemanager-rt.jar;C:\JDeveloper11g\jlib\facesconfigmodel.jar;C:\JDeveloper11g\jlib\taglib.jar;C:\JDeveloper11g\jlib\jdev-el.jar;C:\JDeveloper11g\jlib\xmlef.jar;C:\JDeveloper11g\jdbc\lib\ojdbc5dms.jar;C:\JDeveloper11g\jlib\commons-cli-1.0.jar;C:\JDeveloper11g\jlib\share.jar;C:\JDeveloper11g\jlib\dms.jar;C:\JDeveloper11g\j2ee\home\lib\oc4j-unsupported-api.jar;C:\JDeveloper11g\rdbms\jlib\xdb.jar;C:\JDeveloper11g\lib\java\api\cache.jar;C:\JDeveloper11g\jlib\ojdl.jar;C:\JDeveloper11g\j2ee\home\lib\pcl.jar;C:\JDeveloper11g\ucp\lib\ucp.jar;C:\JDeveloper11g\lib\java\shared\oracle.javatools\11.1.1.0.0\dafrt.jar;C:\JDeveloper11g\lib\java\shared\oracle.javatools\11.1.1.0.0\javatools-nodeps.jar;C:\JDeveloper11g\adfp\lib\custComps-skin.jar;C:\JDeveloper11g\j2ee\home\lib\jms.jar;C:\JDeveloper11g\rdbms\jlib\aqapi.jar;C:\JDeveloper11g\j2ee\home\lib\jta.jar;C:\JDeveloper11g\webcenter\jlib\tagging-taglib.jar;C:\JDeveloper11g\BC4J\lib\adfmweb.jar;C:\JDeveloper11g\jakarta-taglibs\commons-beanutils-1.6.1\commons-beanutils.jar;C:\JDeveloper11g\jakarta-taglibs\commons-logging-1.0.3\commons-logging.jar;C:\JDeveloper11g\jakarta-taglibs\commons-collections-2.1\commons-collections.jar;C:\JDeveloper11g\jakarta-struts\lib\antlr.jar;C:\JDeveloper11g\jakarta-struts\lib\commons-beanutils.jar;C:\JDeveloper11g\jakarta-struts\lib\commons-collections.jar;C:\JDeveloper11g\jakarta-struts\lib\commons-digester.jar;C:\JDeveloper11g\jakarta-struts\lib\commons-fileupload.jar;C:\JDeveloper11g\jakarta-struts\lib\commons-logging.jar;C:\JDeveloper11g\jakarta-struts\lib\commons-validator.jar;C:\JDeveloper11g\jakarta-struts\lib\jakarta-oro.jar;C:\JDeveloper11g\jakarta-struts\lib\struts.jar;C:\JDeveloper11g\webcenter\jlib\command-api.jar;C:\JDeveloper11g\webcenter\jlib\command-spi.jar;C:\JDeveloper11g\webcenter\jlib\generalsettings-model.jar;C:\JDeveloper11g\webcenter\jlib\lifecycle-asctl.jar;C:\JDeveloper11g\webcenter\jlib\lifecycle-client.jar;C:\JDeveloper11g\webcenter\jlib\lifecycle-model.jar;C:\JDeveloper11g\webcenter\jlib\lifecycle-service.jar;C:\JDeveloper11g\webcenter\jlib\lock-service-model.jar;C:\JDeveloper11g\webcenter\jlib\search-api.jar;C:\JDeveloper11g\webcenter\jlib\search-adapter.jar;C:\JDeveloper11g\webcenter\jlib\search-model.jar;C:\JDeveloper11g\webcenter\jlib\search_client.jar;C:\JDeveloper11g\webcenter\jlib\scope-service-model.jar;C:\JDeveloper11g\webcenter\jlib\security-extension.jar;C:\JDeveloper11g\webcenter\jlib\serviceframework.jar;C:\JDeveloper11g\webcenter\jlib\wc-concurrent.jar;C:\JDeveloper11g\BC4J\lib\adfsharembean.jar;C:\JDeveloper11g\j2ee\home\lib\xmlparserv2.jar;C:\JDeveloper11g\webservices\lib\saaj-api.jar;C:\JDeveloper11g\webservices\lib\orasaaj.jar;C:\JDeveloper11g\j2ee\home\lib\http_client.jar;C:\JDeveloper11g\webcenter\jlib\service-framework-taglib.jar;C:\JDeveloper11g\webcenter\jlib\serviceframework-view.jar;C:\JDeveloper11g\webcenter\jlib\rtc-api.jar;C:\JDeveloper11g\webcenter\jlib\rtc-model.jar;C:\JDeveloper11g\webcenter\jlib\rtc-skin.jar;C:\JDeveloper11g\webcenter\jlib\rtc-adapters-lcs.jar;C:\JDeveloper11g\webcenter\jlib\rtc-lcs-wsclient.jar;C:\JDeveloper11g\webcenter\jlib\log4j-1.2.8.jar;C:\JDeveloper11g\webcenter\jlib\rtc-taglib.jar;C:\JDeveloper11g\webcenter\jlib\rtc-view.jar;C:\JDeveloper11g\webcenter\jlib\rtc-adapters-ocms.jar;C:\JDeveloper11g\webcenter\jlib\buddylistmanager-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\buddylistmanagerimpl-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\presencerules-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\parlayxcommon-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\parlayxwsstubs-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\resourcelist-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\xdmc-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\xdmcimpl-4.2.0-393.jar;C:\JDeveloper11g\webcenter\jlib\commons-httpclient.jar;C:\JDeveloper11g\webcenter\jlib\commons-codec-1.3.jar;C:\JDeveloper11g\webcenter\jlib\collab-share.jar;C:\JDeveloper11g\adfdi\lib\adf-desktop-integration.jar;C:\JDeveloper11g\webservices\lib\wsclient.jar" -javaagent:C:\JDeveloper11g\lib\java\internal\toplink-agent.jar -Dhttp.proxyHost=10.2.0.1 -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=10.2.2.117|127.0.0.1|*.10.2.*|*.dinamotos.com|www.etesa.com|*.intranet|*.dinamo|*.etesa -Dhttps.proxyHost=10.2.0.1 -Dhttps.proxyPort=3128 -Dhttps.nonProxyHosts=10.2.2.117|127.0.0.1|*.10.2.*|*.dinamotos.com|www.etesa.com|*.intranet|*.dinamo|*.etesa oracle.HRFacadeClient
    java.lang.reflect.InvocationTargetException
         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:585)
         at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:141)
    Caused by: java.lang.reflect.InvocationTargetException
         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:585)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:34)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:27)
         ... 5 more
    Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071207)): oracle.toplink.exceptions.EntityManagerSetupException
    Exception Description: Predeployment of PersistenceUnit [ModeloEJB] failed.
    Internal Exception: Exception [TOPLINK-30007] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071207)): oracle.toplink.exceptions.PersistenceUnitLoadingException
    Exception Description: An exception was thrown while loading class: modeloejb.Departments to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
    Internal Exception: java.lang.ClassNotFoundException: modeloejb.Departments
         at oracle.toplink.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:790)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:119)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:187)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:202)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializer.initializeFromAgent(JavaSECMPInitializer.java:219)
         ... 11 more
    Caused by: Exception [TOPLINK-28018] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071207)): oracle.toplink.exceptions.EntityManagerSetupException
    Exception Description: Predeployment of PersistenceUnit [ModeloEJB] failed.
    Internal Exception: Exception [TOPLINK-30007] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071207)): oracle.toplink.exceptions.PersistenceUnitLoadingException
    Exception Description: An exception was thrown while loading class: modeloejb.Departments to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
    Internal Exception: java.lang.ClassNotFoundException: modeloejb.Departments
         at oracle.toplink.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:196)
         ... 16 more
    Caused by: Exception [TOPLINK-30007] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071207)): oracle.toplink.exceptions.PersistenceUnitLoadingException
    Exception Description: An exception was thrown while loading class: modeloejb.Departments to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
    Internal Exception: java.lang.ClassNotFoundException: modeloejb.Departments
         at oracle.toplink.exceptions.PersistenceUnitLoadingException.exceptionLoadingClassWhileLookingForAnnotations(PersistenceUnitLoadingException.java:126)
         at oracle.toplink.internal.ejb.cmp3.persistence.PersistenceUnitProcessor.loadClass(PersistenceUnitProcessor.java:231)
         at oracle.toplink.internal.ejb.cmp3.metadata.MetadataProcessor.processPersistenceUnitClasses(MetadataProcessor.java:423)
         at oracle.toplink.internal.ejb.cmp3.metadata.MetadataProcessor.processPersistenceUnitClasses(MetadataProcessor.java:376)
         at oracle.toplink.internal.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:258)
         at oracle.toplink.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:747)
         ... 15 more
    FATAL ERROR in native method: processing of -javaagent failed
    Caused by: java.lang.ClassNotFoundException: modeloejb.Departments
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at oracle.toplink.internal.ejb.cmp3.JavaSECMPInitializer$TempEntityLoader.loadClass(JavaSECMPInitializer.java:355)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at oracle.toplink.internal.ejb.cmp3.persistence.PersistenceUnitProcessor.loadClass(PersistenceUnitProcessor.java:228)
         ... 19 more
    Exception in thread "main" Process exited with exit code 1.

Maybe you are looking for

  • CL_GUI_ALV_GRID check date and POP-up appears (that is not required)

    Hi all, we use class CL_GUI_ALV_GRID in a report. The list contains a date field. If i put into this field a wrong format (example dddd instead of DD.MM.YYYY) i'll get a pop-up as an error message. But i would like that this error message will displa

  • Migrating Oracle 11g from 32b to 64b

    I figured I could use rman to do a full backup, including the archive files, control file, and SPFILE, and datafiles of the 32 bit version, and restore to a 64 bit OS. But will that work? Are there docs on how to restore 32b backups to a 64b environm

  • Auto Trace no aparece

    ¿En donde esta la herramienta auto trace?. No me aparece en ninguna de las barras de herramientas.

  • Keyboard not recognized when waking up from suspend

    Hello people, I have a HP Pavilion 11-n030ar x360 laptop (http://support.hp.com/us-en/document/c04439109). Every time the laptop wakes up from suspend, the keyboard isn't responsive anymore (even after waiting more than 10 minutes) so when I am using

  • Content-pushing

    Hi All, I want to know the concept of Content Pushing which is pushing the information from the web server to the web clients. Normally, the web applications are executed by a content pulling method, by which the clients will pull the information fro