EJB 3.0 JPA Entities and preserving user identities

Hello all,
I've been reading about some of the techniques available to Oracle DB developers to ensure that some sense of a user's real identity is maintained in multitier applications (<http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14266/apdvprxy.htm>).
I was wondering if either of the methods described (proxy authentication or the use of the CLIENT_IDENTIFIER attribute) could be used in conjunction with EJB 3.0 JPA Entity beans (in an OC4J container).
If so, I would really appreciate any pointers to useful documentation! I've read something about the use of proxy authentication with TopLink (<http://www.oracle.com/technology/products/ias/toplink/doc/11110/relnotes/toplink-relnotes.html#BABHEFEF>), but I'm not sure how this relates to the use of Entity beans.
Many thanks,
Alistair.

Just to close this thread out...
Under another thread: <JPA Entities with Proxy Authentication / OC4J bug it was determined that this is NOT possible with OC4J 10g, but should be supported by 11g.
Alistair.

Similar Messages

  • Net Install, Creating and Preserving User Names & Prefs

    Hi
    I have 10.3.9 Server and a few 10.3.9 and 10.4.9 clients with iMacs, eMacs, Macbooks etc. I would like to install (not boot) from the server but I cant find much info about it except the Help which doesnt cover my question which is:
    1. How do I create a new unique user name for each machine if they are all installing from the same disk image?
    2. Can I preserve the desired prefs for each machine (they are all mostly the same but not all) How about for all the apps such as Office X, Firefox (incl Bookmarks), Scanning Software, OCR, VNC etc etc and other stuff like VPN which only the laptop users need.
    3. Regarding the 4 Sight Network Fax, Each user needs to log on with its own password - Does Net Install cope with this? If so how without a unique installer for each user?
    4. I realise I can create a served .pkg file that all can access but then I would have to manually set the prefs for each app (wouldn't I?).
    I gues my quesiton boils down to:
    How do I set up some kind of image that will include the OS, the Apps and all their finely crafted prefs but have flexibility when it comes to variations in finder and app prefs across the group to save time.
    (How you ever spent time customising Word and Excel VX menus and finding the changes don't stick!!)
    Hope someone out there has done this before!
    Many thanks
    G4 Tower & Clients Mac OS X (10.4.9) OS 10.3.9 Server
    G4 Tower & Clients Mac OS X (10.4.9) OS 10.3.9 Server

    Thanks Camelot
    From your text I understand that I can put a disk image of OS and Apps on the server as a network install to install new and update existing clients. After that, I create a "home directory" on the server for each client and populate it with the correct prefs for the finder and apps.
    At each startup the user doesnt know it but all their prefs are coming down from the server, as a result they can log in anywhere on the network adn everything is as they left it!
    If thats right, then after new system setup, how do I effect a standard suite of prefs for each client without repeatedly setting up each one? How about clients that have some prefs set slightly differently (like that fax server which needs unique pwd for each client)? Finally, what if I need to distribute a new app pref to each client?
    Many thanks
    G4 Servers, iMacs, eMacs, Powerbooks & MacBook   Mac OS X (10.4.9)   Many other Apple computers on my network.

  • JPA Entities and Spatial

    I have generated Entities from tables using Jdeveloper 11 and Spatial columns of
    type MDSYS.SDO_GEOMETRY were translated to Java String type.
    I am looking for a strategy (custom mappings/annotations, etc) which will apply
    an Oracle spatial function on the field and make the type conversion required
    to insert into the Spatial column type.

    Yes, your field would be like,
    @Convert(value="JGeometry")
    @StructConverter(name="JGeometry", converter="JGEOMETRY")
    protected JGeometry myJGeometry;
    There is an in the EclipseLink SVN repository that you may wish to look at,
    <SVN>foundation/eclipselink.extension.oracle.test/src/org/eclipse/persistence/testing/models/jpa/structconverter
    James : http://www.eclipselink.org

  • JDev generates incomplete Tables from JPA entities

    I've got some JPA entities and I'm trying to generate the DB schema from them in Jdeveloper.
    All tables are only generated with the Id (Primary Key) and not any additional fields/constraints I've defined in the Entity classes.
    Any ideas what I should be looking at?
    JDev 11.1.1.3 connecting to Oracle 10g XE
    Edited by: new_to_webcenter on 21-Jan-2011 03:20

    @Shay,
    In a new JPA app, I've created
    New Business Tier > EJB > Entity
    Choose Persistence Unit and OFfline DB , Choose No Inheritance
    Ticked on "Create Offline Table"
    Include @Id field without a Sequencer
    In the generated Entity class, I've added a new private field Name with setter/getter.
    I've added these via the Structure > EJB > Add new field > generate accessors.
    I've also specified @Column for the private field Name .
    Next in the offline DB source, I right-click the Table > Generate to Connection > and go through the steps , choosing CREATE table.
    In the created table as well as the generated SQL script, the Name column does not appear.
    It creates a table in the DB with only the ID column.
    Edit: I've checked again - if i click on the offline db source > table > columns - even there it only shows ID and no NAME column.
    Any ideas - i'm definitely missing a step?
    In persistence.xml I've specified
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    <property name="eclipselink.ddl-generation.output-mode"
                        value="database" />
    @dvohra16 : Nope I dont need the sequencer at present.
    Edited by: new_to_webcenter on 21-Jan-2011 22:37
    Edited by: new_to_webcenter on 21-Jan-2011 22:58

  • How to create a cache for JPA Entities using an EJB

    Hello everybody! I have recently got started with JPA 2.0 (I use eclipseLink) and EJB 3.1 and have a problem to figure out how to best implement a cache for my JPA Entities using an EJB.
    In the following I try to describe my problem.. I know it is a bit verbose, but hope somebody will help me.. (I highlighted in bold the core of my problem, in case you want to first decide if you can/want help and in the case spend another couple of minutes to understand the domain)
    I have the following JPA Entities:
    @Entity Genre{
    private String name;
    @OneToMany(mappedBy = "genre", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<Novel> novels;
    @Entity
    class Novel{
    @ManyToOne(cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Genre genre;
    private String titleUnique;
    @OneToMany(mappedBy="novel", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> editions;
    @Entity
    class NovelEdition{
    private String publisherNameUnique;
    private String year;
    @ManyToOne(optional=false, cascade={CascadeType.PERSIST, CascadeType.MERGE})
    private Novel novel;
    @ManyToOne(optional=false, cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Catalog appearsInCatalog;
    @Entity
    class Catalog{
    private String name;
    @OneToMany(mappedBy = "appearsInCatalog", cascade = {CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> novelsInCatalog;
    The idea is to have several Novels, belonging each to a specific Genre, for which can exist more than an edition (different publisher, year, etc). For semplicity a NovelEdition can belong to just one Catalog, being such a Catalog represented by such a text file:
    FILE 1:
    Catalog: Name Of Catalog 1
    "Title of Novel 1", "Genre1 name","Publisher1 Name", 2009
    "Title of Novel 2", "Genre1 name","Pulisher2 Name", 2010
    FILE 2:
    Catalog: Name Of Catalog 2
    "Title of Novel 1", "Genre1 name","Publisher2 Name", 2011
    "Title of Novel 2", "Genre1 name","Pulisher1 Name", 2011
    Each entity has associated a Stateless EJB that acts as a DAO, using a Transaction Scoped EntityManager. For example:
    @Stateless
    public class NovelDAO extends AbstractDAO<Novel> {
    @PersistenceContext(unitName = "XXX")
    private EntityManager em;
    protected EntityManager getEntityManager() {
    return em;
    public NovelDAO() {
    super(Novel.class);
    //NovelDAO Specific methods
    I am interested at when the catalog files are parsed and the corresponding entities are built (I usually read a whole batch of Catalogs at a time).
    Being the parsing a String-driven procedure, I don't want to repeat actions like novelDAO.getByName("Title of Novel 1") so I would like to use a centralized cache for mappings of type String-Identifier->Entity object.
    Currently I use +3 Objects+:
    1) The file parser, which does something like:
    final CatalogBuilder catalogBuilder = //JNDI Lookup
    //for each file:
    String catalogName = parseCatalogName(file);
    catalogBuilder.setCatalogName(catalogName);
    //For each novel edition
    String title= parseNovelTitle();
    String genre= parseGenre();
    catalogBuilder.addNovelEdition(title, genre, publisher, year);
    //End foreach
    catalogBuilder.build();
    2) The CatalogBuilder is a Stateful EJB which uses the Cache and gets re-initialized every time a new Catalog file is parsed and gets "removed" after a catalog is persisted.
    @Stateful
    public class CatalogBuilder {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private Cache cache;
    private Catalog catalog;
    @PostConstruct
    public void initialize() {
    catalog = new Catalog();
    catalog.setNovelsInCatalog(new ArrayList<NovelEdition>());
    public void addNovelEdition(String title, String genreStr, String publisher, String year){
    Genre genre = cache.findGenreCreateIfAbsent(genreStr);//##
    Novel novel = cache.findNovelCreateIfAbsent(title, genre);//##
    NovelEdition novEd = new NovelEdition();
    novEd.setNovel(novel);
    //novEd.set publisher year catalog
    catalog.getNovelsInCatalog().add();
    public void setCatalogName(String name) {
    catalog.setName(name);
    @Remove
    public void build(){
    em.merge(catalog);
    3) Finally, the problematic bean: Cache. For CatalogBuilder I used an EXTENDED persistence context (which I need as the Parser executes several succesive transactions) together with a Stateful EJB; but in this case I am not really sure what I need. In fact, the cache:
    Should stay in memory until the parser is finished with its job, but not longer (should not be a singleton) as the parsing is just a very particular activity which happens rarely.
    Should keep all of the entities in context, and should return managed entities form mehtods marked with ##, otherwise the attempt to persist the catalog should fail (duplicated INSERTs)..
    Should use the same persistence context as the CatalogBuilder.
    What I have now is :
    @Stateful
    public class Cache {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private sessionbean.GenreDAO genreDAO;
    //DAOs for other cached entities
    Map<String, Genre> genreName2Object=new TreeMap<String, Genre>();
    @PostConstruct
    public void initialize(){
    for (Genre g: genreDAO.findAll()) {
    genreName2Object.put(g.getName(), em.merge(g));
    public Genre findGenreCreateIfAbsent(String genreName){
    if (genreName2Object.containsKey(genreName){
    return genreName2Object.get(genreName);
    Genre g = new Genre();
    g.setName();
    g.setNovels(new ArrayList<Novel>());
    genreDAO.persist(t);
    genreName2Object.put(t.getIdentifier(), em.merge(t));
    return t;
    But honestly I couldn't find a solution which satisfies these 3 points at the same time. For example, using another stateful bean with an extended persistence context (PC) would work for the 1st parsed file, but I have no idea what should happen from the 2nd file on.. Indeed, for the 1st file the PC will be created and propagated from CatalogBuilder to Cache, which will then use the same PC. But after build() returns, the PC of CatalogBuilder should (I guess) be removed and re-created during the succesive parsing, although the PC of Cache should stay "alive": shouldn't in this case an exception being thrown? Another problem is what to do when the Cache bean is passivated. Currently I get the exception:
    "passivateEJB(), Exception caught ->
    java.io.IOException: java.io.IOException
    at com.sun.ejb.base.io.IOUtils.serializeObject(IOUtils.java:101)
    at com.sun.ejb.containers.util.cache.LruSessionCache.saveStateToStore(LruSessionCache.java:501)"
    Hence, I have no Idea how to implement my cache.. Can you please tell me how would you solve the problem?
    Many thanks!
    Bye

    Hi Chris,
    thanks for your reply!
    I've tried to add the following into persistence.xml (although I've read that eclipseLink uses L2 cache by default..):
    <shared-cache-mode>ALL</shared-cache-mode>
    Then I replaced the Cache bean with a stateless bean which has methods like
    Genre findGenreCreateIfAbsent(String genreName){
    Genre genre = genreDAO.findByName(genreName);
    if (genre!=null){
    return genre;
    genre = //Build new genre object
    genreDAO.persist(genre);
    return genre;
    As far as I undestood, the shared cache should automatically store the genre and avoid querying the DB multiple times for the same genre, but unfortunately this is not the case: if I use a FINE logging level, I see really a lot of SELECT queries, which I didn't see with my "home made" Cache...
    I am really confused.. :(
    Thanks again for helping + bye

  • How to do a Clean Install (Don't preserve users and network settings)

    I'd like to make a clean install of Snow Leopard -- but NOT erasing the whole drive and NOT migrating/preserving my users and network settings.
    I have a bunch of applications and huge data sets (about 40G) on the boot drive that I don't want to go through the trouble of reinstalling or backing up, and that do not install Application Support folders and the like. I'd like to keep them, as well as migrate files like fonts and preferences over manually. Thus I don't want to format in disk utility and install.
    I seem to remember there was the option in Tiger (Leopard maybe?) to Archive and Install Without Preserving anything, such as network settings, users, extensions and preferences. It would leave a completely fresh System, and a Previous System where I could manually migrate over everything I wanted to keep.
    Is this possible in Snow Leopard?
    Thanks.

    Let me clarify.
    Snow Leopard does an Archive and Install, BUT it PRESERVES Users and Settings. The default install "upgrades in place".
    I have been having all sorts of weird crashes and hangs on my Leopard install and i want a fresh, not upgraded install.
    I WANT to keep my old Leopard system so I can manually transfer over fonts, files, and applications.
    I WANT an upgrade that DOES NOT preserve Preferences, Application Settings, extensions, etc. etc. etc.
    But, I do NOT want to have to completely format and install, because that would involve burning approximately 60G of files and applications to DVD-Rs and copying them back.
    Thanks.
    Message was edited by: J Law

  • New to the Apple and I want to set up a user account that will not delete the guest users files and allow and preserve their personal settings after log out. Is this possible?

    New to the Apple and I want to set up a user account that will not delete the guest users files and allow and preserve their personal settings after log out. Is this possible?

    The built-in guest user account will not do this. Simply create a new standard account and call it "Guest" or "Guest Users" or whatever you like.
    Go to System Preferences > Users& Groups, click "+" to make a new account.

  • Unable to check "Preserve Users and Network Settings" checkbox

    I may need to Archive and Install but I'm unable to select the "Preserve Users and Network Settings" checkbox when selecting Archive and Install. It's simply greyed out.
    Any ideas?

    Alan,
    Try repairing disk and repairing permissions first. Then try the Archive and Install option again.
    If that doesn't work you can always use a firewire drive and with carbon copy cloner, clone the drive. Then do a clean install and with the migration wizard import the users and network settings back. If you don't have firewire drive you can just do the Archive and Install without checking the "Preserver Users.." option. Your old users will still be in the "/Previous System/Users" folder.
    Message was edited by: b3av1s

  • Cannot select Preserve Users and Network Settings

    I am trying to do an Archive and Install but want to save my user settings but I cannot select "Preserve Users and Network Settings" as it is grayed out and unelectable. The question is, why?

    Have a read of this.
    http://discussions.apple.com/thread.jspa?threadID=1858697&tstart=1

  • Not given option to preserve users and network settings

    I have a Quicksilver with Leopard installed. I've learned that normally you can't install Leopard on this computer because the processor (733 mhz) is too slow. It works, but I've found that it does indeed run poorly.(The hard drive was transferred from another computer, with Leopard already installed.)
    So now I want to install Tiger on it, but when I get to the options installation window and click on the 'Archive and Install' button, the option to also 'preserve users and network settings' remains grayed out. I can't select it. Why so? I want to preserve the settings when I install Tiger.

    zanzen wrote:
    I have a Quicksilver with Leopard installed. I've learned that normally you can't install Leopard on this computer because the processor (733 mhz) is too slow. It works, but I've found that it does indeed run poorly.(The hard drive was transferred from another computer, with Leopard already installed.)
    So now I want to install Tiger on it, but when I get to the options installation window and click on the 'Archive and Install' button, the option to also 'preserve users and network settings' remains grayed out. I can't select it. Why so?
    because tiger installer doesn't know how to deal with leopard files as leopard was released after Tiger. downgraded like this is not recommended by apple.
    I want to preserve the settings when I install Tiger.
    you can't. however, if you do an archive and install without preserving user settings, your leopard home directory will be preserved in the Previous Systems folder at the top level of the hard drive. after you are done with the install of Tiger you can move what you need to your new home directory. move data files ONLY. don't move any preference files. they most likely won't work.
    A better option would be to back up your data to an external and do an erase and install of tiger. you should make a backup anyway in case something goes wrong with the install.

  • Preserve Users and Network Settings

    If I do an Archive & Install of my OS with this option off, will it keep my Users folder, or also erase it?
    And would it do anything to it if I put the contents of my home folder in a new directory somewhere not in the Users folder?
    Because I'd like to reset the network settings, but I'd like to keep my documents. Apple KBase tells that when this option is off, a backup is needed of your Users reason, but I don't see why if the documents are kept. Otherwise, I don't get why it's named "Archive" and Install, as nothing would be archived.

    It won't erase it, but it will move it to the Previous System Folder, and because there are various permissions on all the thousands of files in your Users folder, it will be difficult to reset them all correctly. You're better off leaving the option on to Preserver Users and Network Settings.
    Mulder

  • Preserve Users and Network Settings is grayed out

    Hi, I was having some issues with my Mac so I decided to perform an archive and install. I currently have Snow Leopard 10.6.4. I popped in the disk but when I got to choosing install options, "Preserve Users and Network Settings" is grayed out. I want to keep all my data as it was and just reinstall Snow Leopard. Does this option appear later on in the installation? Is there a way to go back? It's currently installing Snow Leopard. Please help

    Your Home folder may be in the Previous System Folder. Check to see if it's there and intact. Otherwise it's been moved into the new system. You need to make a backup of your Home folder on an external drive.
    1. Boot from your Snow Leopard Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID (for Intel Macs) or APM (for PPC Macs) then click on the OK button. Click on the Partition button and wait until the process has completed.
    4. Quit DU and return to the installer. Complete the installation. In the Setup Assistant be sure to use a different username/shortname for the new admin account than you used before.
    5. Upon completion use Migration Assistant in the Utilities folder to migrate your Home folder from the external backup drive.

  • EJB 3.0 JPA: java.lang.NullPointerException at  JdbcOdbcDriver.initialize()

    Hello every body,
    I'm trying to implement EJB 3.0 JPA .
    The entities Users ,and Products are created ,
    and the client is as shown below:
    package com.prapansol.demos;
    import java.util.List;
    import javax.ejb.EJB;
    import com.xyz.demos.ejb30.Users;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import javax.persistence.PersistenceContext;
    public class Client {
    private EntityManager manager;
    public Client() {
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("EJB");
    EntityManager em=emf.createEntityManager();
    this.setEntityManager(em);
    /** <code>select o from Users o</code> */
    public List<Users> queryUsersFindAll() {
    List<Users> users =null;
    try{
    users= getEntityManager().createNamedQuery("Users.findAll").getResultList();
    //@NamedQuery(name = "Users.findAll", query = "select o from Users o") has been defined in Users entity
    }catch(Exception e){
    System.out.println(e.getClass().getName());
    System.out.println(e.getMessage());
    e.printStackTrace();
    return users;
    public void shutDown(){
    getEntityManager().close();
    public void setEntityManager(EntityManager manager) {
    this.manager = manager;
    public EntityManager getEntityManager() {
    return manager;
    public static void main(String[] args) {
    Client client = new Client();
    List<Users> users=client.queryUsersFindAll();
         for(Users user : users ){System.out.println(""+user.getFirstName()+user.getLastName()); }
    The persistence.xml file is:
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
    <persistence-unit name="EJB">
    <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
    <class>com.xyz.demos.ejb30.Users</class>
    <class>com.xyz.demos.ejb30.Products</class>
    <class>com.xyz..demos.ejb30.ServiceRequests</class>
    <class>com.xyz.demos.ejb30.ServiceHistories</class>
    <class>com.xyz.demos.ejb30.ExpertiseAreas</class>
    <properties>
    <property name="jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="jdbc.connection.string" value="jdbc:oracle:thin:@localhost:1521:ORCL"/>
    <property name="jdbc.user" value="scott"/>
    <property name="jdbc.password" value="tiger"/>
    <property name="toplink.logging.level" value="INFO"/>
    </properties>
    </persistence-unit>
    </persistence>
    Here are the log messages :
    [TopLink Finest]: 2007.03.23 01:36:15.095--ServerSession(32012057)--Thread(Thread[main,5,main])--property=toplink.weaving; value=true
    [TopLink Config]: 2007.03.23 01:36:15.323--ServerSession(32012057)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.prapansol.demos.technology.Users] is being defaulted to: Users.
    [TopLink Config]: 2007.03.23 01:36:15.335--ServerSession(32012057)--Thread(Thread[main,5,main])--The table name for entity [class com.prapansol.demos.technology.Users] is being defaulted to: USERS.
    [TopLink Config]: 2007.03.23 01:36:15.360--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.Users.city] is being defaulted to: CITY.
    [TopLink Config]: 2007.03.23 01:36:15.377--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.Users.email] is being defaulted to: EMAIL.
    [TopLink Config]: 2007.03.23 01:36:15.431--ServerSession(32012057)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.prapansol.demos.technology.ServiceHistories] is being defaulted to: ServiceHistories.
    [TopLink Config]: 2007.03.23 01:36:15.435--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.ServiceHistories.notes] is being defaulted to: NOTES.
    [TopLink Config]: 2007.03.23 01:36:15.456--ServerSession(32012057)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.prapansol.demos.technology.ServiceRequests] is being defaulted to: ServiceRequests.
    [TopLink Config]: 2007.03.23 01:36:15.460--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.ServiceRequests.status] is being defaulted to: STATUS.
    [TopLink Config]: 2007.03.23 01:36:15.461--ServerSession(32012057)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.prapansol.demos.technology.Products] is being defaulted to: Products.
    [TopLink Config]: 2007.03.23 01:36:15.464--ServerSession(32012057)--Thread(Thread[main,5,main])--The table name for entity [class com.prapansol.demos.technology.Products] is being defaulted to: PRODUCTS.
    [TopLink Config]: 2007.03.23 01:36:15.466--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.Products.description] is being defaulted to: DESCRIPTION.
    [TopLink Config]: 2007.03.23 01:36:15.466--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.Products.image] is being defaulted to: IMAGE.
    [TopLink Config]: 2007.03.23 01:36:15.467--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.Products.name] is being defaulted to: NAME.
    [TopLink Config]: 2007.03.23 01:36:15.468--ServerSession(32012057)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.prapansol.demos.technology.ExpertiseAreas] is being defaulted to: ExpertiseAreas.
    [TopLink Config]: 2007.03.23 01:36:15.470--ServerSession(32012057)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.prapansol.demos.technology.ExpertiseAreas.notes] is being defaulted to: NOTES.
    [TopLink Config]: 2007.03.23 01:36:15.574--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [private java.util.List com.prapansol.demos.technology.ServiceRequests.serviceHistoriesList] is being defaulted to: class com.prapansol.demos.technology.ServiceHistories.
    [TopLink Config]: 2007.03.23 01:36:15.579--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [private com.prapansol.demos.technology.ServiceRequests com.prapansol.demos.technology.ServiceHistories.serviceRequests] is being defaulted to: class com.prapansol.demos.technology.ServiceRequests.
    [TopLink Config]: 2007.03.23 01:36:15.592--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [private java.util.List com.prapansol.demos.technology.Users.serviceHistoriesList] is being defaulted to: class com.prapansol.demos.technology.ServiceHistories.
    [TopLink Config]: 2007.03.23 01:36:15.593--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [private com.prapansol.demos.technology.Users com.prapansol.demos.technology.ServiceHistories.users] is being defaulted to: class com.prapansol.demos.technology.Users.
    [TopLink Config]: 2007.03.23 01:36:15.593--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [private java.util.List com.prapansol.demos.technology.Users.expertiseAreasList] is being defaulted to: class com.prapansol.demos.technology.ExpertiseAreas.
    [TopLink Config]: 2007.03.23 01:36:15.594--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [private com.prapansol.demos.technology.Users com.prapansol.demos.technology.ExpertiseAreas.users] is being defaulted to: class com.prapansol.demos.technology.Users.
    [TopLink Config]: 2007.03.23 01:36:15.594--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [private com.prapansol.demos.technology.Products com.prapansol.demos.technology.ExpertiseAreas.products] is being defaulted to: class com.prapansol.demos.technology.Products.
    [TopLink Config]: 2007.03.23 01:36:15.595--ServerSession(32012057)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [private java.util.List com.prapansol.demos.technology.Products.expertiseAreasList] is being defaulted to: class com.prapansol.demos.technology.ExpertiseAreas.
    [TopLink Finer]: 2007.03.23 01:36:15.600--ServerSession(32012057)--Thread(Thread[main,5,main])--Weaver processing class [com.prapansol.demos.technology.Users].
    [TopLink Finer]: 2007.03.23 01:36:15.601--ServerSession(32012057)--Thread(Thread[main,5,main])--Weaver processing class [com.prapansol.demos.technology.ServiceHistories].
    [TopLink Finer]: 2007.03.23 01:36:15.601--ServerSession(32012057)--Thread(Thread[main,5,main])--Weaver processing class [com.prapansol.demos.technology.ServiceRequests].
    [TopLink Finer]: 2007.03.23 01:36:15.601--ServerSession(32012057)--Thread(Thread[main,5,main])--Weaver processing class [com.prapansol.demos.technology.ExpertiseAreas].
    [TopLink Finer]: 2007.03.23 01:36:15.602--ServerSession(32012057)--Thread(Thread[main,5,main])--Weaver processing class [com.prapansol.demos.technology.Products].
    [TopLink Finer]: 2007.03.23 01:36:15.604--Thread(Thread[main,5,main])--cmp_init_globalInstrumentation_is_null
    [TopLink Finest]: 2007.03.23 01:36:15.613--ServerSession(32012057)--Thread(Thread[main,5,main])--begin deploying Persistence Unit EJB; state Predeployed; deploymentCount 0
    [TopLink Finest]: 2007.03.23 01:36:15.633--ServerSession(32012057)--Thread(Thread[main,5,main])--property=toplink.logging.level; value=FINEST; translated value=FINEST
    [TopLink Finest]: 2007.03.23 01:36:15.634--ServerSession(32012057)--Thread(Thread[main,5,main])--property=toplink.logging.level; value=FINEST; translated value=FINEST
    [TopLink Info]: 2007.03.23 01:36:15.639--ServerSession(32012057)--Thread(Thread[main,5,main])--TopLink, version: Oracle TopLink Essentials - 2006.8 (Build 060829)
    [TopLink Finest]: 2007.03.23 01:36:15.646--ServerSession(32012057)--Thread(Thread[main,5,main])--end deploying
    Persistence Unit EJB; state Undeployed; deploymentCount 0
    Here is the Stack Trace:
    Exception in thread "main" java.lang.NullPointerException
         at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)
         at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:140)
         at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:85)
         at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
         at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
         at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:180)
         at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:230)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:84)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:127)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:121)
         at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
         at com.prapansol.demos.Client.<init>(Client.java:29)
         at com.prapansol.demos.Client.main(Client.java:83)
    where am I doing wrong?
    Why does sun.jdbc.odbc.JdbcOdbcDriver.initialize method get called when I'm using Oracle DataBase?
    Am I missing any thing ?
    I'll be thankful if any one help me find my fault?
    Thanking you in Advance,
    Regards,
    Samba

    Check the property names for configuring TopLink's internal connection pool. All of the JDBC property names should be prefixed with toplink.
    Refer to the TopLink JPA extensions guide for more information.
    http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-extensions.html
    Doug

  • Error received on creating jpa entities

    Hello,
    I am using jdeveloper 11.1.1.7 and am working with a simple test of creating a row in a table.  I have created the Jpa entities as described on
    Oracle JDeveloper 11g Release 2 Tutorials - Building a JPA Application and
    EJB 3.0 component exposed as webservice using Oracle JDeveloper: Create simple EJB component, exposed it as a webservice…
    which deals more with creating an actual row in the table.
    I run it and I get a huge list of depreciated methods and an error.  It does load the data, which is great, but I cannot use this in production with all the errors produced!
    This is pretty bad considering most of the code was generated using the wizards....
    Any ideas?
    C:\Oracle11117\Middleware\jdk160_24\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\XML\.adf;C:\JDeveloper\mywork\XML\Jpa_EntitiesAgain\classes;C:\Oracle11117\Middleware\modules\com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar;C:\Oracle11117\Middleware\modules\org.eclipse.persistence_1.1.0.0_2-1.jar;C:\Oracle11117\Middleware\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle11117\Middleware\modules\javax.persistence_1.0.0.0_2-0-0.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\Oracle11117\Middleware\modules\javax.jsf_1.1.0.0_1-2.jar;C:\Oracle11117\Middleware\modules\javax.ejb_3.0.1.jar;C:\Oracle11117\Middleware\modules\javax.enterprise.deploy_1.2.jar;C:\Oracle11117\Middleware\modules\javax.interceptor_1.0.jar;C:\Oracle11117\Middleware\modules\javax.jms_1.1.1.jar;C:\Oracle11117\Middleware\modules\javax.jsp_1.2.0.0_2-1.jar;C:\Oracle11117\Middleware\modules\javax.jws_2.0.jar;C:\Oracle11117\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle11117\Middleware\modules\javax.mail_1.1.0.0_1-4-1.jar;C:\Oracle11117\Middleware\modules\javax.xml.soap_1.3.1.0.jar;C:\Oracle11117\Middleware\modules\javax.xml.rpc_1.2.1.jar;C:\Oracle11117\Middleware\modules\javax.xml.ws_2.1.1.jar;C:\Oracle11117\Middleware\modules\javax.management.j2ee_1.0.jar;C:\Oracle11117\Middleware\modules\javax.resource_1.5.1.jar;C:\Oracle11117\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle11117\Middleware\modules\javax.transaction_1.0.0.0_1-1.jar;C:\Oracle11117\Middleware\modules\javax.xml.stream_1.1.1.0.jar;C:\Oracle11117\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle11117\Middleware\modules\javax.xml.registry_1.0.0.0_1-0.jar;C:\Oracle11117\Middleware\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;C:\Oracle11117\Middleware\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.dms_11.1.1\dms.jar -Djavax.net.ssl.trustStore=C:\Oracle11117\Middleware\wlserver_10.3\server\lib\DemoTrust.jks jpa_entities.Serve.JavaServiceFacade
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.user is deprecated, property javax.persistence.jdbc.user should be used instead.
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.driver is deprecated, property javax.persistence.jdbc.driver should be used instead.
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.url is deprecated, property javax.persistence.jdbc.url should be used instead.
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.password is deprecated, property javax.persistence.jdbc.password should be used instead.
    [EL Finer]: 2013-10-07 15:35:17.718--ServerSession(13419912)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/JDeveloper/mywork/XML/Jpa_EntitiesAgain/classes/
    [EL Finer]: 2013-10-07 15:35:17.734--ServerSession(13419912)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/JDeveloper/mywork/XML/Jpa_EntitiesAgain/classes/
    [EL Config]: 2013-10-07 15:35:17.812--ServerSession(13419912)--Thread(Thread[main,5,main])--The access type for the persistent class [class jpa_entities.JpaTest] is set to [FIELD].
    [EL Config]: 2013-10-07 15:35:17.828--ServerSession(13419912)--Thread(Thread[main,5,main])--The alias name for the entity class [class jpa_entities.JpaTest] is being defaulted to: JpaTest.
    [EL Config]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--The column name for element [field test1] is being defaulted to: TEST1.
    [EL Config]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--The column name for element [field test2] is being defaulted to: TEST2.
    [EL Finer]: 2013-10-07 15:35:17.843--Thread(Thread[main,5,main])--JavaSECMPInitializer - transformer is null.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.user is deprecated, property javax.persistence.jdbc.user should be used instead.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.driver is deprecated, property javax.persistence.jdbc.driver should be used instead.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.url is deprecated, property javax.persistence.jdbc.url should be used instead.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.password is deprecated, property javax.persistence.jdbc.password should be used instead.
    [EL Finer]: 2013-10-07 15:35:17.859--ServerSession(13419912)--Thread(Thread[main,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Info]: 2013-10-07 15:35:18.25--ServerSession(13419912)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.1.3.v20110304-r9073
    [EL Warning]: 2013-10-07 15:35:18.25--Thread(Thread[main,5,main])--java.lang.ClassNotFoundException: weblogic.version
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:81)
      at org.eclipse.persistence.platform.server.wls.WebLogicPlatform.initializeServerNameAndVersion(WebLogicPlatform.java:85)
      at org.eclipse.persistence.platform.server.ServerPlatformBase.getServerNameAndVersion(ServerPlatformBase.java:181)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:653)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:576)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:389)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:164)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:221)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:209)
      at jpa_entities.Serve.JavaServiceFacade.getEntityManager(JavaServiceFacade.java:37)
      at jpa_entities.Serve.JavaServiceFacade._persistEntity(JavaServiceFacade.java:53)
      at jpa_entities.Serve.JavaServiceFacade.persistJpaTest(JavaServiceFacade.java:75)
      at jpa_entities.Serve.JavaServiceFacade.main(JavaServiceFacade.java:32)
    [EL Fine]: 2013-10-07 15:35:18.812--Thread(Thread[main,5,main])--Detected Vendor platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Config]: 2013-10-07 15:35:18.828--ServerSession(13419912)--Connection(21411547)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
      platform=>Oracle10Platform
      user name=> "stuartf"
      datasource URL=> "jdbc:oracle:thin:@lpgtr82:1521:test11g"
    [EL Config]: 2013-10-07 15:35:18.859--ServerSession(13419912)--Connection(15399793)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@lpgtr82:1521:test11g
      User: STUARTF
      Database: Oracle  Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
      Driver: Oracle JDBC driver  Version: 11.2.0.3.0
    [EL Info]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--file:/C:/JDeveloper/mywork/XML/Jpa_EntitiesAgain/classes/_Jpa_EntitiesAgain-1 login successful
    [EL Warning]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    [EL Warning]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    [EL Warning]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    [EL Finer]: 2013-10-07 15:35:19.093--ServerSession(13419912)--Thread(Thread[main,5,main])--Canonical Metamodel class [jpa_entities.JpaTest_] not found during initialization.
    [EL Finer]: 2013-10-07 15:35:19.109--ServerSession(13419912)--Thread(Thread[main,5,main])--client acquired
    [EL Finer]: 2013-10-07 15:35:19.109--UnitOfWork(7819553)--Thread(Thread[main,5,main])--begin unit of work commit
    [EL Finer]: 2013-10-07 15:35:19.109--ClientSession(32803057)--Connection(15399793)--Thread(Thread[main,5,main])--begin transaction
    [EL Fine]: 2013-10-07 15:35:19.125--ClientSession(32803057)--Connection(15399793)--Thread(Thread[main,5,main])--INSERT INTO JPA_TEST (JPA_TEST_ID, TEST1, TEST2) VALUES (?, ?, ?)
      bind => [2, hello, there]
    [EL Finer]: 2013-10-07 15:35:19.203--ClientSession(32803057)--Connection(15399793)--Thread(Thread[main,5,main])--commit transaction
    [EL Finer]: 2013-10-07 15:35:19.218--UnitOfWork(7819553)--Thread(Thread[main,5,main])--end unit of work commit
    [EL Finer]: 2013-10-07 15:35:19.218--UnitOfWork(7819553)--Thread(Thread[main,5,main])--resume unit of work
    [EL Finer]: 2013-10-07 15:35:19.218--UnitOfWork(7819553)--Thread(Thread[main,5,main])--release unit of work
    [EL Finer]: 2013-10-07 15:35:19.218--ClientSession(32803057)--Thread(Thread[main,5,main])--client released
    Process exited with exit code 0.

    The error seems caused by the persistence.xml specifying that EclipseLink should use the weblogic server platform, but you are not running your example within WLS.  This causes an internal exception when it tries to load WebLogic classes which are unavailable.  It is only printing off the exception at the warning level to indicate you do not have the correct settings for your test environment. 
    Ideally you would only want the log level set to severe or off in production, as any exceptions would be propagated up to the application anyway.
    Best Regards,
    Chris

  • JPA entities to the database generation

    Hi,
    I am trying to create JPA entities in an EJB diagram and then automatically get the tables created in a database schema. I started by creating some entities from the Entity wizard, then added some fields, dragged them into the diagram and added some relationships.
    With that done, I noticed that the tables in the offline database created by the wizard don't get updated with the new fields of the entities (they have only the id and version fields). And I couldn't figure out how to do so.
    Then, I tried to use the option 'Synchronize with database -> Generate to' option in the context menu from the EJB diagram, but its options appear disabled for me.
    Please, tell me if I am doing something wrong or expecting anything that the tool is not able to do for me.
    Thanks for any help.

    Disabling the bind variables produces the following:
    INSERT INTO BIG_NUM (ID, NUM) VALUES (2, 9999999999999999.00)The database still joyfully contains a rounded number:
    SQL> select * from big_num;
                     ID                   NUM
                      2  10000000000000000,00So, no, it's not an issue with the bind variables. I need to examine the JDBC driver but could you tell me how I can find out what Oracle JDBC driver is used by JPA? Or... is it some other JDBC driver (not Oracle, that is)?
    Best regards,
    Bisser
    P.S. We use the following version of TopLink Essentials:
    TopLink, version: Oracle TopLink Essentials - 2.1 (Build b60-fcs (11/17/2008))
    Edited by: bisser on Jan 28, 2009 9:25 AM

Maybe you are looking for