Why do I get a ClassCastException - weblogic.developer.interest.webservices.general(Archived)

Hello!
I'm playing around with axis2 at home.
I have a small application arch around a database called names.
This database consist of one table of names.
To access the database I have developed a hibernate package called nameshibernate.jar
I have also developed a ejb package that uses nameshibernate.jar, called namesejb_server.jar. And for any client to the ejb I got a namesejb_client.jar.
This ejb is running within a weblogic manage server 8.1.6 (called manged_wls_ejb, port:7011)
I have also developed a standalone Java application, namesjavaapplication.jar, that can access the database direct through nameshibernate.jar, and also through namesejb.jar (by using namesejb_client.jar).
This works fine:
namesjavaapplication.jar
->nameshibernate.jar
->->database
namesjavaapplication.jar
->namesejb_client.jar
->->manged_wls_ejb_7011
->->->namesejb.jar
->->->->nameshibernate.jar
->->->->->database
(Hope you understand my call/access hierarchy)
Now I am trying to access it through a webservice, with axis2.
My axis2 runs in an other weblogic manage server 8.1.6 (called manged_wls_webservice, port:7021)
I have developed a package called nameswebservice.aar. And for any client to the webservice I got a nameswebservice_client.jar.
The communicatio between the standalone Java application and the .aar works fine:
namesjavaapplication.jar
->nameswebservice_client.jar
->->manged_wls_webservice_7021
->->->nameswebservice.aar
But if I try to do it all the way like:
namesjavaapplication.jar
->nameswebservice_client.jar
->->manged_wls_webservice_7021
->->->nameswebservice.aar
->->->->namesejb_client.jar
->->->->->manged_wls_ejb_7011
->->->->->->namesejb.jar
->->->->->->->nameshibernate.jar
->->->->->->->->database
It seems to crash in my webservice layer:
nameswebservice.aar
I get this exception, and I can not figure out why, since the code to call the ejb is the same in namesjavaapplication.jar and in nameswebservice.aar.
namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
java.lang.ClassCastException: Cannot narrow remote object to namesejb.client.NameManagerEJBHome
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at nameswebservices.NamesWebService.getNamesWSEJB(NamesWebService.java:31)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
        at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:165)
        at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
        at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
        at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
        at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
The code looks like:
        try
        {
            System.out.println("addNameWSEJB start " + name);
            Context context = getWebLogicInitialContext();
          
            Object object1 = context.lookup("namesejb/client/NameManagerEJBHome");
            System.out.println(object1.getClass().getName());
          
            Object object2 = PortableRemoteObject.narrow(object1, Object.class);
            System.out.println(object2.getClass().getName());
            NameManagerEJBHome nameManagerEJBHome = (NameManagerEJBHome)PortableRemoteObject.narrow(object1, NameManagerEJBHome.class);
            NameManangerEJBObject nameManangerEJBObject = nameManagerEJBHome.create();
          
            nameManangerEJBObject.addName(name);
          
        }
catch(Exception e)
{
e.printStackTrace();
}
To me it looks strange that the name of the class for the instances is:
namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
So if any one got any ideas peleas let me know!
Best regards
Fredrik
--
Edited by fredand44 at 04/18/2008 12:44 PM
--
Edited by fredand44 at 04/18/2008 12:45 PM

Related

IndexOutOfBoundsException after DbDump -> DbLoad

Hi, using je 3.1.25. I have some code that dumps and loads a je database.
In my unit test, the pseudocode goes like this:
1. Create a database, filled with stuff
2. Use the DPL API to get the number of things of TYPEA from created database
3. Dump the database to the filesystem
4. Load the database from the filesystem
5. Assert the loaded database is not null
6. Use the DPL API to get the number of things of TYPEA from loaded database
7. Assert that the number from step 2 and step 6 are equal
The problem is that at step 6, an IndexOutOfBoundsException is thrown...
The stack trace is:
java.lang.IndexOutOfBoundsException: Index: 52, Size: 51
     at java.util.ArrayList.RangeCheck(Unknown Source)
     at java.util.ArrayList.get(Unknown Source)
     at com.sleepycat.persist.impl.PersistCatalog.getFormat(PersistCatalog.java:621)
     at com.sleepycat.persist.impl.RecordInput.readObject(RecordInput.java:133)
     at com.sleepycat.persist.impl.ObjectArrayFormat.readObject(ObjectArrayFormat.java:121)
     at com.sleepycat.persist.impl.RecordInput.readObject(RecordInput.java:151)
     at com.sleepycat.persist.impl.CollectionProxy.bdbReadNonKeyFields(CollectionProxy.java)
     at com.sleepycat.persist.impl.CollectionProxy$ArrayListProxy.bdbReadNonKeyFields(CollectionProxy.java)
     at com.sleepycat.persist.impl.EnhancedAccessor.readNonKeyFields(EnhancedAccessor.java:159)
     at com.sleepycat.persist.impl.ComplexFormat.readObject(ComplexFormat.java:472)
     at com.sleepycat.persist.impl.ProxiedFormat.newInstance(ProxiedFormat.java:83)
     at com.sleepycat.persist.impl.RecordInput.readObject(RecordInput.java:135)
     at com.sleepycat.persist.impl.ReflectionAccessor$ObjectAccess.read(ReflectionAccessor.java:374)
     at com.sleepycat.persist.impl.ReflectionAccessor.readNonKeyFields(ReflectionAccessor.java:274)
     at com.sleepycat.persist.impl.ComplexFormat.readObject(ComplexFormat.java:472)
     at com.sleepycat.persist.impl.PersistEntityBinding.readEntity(PersistEntityBinding.java:88)
     at com.sleepycat.persist.impl.PersistEntityBinding.entryToObject(PersistEntityBinding.java:58)
     at com.sleepycat.persist.EntityValueAdapter.entryToValue(EntityValueAdapter.java:56)
     at com.sleepycat.persist.BasicCursor.returnValue(BasicCursor.java:206)
     at com.sleepycat.persist.BasicCursor.next(BasicCursor.java:74)
     at com.sleepycat.persist.BasicIterator.hasNext(BasicIterator.java:50)
     at com.teleatlas.global.dal.cache.BerkeleyCache.getFeaturesByCode(BerkeleyCache.java:283)
     at com.teleatlas.global.dal.store.impl.FeatureStoreImpl.getFeatures(FeatureStoreImpl.java:129)
     at test.com.teleatlas.global.dal.store.TestPersistentFeatureStoreFactory.testCreateDumpLoad(TestPersistentFeatureStoreFactory.java:92)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
     at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
     at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
     at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
     at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
     at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
     at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
     at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
     at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
     at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)The only je.properties that I have overriden from the default settings are thus:
je.log.checksumRead=false
je.env.runCheckpointer=false
je.env.runCleaner=false
je.env.runEvictor=false
je.env.runINCompressor=false
je.env.isTransactional=false
je.log.memOnly=true
je.env.fairLatches=true
je.adler32.chunkSize=1048576
je.env.sharedLatches=true
je.log.faultReadSize=65635
je.maxMemory=2288012
je.lock.nLockTables=3
je.deferredWrite.temp=true
je.lock.timeout=1000000When I do the dump/load -- I ensure the properties are matching.
I'm using the DPL. Any ideas on what might be going on here?
Thanks in advance...
Davis
Message was edited by:
user522802 
Hi Davis,
The problem is that at step 6, an
IndexOutOfBoundsException is thrown...It looks like you have not done a dump/load of the catalog database that is part of a DPL store. No index database can be used independently of the catalog database for its store. Plus, a secondary index is dependent on its primary index and and a primary index may be dependent on foreign key indexes. Be sure to do the dump when all related databases are quiescent (no threads are changing them) and all transactions are committed.
For more information on which databases to dump/load see the Database Names section in the javadoc for the EntityStore class.
Mark 
Hi Mark...thanks for the reply. For reference, here's my code that does the dump:
public void dump(String outputDirectory, String fileName) throws TADalException {
        PrintStream ps = null;
        Environment env = this.dbEnv.getEnv();
       
        File f = new File(outputDirectory+File.separator+fileName);
        try {
            ps = new PrintStream(f);
            List<String> databases = env.getDatabaseNames();
            for(String databaseName : databases) {
             DbDump dump = new DbDump(env, databaseName, ps, outputDirectory, false);
             dump.dump();
            }
        } catch (FileNotFoundException e) {
            throw new TADalException(e);
        } catch (DatabaseException e) {
            throw new TADalException(e);
        } catch (IOException e) {
            throw new TADalException(e);
        } finally {
            if(ps != null) {
             ps.close();
            }
        }
    }...and here's my code that does the load:
    public void load(String inputDirectory, String fileName)
            throws TADalException {
        BufferedReader br = null;
        Environment env = this.dbEnv.getEnv();
        String filepath = inputDirectory + File.separator + fileName;
        File f = new File(filepath);
   
        try {
            if (!f.exists()) {
             throw new IllegalArgumentException("File does not exist: "
                  + filepath);
            }
            FileReader fileReader;
   
            fileReader = new FileReader(f);
            br = new BufferedReader(fileReader);
   
            DbLoad loader = new DbLoad();
            loader.setEnv(env);
            loader.setInputReader(br);
   
            List<String> databases = env.getDatabaseNames();
            for (String databaseName : databases) {
             loader.setDbName(databaseName);
             loader.load();
            }
        } catch (DatabaseException dbe) {
            throw new TADalException(dbe);
        } catch (FileNotFoundException e) {
            throw new TADalException(e);
        } catch (IOException e) {
            throw new TADalException(e);
        } finally {
            if(br != null) {
             try {
                 br.close();
             } catch (IOException e) {
                 LOGGER.debug("could not close buffered reader.");
             }
            }
        }
    }For small je databases in a unit test that I fill with only one or two DPL items, this seems to work fine. I test it by creating a db, dumping it, loading it...then verifying that i can get things out of the loaded db. It works ok.
Now, for larger db -- I run into this exception. Just as a hack, I added a sleep for 10 seconds between the time I dump the db and the time I load it, but I still get the exception.
Any thoughts -- after looking at the two methods posted above? 
Hi Davis,
When you load the database I notice that you're assuming that the databases were written in the same order returned by Environment.getDatabaseNames at the time you load. Maybe this works in your unit test, but in general you need to know what databases were written -- this information is not in the dump output. For a test, I suggest saving the list of DB names during the dump, and using that list during the load, rather than relying on getDatabaseNames during the load.
If you want to completely replace a database when loading, you'll have to call Environment.truncateDatabase or removeDatabase yourself before loading. The load doesn't do that.
Before you load, be sure that you close the store. The DPL metadata is cached -- loading the databases won't replace the cached information. You'll have to open the store again to cause the new information to be used.
Does this any of this help?
Mark 
Mark -- is it possible you could email me so I could send you some code snippets and log traces?
I promise to post the resolution here...but I'd like to maybe send you some stuff that I'd prefer not posting...
davisford at gmail dot com 
Posting resolution here:
The sequence of events for the way I was doing the dump / load was wrong.
It needs to follow this when using DPL:
1. Create database
2. Dump the database
2.5. I also recommend serializing out the List<String> databaseNames that you can get from the Environment
3. Create new Database, but do not create EntityStore (i.e. call constructor)
4. Load the database from disk using the de-serialized List<String> object
5. Create the EntityStore
6. Initialize your DPL by setting up all primary/secondary indices, etc.
Thanks Mark -- for all the help!
--davis                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
Thanks Mark -- for all the help!You're welcome, thanks for sharing the resolution with everyone.
Mark

JBO-25030 Exception

Hi,
I'm generating a JSP application with JHeadstart10.1.2.2 build13.
I have defined in the JAG one basegroup with 6 detail groups. If I create a new record in one of the detail groups, at one detail group this is working fine, but at the other ones I get a exception:
JBO-25030: Kan entiteit met eigenaarsrechten niet vinden of ongeldig maken
The associations and viewlinks look all the same (No composite constructions in the association). I have just generated the pages and made no custom changes to the code.
Does anyone have an idea how I can solve this? 
Here is some more info referring to this issue:
Of course I have used JHeadstart build 32 and not 13.
I'm getting the exception also when trying to create some rows programmatically for a new master row. The complete stacktrace is at the end of this post.
The strange thing is that if I create the master row also programmatically and then call my custom method to create the child records it works fine. But when I create the master row in my generated screen and my custom method is called by the ADF framework, it gives me the JBO-25030 exception.
Possible causes for this problem are more then welcome :-)
The stacktrace:
oracle.jbo.InvalidOwnerException: JBO-25030: Kan entiteit met eigenaarsrechten niet vinden of ongeldig maken.
        at oracle.jbo.server.EntityImpl.internalCreate(EntityImpl.java:528)
        at oracle.jbo.server.EntityImpl.create(EntityImpl.java:395)
        at logicacmg.adf.model.businessobjects.ResultEntityImpl.create(ResultEntityImpl.java:127)
        at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:413)
        at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:849)
        at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:336)
        at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:353)
        at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:2549)
        at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1048)
        at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:1724)
        at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:1766)
        at oracle.jbo.server.ViewRowSetImpl.createRow(ViewRowSetImpl.java:1746)
        at com.hbr.rbs.referentie.model.service.RbsReferentieServiceImpl.initRbsEigenschappenView(RbsReferentieServiceImpl.java:271)
        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:324)
        at oracle.adf.model.binding.DCInvokeMethodDef.invokeMethod(DCInvokeMethodDef.java:275)
        at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:1609)
        at oracle.adf.model.binding.DCInvokeMethodDef.callMethod(DCInvokeMethodDef.java:169)
        at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1054)
        at oracle.adf.controller.struts.actions.StrutsPageLifecycle.invokeCustomMethod(StrutsPageLifecycle.java:364)
        at oracle.adf.controller.struts.actions.DataAction.invokeCustomMethod(DataAction.java:352)
        at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.invokeCustomMethod(JhsDataAction.java:3833)
        at oracle.adf.controller.struts.actions.DataAction.invokeCustomMethod(DataAction.java:542)
        at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:134)
        at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:222)
        at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.handleLifecycle(JhsDataAction.java:506)
        at logicacmg.adf.controller.strutsadf.action.ResultJhsDataAction.handleLifecycle(ResultJhsDataAction.java:180)
        at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:153)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
        at oracle.jheadstart.controller.strutsadf.JhsRequestProcessor.processActionPerform(JhsRequestProcessor.java:118)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        at oracle.jheadstart.controller.strutsadf.JhsRequestProcessor.process(JhsRequestProcessor.java:385)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:130)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
        at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
        at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
        at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
        at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
        at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
        at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
        at oracle.jheadstart.controller.strutsadf.JhsRequestProcessor.process(JhsRequestProcessor.java:385)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:130)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
        at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:176)
        at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
        at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
        at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
        at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
        at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
        at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
        at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
        at java.lang.Thread.run(Thread.java:534)Here the piece of code that create the child records:
(RbsGseStoffenView is the master view and RbsGseEigenschappenView is the detail view)
        Row currentRow = getRbsGseStoffenView().getCurrentRow();
       
        /* If current row is found ... */
        if (!hasPendingDataPosts() && currentRow != null)
        {
         ...
         _log.debug("Creating new GsfEigenschappenView row for GseId " +          currentRow.getAttribute("Id"));
                    // ... create row with current GseId
                    // note: Row gets created on middle-tier, not in database.
                    Row newRow = ((RbsGseStoffenViewRowImpl) currentRow)
                                  .getRbsGseEigenschappenView()
                                  .createRow();
                                 
                    newRow.setAttribute("RijIdEgp", egpRows.getAttribute("RijId"));
((RbsGseStoffenViewRowImpl) currentRow).getRbsGseEigenschappenView().insertRow(newRow);
Paskal,
Check out this link:
http://radio.weblogs.com/0118231/stories/2003/01/17/whyDoIGetTheInvalidownerexception.html
Steven Davelaar,
JHeadstart Team. 
Steven,
I have seen that article. But as far as I can tell I'm doing what Steve tells there, but I am still having the problem.
I will try to make a simpler test case so I can find out what is the exact cause of the problem.
Thanks anyway. 
I have found the problem (and solution :-) ).
For the record:
I was generating Master-Detail page for say table M(aster) and table D(etail). Although I was creating records for D in the context of M, it appeared D was also a detail of table M2. With this M2 the D had a composite relation (set in the association). By removing the composite flag in the association this exception was gone. 
Paskal
Thanks for the tip, You just saved my day.
What I do not understand though is, when do these check boxes become activated when an ossification is defined and if this is a bug or not.
Thanassis 
This saved my butt as well, I have spent the last couple of hours wondering why I could not get it to work. When I used the wizards to create my components, the wizard marked the check boxes for me. Turned em off and now my code works great!!! 
This saved my butt as well, I have spent the last
couple of hours wondering why I could not get it to
work. When I used the wizards to create my
components, the wizard marked the check boxes for me.
Turned em off and now my code works great!!!- Yes, but how to achieve cascade delete without that ? 
Please post your question in the JDeveloper forum since it is not related to JHeadstart.
Thank you,
Steven Davelaar,
JHeadstart Team.

One member of cluster getting java.sql.SQLException: Closed Connection

I have an application deployed in a production environment on Weblogic 9.2 MP1 with a three member cluster, and have recently been experiencing a problem with only one member of the cluster where the following exception occurs in various places within the application: 2010-09-01 15:29:58,035 ERROR encore.acs - class: ACSManagerBean method: setCPE(): 00098 ACS - action=dbCPEFromDeviceId(), error=com.supportsoft.encore.common.exception.DAOException: java.sql.SQLException: Closed Connection 2010-09-01 15:29:58,035 ERROR encore.acs - java.sql.SQLException: Closed Connection com.supportsoft.encore.common.exception.DAOException: java.sql.SQLException: Closed Connection at com.supportsoft.servicegateway.cwmp.ejb.acsmanager.dao.ACSManagerGenericDAO.dbCPEFromDeviceId(ACSManagerGenericDAO.java:429) at com.supportsoft.servicegateway.cwmp.ejb.acsmanager.ACSManagerBean.setCPE(ACSManagerBean.java:212) at com.supportsoft.servicegateway.cwmp.ejb.acsmanager.ACSManager_vlz320_EOImpl.setCPE(ACSManager_vlz320_EOImpl.java:1248) at com.supportsoft.servicegateway.cwmp.ejb.acsmanager.ACSManager_vlz320_EOImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:548) at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224) at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:438) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:434) at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:57) at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:965) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) The stacktrace is not always the same, and the only thing I can see in common with the various occurances is the java.sql.SQLException: Closed Connection. The other two members of the cluster are running the exact same application, and do not experience this issue at all. Does anyone have any idea what might be causing this to happen on just one member of the cluster? Here are the JDBC setting in WL: Initial Capacity 25 Maximum Capacity 350 Capacity Increment 25 Statement Cache Type LRU Statement Cache Size 50 Test Connections On Reserve N Test Frequency Test Table Name DUAL Seconds to Trust an Idle Pool Connection 10 Shrink Frequency 900 Init SQL Connection Creation Retry Frequency 0 Login Delay 0 Inactive Connection Timeout 300 Maximum Waiting for Connection 2147483647 Connection Reserve Timeout 10 Statement Timeout -1 Ignore In-Use Connections Y Pinned-To-Thread Remove Infected Connections Enabled Y Thanks, Jeremy
I came across an issue where the multi-threaded application was not correctly synchronized when getting the connection object. Therefore two instances were grabbing the same connection object. The first one uses it and closes it, then the second one tries to use it and a closed message such as you are getting exists.It could just be a coincidence why the first two servers dont encouter the issue.
I think it has to do more with your application code rather than your data source...although I'd analyze the database servers for error logs
The bottom line is that you are using a connection object that's been closed since you last grabbed it. 
As I understand it, you should be using a connection pool. You get a connection (from dataSource), assign it to a local variable (which is therefore thread safe), use it, and close it all within a try/catch/fnially block. The connection should not remain open for any significant duration, or shared in a cluster. I suggest rewritng you code with this in mind.
As for gathering additional information on the problem, perhaps you can disconnect the problem server from the cluster and test it in isolation. If the problem goes away, its a cluster problem. If it doesn't, it isn't. 
Thanks for your replies, but I don't think it is a syncronization issue, although I am open to input on my design if that is the case. I am using EJBs for all of my interations with the DB. They get a new connections from the dataSource before attempting to do anything with the database. This connection is then closed once it has been finished with. I am going to post a new stacktrace from when I am getting a similar problem, as well as posting the method that is opening and closing the connection with the database. Please let me know if you see any errors with how I am interacting with the dataSource. Thanks in advance for any input you can provide:
2010-09-14 16:32:39,725 002691-FAST3664-LK10039DP170078 X0031 ERROR - ZTCLoggerBean.getStatusLog - Closed Connection
2010-09-14 16:32:39,726 002691-FAST3664-LK10039DP170078 X0031 DEBUG -
java.sql.SQLException: Closed Connection
     at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
     at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:197)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:269)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:490)
     at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3127)
     at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042)
     at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1252)
     at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1024)
     at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:958)
     at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:500)
     at weblogic.jdbc.wrapper.JTSConnection.prepareStatement(JTSConnection.java:504)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.dao.ZTCLoggerOracleDAO.getStatusLog(ZTCLoggerOracleDAO.java:55)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLoggerBean.getStatusLog(ZTCLoggerBean.java:140)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLoggerBean.setStatusLog(ZTCLoggerBean.java:275)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLogger_ykdhxs_EOImpl.setStatusLog(ZTCLogger_ykdhxs_EOImpl.java:69)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLogger_ykdhxs_EOImpl_WLSkel.invoke(Unknown Source)
     at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
     at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:335)
     at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLogger_ykdhxs_EOImpl_921_WLStub.setStatusLog(Unknown Source)
     at com.supportsoft.custom.bgc.ztc.helper.PolicyActionHelper.setZTCStatusStatus(PolicyActionHelper.java:726)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.processCID(GetServiceConfigurationActionManagerBean.java:2093)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.processWebServiceCallResults(GetServiceConfigurationActionManagerBean.java:589)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.doActionNew(GetServiceConfigurationActionManagerBean.java:374)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.doActionNew(GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.java:137)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.doAction(GetServiceConfigurationActionManagerBean.java:280)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.doAction(GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.java:62)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionMDB.onMessage(GetServiceConfigurationActionMDB.java:101)
     at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
     at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
     at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
     at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4060)
     at weblogic.jms.client.JMSSession.execute(JMSSession.java:3953)
     at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4467)
     at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Here is the method that is making the connection with the database:
public ZTCStatusLogDTO getStatusLog(Long primaryKey)
throws SQLException {
     ZTCStatusLogDTO dto = null;
     String sql = ZTCLoggerDAOResources.SELECT_STATUS_LOG_BY_ID;
Connection conn = _ds.getConnection();
try{
     PreparedStatement stmt = conn.prepareStatement(sql);
     stmt.setLong(1, primaryKey.longValue());
     try{
          ResultSet rset = stmt.executeQuery();
          try{
if (rset.next()) {
dto = populateStatusLogDTO(rset);
}
          }catch (SQLException sqle) {
throw sqle;
} finally {
     rset.close();
}
     }catch (SQLException sqle) {
throw sqle;
} finally {
stmt.close();
}
} catch (SQLException sqle) {
throw sqle;
} finally{
     conn.close();
}
return dto;
}
Please let me know if you need anything else.
Cheers,
Jeremy 
That snippet should be wrapped in code tags otherwise its very hard to read. 
Here's an example of a suggested cleaner approach to your function.
Notes:
1: there is one try/catch/finally block that encapsulates all your business logic rather than
having it embedded within the body of the business logic.
2: The exception has usuful additional information added to it (the personID) before it it rethrown.
3: you check to see if the object is not null before closing it.
I dont know if this will solve your problem, but it may produce a better stack trace to help determine the problem.
     public Person getPerson(int personID)
          throws SQLException{
          
                Connection                                connection=             null;
          PreparedStatement               preparedStatement=     null;
          ResultSet                         resultSet=               null;
          
          String                         sqlStatement;
          
          Person                         person=               null;
          
          
          try{     
               
               person= new Person();
               
          
                 sqlStatement="select " +
                              "p.person_id    personID,"+
                              "p.first_name   firstName, " +
                              "p.last_name   lastName,"+
                              "from " +
                               "person p " +
                              "where " +
                               "person_id=?";
     
               
               preparedStatement = connection.prepareStatement(sqlStatement);
               
               
               
               preparedStatement.setInt(1,personID);
            
               resultSet = preparedStatement.executeQuery();
               
               if(resultSet.next()){
          
                    person.setPersonID(resultSet.getInt("person_id"));
                    person.setFirstName(resultSet.getString("first_name"));
                    person.setLastName(resultSet.getString("last_name"));
               }
               
               return person;
          }catch(SQLException e){
               throw new SQLException("problem processing person_id="+person_id, e);
          }finally{
               if(resultSet!=null)
                    resultSet.close();
               if(preparedStatement!=null)
                    preparedStatement.close();
                        if(connection!=null)
                                connection.close();
          }
     } 
Here is the code within code tags. Sorry about that.
    public ZTCStatusLogDTO getStatusLog(Long primaryKey)
       throws SQLException {
         ZTCStatusLogDTO dto = null;
         String sql = ZTCLoggerDAOResources.SELECT_STATUS_LOG_BY_ID;
        Connection conn = _ds.getConnection();
        try{
             PreparedStatement stmt = conn.prepareStatement(sql);
             stmt.setLong(1, primaryKey.longValue());
             try{
                  ResultSet rset = stmt.executeQuery();
                  try{
                    if (rset.next()) {
                        dto = populateStatusLogDTO(rset);
                    }
                  }catch (SQLException sqle) {
                    throw sqle;
                } finally {
                     rset.close();
                }  
             }catch (SQLException sqle) {
                throw sqle;
            } finally {
                stmt.close();
            }
        } catch (SQLException sqle) {
            throw sqle;
        } finally{
             conn.close();
        }
        return dto;
    }
    
_dsAnd what is that? 
Yes, please post the code that handles _ds which probably is your datasource object                                                                                                                                                                                
Here is the code at the beginning of the class that deals with getting the data source.
    DataSource _ds = null;
   
    /**
     * Instantiates a new functional DAO using the provided
     * InitialContext and JNDI DataSource name.
     * #param ctx
     * #param dsJndi
     */
    public ZTCLoggerOracleDAO(InitialContext ctx,
                              String dsJndiName)
       throws NamingException {
        _ctx = ctx;    
        _ds = (DataSource)_ctx.lookup(dsJndiName); 
    }Here is the EJB level code that calls ZTCLoggerOracleDAO
    /**
     * ejbCreate creates the DAO instance used to access the database
     * #throws CreateException Create exception thrown
     *
     * #ejb.create-method
     *
     * #ejb.permission
     *   unchecked="True"
     */
    public void ejbCreate() throws CreateException {
         String methodName = "ejbCreate";
        // Get a handle to the properties file.
        try {
            this._properties = ZTCProperties.getInstance();
           
            // Get the Log4J logger.
            _logger = new FileLogger(this._properties.isLogStackTraceEnabled());
           
            // Get the ServiceGateway DataSource JNDI Name.
            String dbJndiName = this._properties.getSERVICEGATEWAY_DATASOURCE();
           
            // Obtain an initial context with the SG server
            // and initialize the DAO.
            _remoteContext = this._properties.getInitialContext();         
            _dao = new ZTCLoggerOracleDAO(_remoteContext, dbJndiName);
        } catch (Exception d) {    
            if (_logger != null) {
                _logger.error(_className, methodName, "Error initialising DAO.", d);
            } else {
                d.printStackTrace();
            }
            throw new CreateException();
        }
    }Let me know if you need additional code.
As for the restructing of the code that does all of the interaction with the database within on try/catch block, I have avoided doing that incase any of the close() statements in the finally block throws an Exception that it wouldn't cause the rest of the finally block not to get executed. This might be overkill, but I don't think it would cause any problems doing it this way. As for adding extra logging, I can look to do that but as this is currently running in a production environment it would be some time before I could add that level of logging. As this Closed connection doesn't always occur within the same method, I would have to add it accross multiple methods for it to be helpful. But thank you for your suggustion.
Please let me know if you have any other thoughts or need any other information.
Cheers,
Jeremy 
I just noticed this right after the previous stacktrace in case this helps explain what is happening:
2010-09-14 16:32:39,746 002691-FAST3664-LK10039DP170078 X0031 ERROR - PolicyActionHelper.setZTCStatus - Error updating DRE Status log: BEA1-51590F174ED744F5004B; nested exception is:
     javax.transaction.HeuristicMixedException: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection))
2010-09-14 16:32:39,746 002691-FAST3664-LK10039DP170078 X0031 DEBUG -
java.rmi.RemoteException: BEA1-51590F174ED744F5004B; nested exception is:
     javax.transaction.HeuristicMixedException: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection))
     at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:205)
     at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:335)
     at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLogger_ykdhxs_EOImpl_921_WLStub.setStatusLog(Unknown Source)
     at com.supportsoft.custom.bgc.ztc.helper.PolicyActionHelper.setZTCStatusStatus(PolicyActionHelper.java:726)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.processCID(GetServiceConfigurationActionManagerBean.java:2093)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.processWebServiceCallResults(GetServiceConfigurationActionManagerBean.java:589)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.doActionNew(GetServiceConfigurationActionManagerBean.java:374)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.doActionNew(GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.java:137)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean.doAction(GetServiceConfigurationActionManagerBean.java:280)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.doAction(GetServiceConfigurationActionManagerBean_8z47kg_ELOImpl.java:62)
     at com.supportsoft.custom.bgc.plugins.action.ejb.gsc.GetServiceConfigurationActionMDB.onMessage(GetServiceConfigurationActionMDB.java:101)
     at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
     at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
     at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
     at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4060)
     at weblogic.jms.client.JMSSession.execute(JMSSession.java:3953)
     at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4467)
     at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: javax.transaction.HeuristicMixedException: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection))
     at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:298)
     at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:227)
     at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:539)
     at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
     at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLogger_ykdhxs_EOImpl.setStatusLog(ZTCLogger_ykdhxs_EOImpl.java:83)
     at com.supportsoft.custom.bgc.logging.ejb.ztc.ZTCLogger_ykdhxs_EOImpl_WLSkel.invoke(Unknown Source)
     at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
     ... 20 more 
It looks like each time you call the ZTCLoggerOracleDAO constructor, you assign a new value to this:
DataSource _ds = null;
The old value is dis-assigned and you may think its available for garbage collection which probably will never occur because it holds onto a minimum number of connections (it being a connection pool) that you set in the configuration of the dataSource. Therfore all the times you call the constructor, you add yet another unreferenced dataSource object that is never garbage collected. Eventually, you will have so many dataSources with minimal connections that you will run out of connection resources. I suspect this is what is happening. The solution is as follows:
Change this:
DataSource _ds = null;
to this:
private static DataSource ds=null;
Then in your constructor, only assign a new dataSource to ds if ds is null. This way, its only assigned once for the duration of your application running. Being static, there will be only one of them.
**********
By the way, I still think your closed connection error is due to somwhere in your program it closes a connection and then tries to re-use it. This often happens when you get a connection in one function and close it in another. That's way I recommend getting it and closing it in the same function using try/catch/finally per my example.
***********
Side note: you can get a connection in function1, pass it to a bunch of other functions that have sql, then when they return to function1, close it. This concept doen't violate my point in the previous paragraph. 
#njb7ty: the problem is that connection closed The code might be leaking connections, we still dont know that; but making _ds static would still leave scope for original problem of connection closed if each thread tries to close the same connection.
#OP: Are you sure each open connection is being closed? (Of course you must have done it, leading to connection closed) 
To track down getConnection/ close Connection issues, I suppose you can try to write to System.out.println or the log file each time you get a connection, and each time you close it, and what function you are doing it in. Let it run and see if your output shows a matching pair for each getConnection/close connection. 
Can you change this to Y and try?
Test Connections On Reserve N

Configuring toplink.weaving="static": Cannot apply class transformer?

All,
I have managed to successfully run TopLink Essentials build 2.0_49 in JTA mode from within the web container of Sun Java System Application Server 8.1EE by providing appropriate implementations for ServerPlatform and TransactionController as described in Wonseok Kim's blog entry at:
http://jroller.com/page/guruwons?entry=use_glassfish_java_persistence_provider
My issue now is that - as I cannot use dynamic weaving based on the agent in this environment - I would like to configure static weaving.
Using no weaving at all, my application deploys and runs fine, but when changing
<property name="toplink.weaving" value="false" /> to
<property name="toplink.weaving" value="static" />I receive the following exception and stack trace:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot apply class transformer without LoadTimeWeaver specified
Caused by: java.lang.IllegalStateException: Cannot apply class transformer without LoadTimeWeaver specified
        at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.addTransformer(SpringPersistenceUnitInfo.java:67)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:208)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4010)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4522)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:241)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:827)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:811)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:646)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1322)
        at com.sun.enterprise.web.HttpServiceWebContainer.loadWebModule(HttpServiceWebContainer.java:880)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1038)
        at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:160)
        at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:246)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:918)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:905)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:427)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
        at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:288)
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:155)
        at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:258)
        at com.sun.enterprise.deployment.phasing.StartPhase.runPhase(StartPhase.java:87)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:71)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:639)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:361)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:396)
        at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:702)
        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 com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:302)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:357)
        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
        at $Proxy1.invoke(Unknown Source)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:272)
        at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:38)
        at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:92)
        at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:69)
        at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:264)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:178)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:174)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
        at com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.process(HttpServiceProcessor.java:234)
        at com.sun.enterprise.web.HttpServiceWebContainer.service(HttpServiceWebContainer.java:2143) My expectation was that when toplink.weaving is set to "static",
EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:208)should not call back into PersistenceUnitInfo to add a transformer, as none is needed at runtime any more...
Is this an issue with Spring's JPA module or with TopLink Essentials?
Thanks in advance & best regards,
Andreas 
Citing from a mail by Tom Ware/Oracle:
"There is likely a bug in the static weaving code that attempts to add the transformer even though it will not be used. The reason we have not discovered this issue until now is that in most situations the fact that that transformer gets added despite the fact that we are statically weaving just gets ignored and the application functions. In Spring, apparently that is not the case."
So I have just created
https://glassfish.dev.java.net/issues/show_bug.cgi?id=3146
for this.issue.
Thanks for your help with this, Tom!
Best regards,
Andreas

oracle to netezza

Oracle db ver 10.2.0.3
via a simple java program I am tring via jdbc to connect to a netezza server. the code work from the command line but does not work within the Oracle JVM. I did try the grants to allow access to the applications a couple of ways but no luck. via load java the nz jdbc driver and this code was loaded into the Oracle db.
package nzTest;
import java.sql.*;
public class main
{
Connection conn;
public static void main(String[] args){ new main();}
public static void doConnNZ () {new main();}
public main()
{
  try
  {
   Class.forName("org.netezza.Driver").newInstance();
   System.out.println("h1");
   String url = "jdbc:netezza://the_host:5480/the_db";
   System.out.println("h2");
   conn = DriverManager.getConnection(url, "user", "pwd");
   System.out.println("h3");
   conn.close();
   System.out.println("connected and closed");
  }
  catch (Exception e) {e.printStackTrace();}
}
}the error message I get is
h1
h2
org.netezza.util.PSQLException: The connection attempt failed because Exception: java.net.SocketException: Socket option not supported by PlainDatagramSocketImp
The operation completed successfully.
Stack Trace:
java.net.SocketException: Socket option not supported by PlainDatagramSocketImp
The operation completed successfully.
        at sun.nio.ch.Net.setIntOption0(Native Method)
        at sun.nio.ch.Net.setIntOption(Net.java:156)
        at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:368)
        at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
        at sun.nio.ch.SocketOptsImpl$IP$TCP.noDelay(SocketOptsImpl.java:284)
        at sun.nio.ch.OptionAdaptor.setTcpNoDelay(OptionAdaptor.java:48)
        at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:258)
        at org.netezza.PG_Stream.<init>(Unknown Source)
        at org.netezza.jdbc1.AbstractJdbc1Connection.sockConstructor(Unknown Source)
        at org.netezza.jdbc1.AbstractJdbc1Connection.openConnection(Unknown Source)
        at org.netezza.Driver.getConnection(Unknown Source)
        at org.netezza.Driver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:573)
        at java.sql.DriverManager.getConnection(DriverManager.java:187)
        at nzTest.main.<init>(main.java:21)
        at nzTest.main.doConnNZ(main.java:11)
End of Stack Trace
        at org.netezza.jdbc1.AbstractJdbc1Connection.sockConstructor(Unknown Source)
        at org.netezza.jdbc1.AbstractJdbc1Connection.openConnection(Unknown Source)
        at org.netezza.Driver.getConnection(Unknown Source)
        at org.netezza.Driver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:573)
        at java.sql.DriverManager.getConnection(DriverManager.java:187)
        at nzTest.main.<init>(main.java:21)
        at nzTest.main.doConnNZ(main.java:11)My questions are: what would the java_dbms package call be to allow access to anywhere from user NZ within the oracle db?
The error message kind of seems like it is saying the NZ driver is doing something PlainDatagramSocketImp does not do. Is this what it is getting at. Is there any way to tell? and any ideas to make this work would be helpfull.
thanks
Ox 
This seems like a bug in this version. I can see that the option TCP_DELAY , a valid one, not being set. The best way would be for you to open a bug. I could do so . What needs to happen is for you to get a patch with this bug fix. This is already fixed in 11g.

Categories

Resources