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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Using custom classes that are not beans

    Hi folks,
    Is it possible to use java classes that are not beans. I mean, on a page, could you say Customer cust = new Customer("Jones", 25);
    if you had a Customer class with a constructor that took a name and age (String and int).
    If so, how do you go about this- do you need to import the class, or put it in a standard location? I'm using Tomcat, and would guess that this would go in WEB-INF/classes?
    I hope it's not a stupid question, all the literature seems to be focused on JavaBeans
    Any advice on this would be great!

    Beans are used as putting Java code into a JSP is generally considered bad practice. The advantage of the bean pattern is that you use things like:
    <jsp:setProperty name="laBean" property="someSetter" value="someValue" />so that you aren't embedding Java directly into the JSP. I'm not very religious about this particular topic personally and will throw a line or two in here and there.
    Having said that though, you can easily use any Java class in a JSP. You'll have to import it first:
    <%@ page import="java.util.*" %>And then you can easily use it like in a real Java program.

  • Why lables are not possible in smartforms.

    In script Lables are possible but in smartforms lables are not possible .
    why lables are not possible in smartforms?

    HI,
    Refer to the wiki in the link.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/label%2bprinting%2bin%2bsmartforms
    Regards
    Sumit Agarwal

  • Document is being distributed - changes are not possible

    Dear Guru's
    I have an issue when making a quotation transaction. After i saved the quotation transaction, i would like to change the window into edit mode.
    So i have to click the display or change button and then after i click that button, there is an message text   "<b>Document is being distributed - changes are not possible</b>" but after i wait for some minute, system still can not be change. and still appearing a message text "Document is being distributed - changes are not possible"
    Please could u give some information about this issue?

    The order in the CRM system remains in status 'to be distributed'
    because it waits for an answer of the OLTP system that the order has
    been successfully saved.
    The reason could be due to the following:
    1. Check in your system the delta download is active ?  Did you perform
       an initial download of SALESDOCUMENTS ?
       If you check in transaction R3AC4 there must be an entry for
       SALESDOCUMENT to enable a successfull delta download.
       Without a successful initial download of this object, no delta
       download will be performed.  Please refer to the SETUP AND
       DOWNLOAD guide you will find in the service market place
       http://service.sap.com
    2. Check if there are any ABAP Dumps related in OLTP ?  If yes, status
       will always be in distributed as CRM is still waiting for a reply
       from OLTP.
    3. Check your inbound/outbound queues are working.
    The note 490932 will help you to check your dataexchange
    customizing.
    Please, reward points if it helps you.
    Regards, José Ignacio

  • Lightroom 5.6 Win8 64 import of some photos are not possible

    Lightroom 5.6 Win8 64 import of some photos are not possible: the photos are grey, the file name of the photos are already excisting in the catalog, older different photos, don’t Import Suspected Duplicates is not selected. There is no difference selected or not, the photos (Import are not possible) are always grey with the notice: These photos would be already imported! All other photos could be imported and gets grey.

    my-wedding-foto.de wrote:
    Lightroom 5.6 Win8 64 import of some photos are not possible: the photos are grey, the file name of the photos are already excisting in the catalog, older different photos, don’t Import Suspected Duplicates is not selected. There is no difference selected or not, the photos (Import are not possible) are always grey with the notice: These photos would be already imported! All other photos could be imported and gets grey.
    When Lightroom greys out a photo in the Import dialog box, it means the photo is already in the catalog. It doesn't mean that it is matched with an older photo with the same name ... in order for there to be a match, the file name and capture date and file size must be identical.
    So Lightroom thinks you have already imported the photos, and you think the photos have not been imported. Now I'm sure you are a very nice person, but I believe Lightroom. What you need to do is to find the photos in your Library Module and use them there. The photos can be found by searching for them by file name, after turning off all filters, and after clicking on All PHotographs in the Library Module.

  • Popup saying RTC functions are not possible

    Hi,
    i have portal ep6 sp10. After my server restart, i log on with an user id, and logoff. and When i login agian..the popup comes up and says that the user is logged on some where else, thus the Real time collaboraion functions are not possible. But i have successfully logged off previously.
    Any one ran into this kind of scenario. Can you point me in right direction..I was guessing that previous logoff didn't kill the session. Where can i track the session of an user. Any suggestions are appreciated..
    thanks
    Chiru.

    Chiru -
    You can check whether your user has a session open in the Visual Admin console.  Navigate to Server -> Services -> Security Provider -> Login Sessions.
    If needed, you can terminate sessions by clicking on the pencil to change to write mode and them selecting the session and clicking on the Terminate Session button.
    Enjoy!
    Kyle

  • Some futures in bpel which are not possible with ESB and vice versa

    Can anyone please tell me some futures in bpel which are not possible with ESB and For some features available in ESB that are absence in BPEL?

    I think you've mistaken the meaning of both technologies. ESB actually works as a part of BPEL, for instance you can create partner link from any esb service.
    ESB service can only expose data or retrieve and process (transform) them from another service. BPEL is using services like ESB as a source and adds decision making functionality which is not present in ESB.

  • Calendar invites are not possible

    I am frustrated. Working with 10.8.5.Invites via ical are not possible. Is there anywhere a good and helpful manual which shows the different steps.
    Once I enter the first letters of an mail address, than choosing the one from the pull down list it is always marked with a "?" question mark. Then I push the button "sent" or "refreh" button, but the person which should receive the invitation does not receives it, nor can I check whether the mail actually was sent.
    Would be really interested in how to solve this problem
    Kind regards
    Gerhard

    Sorry for the late reply, it is still an irritating issue.  Apple says it's Google's poblem.  Google thinks it's Apple's issue.  Extremly irritating.
    I tried setting up the Calendar using the Exchange presets but that did not solve the invitation problem.

  • Class descriptions are not shown with SDK 3.5

    Hi everybody,
    I'm using a stand-alone version of Flash Builder 4 on Snow Leopard.
    When I use the 4th Flex SDK, the documentation for the classes from the SDK (e.g., mx.controllers.Button) is shown in the tooltip (or the ASDoc-View). When using Flex SDK 3.5 though, it just says "mx.controls.Button". Only the docs for my own classes are displayed.
    My friend has this working on Windows 7 with both SDKs.
    Is there anything I can do about it?.. (please don't tell me to switch to windows )
    Thanks!

    Really with both SDKs? I filed a similiar forum post some months ago and was told that its "not possible" for FB to show the ASDOC since its somehow not built into the SDK or something..
    http://forums.adobe.com/thread/573849?tstart=0
    I would love to have FB display ASdoc for any SDK (and I do have Win7 ) - so if you could let me know how your friend solved that one, that would be awesdome..

  • CLASS Files are not recompiled

    We use CLASS Files that are used from a JSP.
    After changing anything in the CLASS-Files and copying them to the custom_classes dir, nothing changes. It seems that the class Files are loaded from a cache.
    The only possibility we found is, to stop the JWS and start it again.
    Is there another possibility. (Not so time-wasting).
    It would be nice if any postings could be send to [email protected]

    This is result of the way in which Java works. Once a class has been loaded by the JVM the class remains in memory until such time as the JVM stops. There is nothing we can do to change this behavoir.

  • Parent class loaders are not searched for native libraries?

    I'm loading a native library in the default system classloader. I think create several new children of the default class loader and instantiate some new objects in those child classloaders. The problem is that those new objects get a LinkUnsatisfiedError when they try to call the native methods.
    I was under the impression that ClassLoaders would delegate native method class to their parent class loader, the same way that they do when searching for class definition. This is confirmed by this quote from http://java.sun.com/docs/books/jni/html/design.html:
    "Because each class loader maintains a set of native libraries, the programmer may use a single library to store all the native methods needed by any number of classes as long as those classes have the same defining loader."
    I'm in a serious catch-22 here, because I cannot load the native library in the child classloaders (native libs are not allowed to be loaded by multiple class loaders), and I need to put the objects in a separate classloader. What is the solution?

    i.getClass().getResourceAsStream("/hello.txt"); //this should be disallowedWhy is getting a resource so bad? It puts a dependency on a module, but in a plugin system, dependencies should be supported. Netbeans platform supports this same thing. I use image resources from some core modules at my own risk. If you really want to block it, override the getResource method of URLClassLoader to block unwanted resource fetching. You will have to use the SecurityManager, AccessController, ProtectionDomain, and AccessControlContext and I'm not going to tell you how ;)
    i.getClass().newInstance(); //something even worseNot possible to block without package private constructors or similar restrictions as above.

  • EJB deployment problem --New remote interface class files are not loaded

    Hi, I face a problem while deploying an ear file in oc4j. I basically get some problems like the method in the remote interface is not implemented in the EJB class. But the implementation is actually available in the EJB class.
    We get this problem when we actually change the signature of the EJB remote methods. The new methods are not referenced by oc4j. Only the old version of remote interface is referenced by oc4j. But the latest version of EJB class is taken. I am using 9.0.3 version of the oc4j. Could you pls help me regarding this problem ?
    Regards
    Solomon

    I have found the solution :-)
    You must add to the ejbCreate() method of the bean class throws javax.ejb.CreateException

  • I'm getting classes that are not from JDBC Driver

    Hello
    I configured a data source connection against RAC using the oracle.jdbc.pool.OracleDataSource. When I get the connection and check what classes I'm getting I get the following:
    java.sql.Connection: com.evermind.sql.DriverManagerConnectionPoolConnection
    java.sql.PreparedStatement: com.evermind.sql.FilterPreparedStatement
    where I should be getting OraclePoolConnection and OraclePreparedStatement.
    Data Source:
    <data-source class="oracle.jdbc.pool.OracleDataSource" name="Test" locat
    ion="jdbc/Test" pooled-location="jdbc/pool/Test" username="seniat" password="seniat" url="jdbc:oracle:thin:@(DESCRIPTION = (LOAD_BALANCE = ON)(FAILOVER = ON)(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = server2)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = service)(failover_mode=(type=select)(method=basic)" max-co
    nnections="100" min-connections="10" inactivity-timeout="30"/>

    Launch System Preferences and select the Mail, Contacts, and Calendars tab. Now select each account that's listed and see which ones have a checkmark by notes.
    Your strange notes must be coming from one of these accounts. If you have only one account with Notes checkmark it must be that one. Change the password to that account. If you have more than one account with Notes you'll have to experiment to determine which one the notes are coming from or, of course, you could change the password for all the involved accounts.
    I can't think of any other way you would be getting notes into the notepad. (Unless someone is playing a prank and actually writing them while your computer is unattended)

  • Custom object class attributes are not provisioning in oID thru OIM

    Hi,
    I have connected OIM with oID user provisioning is also taking place. I have made one custom structure class with some attributes in OID.
    In form designer,in OID usr form i have made feild UD_OID_USR_Custom
    In OId .config lookup i have mentioned that custom class as well as attributes of class[in code Custom in decode name of attribute at target]
    In process form recon mapping of OID i mapped this feild name .
    Also in resource object recon mapping also i mentioned this attribute.
    But while creating user till process form value of attribute is populating and not provisiong that attribute in OID.
    Please tell me where i went wrong or exact steps of mapping in form designer,Process definition,Lookup.OID.configuration,Resource objects.
    Thanks

    process form recon mapping of OID i mapped this feild nameHave you made attribute entry in Provisioning Lookup AttrName.Prov.Map.OID ?
    Have you followed each step :
    http://download.oracle.com/docs/cd/E11223_01/doc.904/e10436/extnd_func.htm#CACICHDH

  • FI Substitution exit to Business area not possible in the Standard SAP

    Hi Experts
    I need to derive the business area from the funds centre (local government) in the FI Substitution.  This is allowed in the Co Substitution though but it must come ahead of OKB9.
    We get the following with loading the Bank Statement FF_5.
    Error: (00 298) Formatting error in the field COBL-GSBER ; see next message
    How can I get the Business areas in the allowed fields in the FI Substitution?
    Please help
    Kind regards
    Dawn

    Dear,
    Go to SM30 Enter VWTYGB01click on Maintain
    Postion the folloiwng:
    Boolean Class = 9
    Type = S
    Table = BSEG
    Field = GSBER
    Untick the Column Exclude
    Once done please re execute the OBBH, Business Area will be shown there.
    Br, Vivek

Maybe you are looking for

  • Fixed Custom serial number in SSRS

    hello all, I am here to find solution where i want to fixed a serial number with my particular data row. i my report i want to assign a fixed row number to row which will not be change if number of rows affected by filter . i meant.. SR      Employee

  • The role of main()

    I'm an experienced C++ programmer but have never worked in Java previously. i'm attempting to dive in with netbeans. My first question is, what is the role of main()? That is to say, I used a tutorial that works with netbeans, and you end up with two

  • Roadmap UI element in webdynpro java

    Hi, Can you please tell the steps, for how to use ROAD MAP UI ELEMENT in webdynpro java Regards, Boots

  • XML HTTPService Looping

    Could anyone assist me on how to use the HTTPService to read a xml file with a complex structure similar to this <?xml version="1.0" encoding="utf-8"?> <reports> <report> <reportDate>2006-11-19 <manager> <id>0</id> <name>Elizabeth Jones</name> <platf

  • Pure-ftp and file ownership

    Hello, I am running a oes2 server with pure-ftp. Everything is running fine with pure-ftp when login in with FileZilla or ftp command line, but I als have a ncp volume mapped to the ftp location on the server. When people in my organization put files