Problem with persistence

Hello,
i followed this tutorial --> http://www.oracle.com/technology/obe/obe11jdev/bulldog/ejb_jpa_jsf/ejb.html
It works on my desktop.
I'd like to delploy this application on a weblogic server (other than my computer), but when I try, I have the following message :
javax.ejb.EJBException: EJB Exception: ; nested exception is:
     javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [java:/app/jdbc/jdbc/testconnectionDS].
Internal Exception: javax.naming.NameNotFoundException: While trying to look up /app/jdbc/jdbc/testconnectionDS in /app/ejb/ejb1.jar#ConfigurationEJB.; remaining name '/app/jdbc/jdbc/testconnectionDS'; nested exception is: javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [java:/app/jdbc/jdbc/testconnectionDS].
Internal Exception: javax.naming.NameNotFoundException: While trying to look up /app/jdbc/jdbc/testconnectionDS in /app/ejb/ejb1.jar#ConfigurationEJB.; remaining name '/app/jdbc/jdbc/testconnectionDS'
If I understood, I must change the persistence.xml, but what?
Thanks
Yves

Hi,
You can create a jdbc datasource on the server, using console (Services -> JDBC -> DataSources -> New....), and specify a jndi name for it, for example jdbc/MyAppDS.
Then, change the persistence.xml accordingly, something like:
<jta-data-source>jdbc/MyAppDS</jta-data-source>
<property name="javax.persistence.jtaDataSource" value="jdbc/MyAppDS"/>And, that should be it.
Pedja

Similar Messages

  • Problem with persistence in Generic Sync application

    Hi:
    We are developing an application which runson SAP Mi 2.5, SP 18,
    Windows Mobile 5.0 and Generic Sync for PDAs.
    We need persistence in our application. We tried with persistence API but
    we found a problem and we send a message to SAP. Until we can solve
    this issue we must implement persistence in other way to satisfy our customer requierements
    Since now,we have implemented persistence with files but the performance of this solution does not meet our customer requirements (the search of data in the PDA is very slow).
    We are thinking in another solution, which consists on using
    Syncbos.Using this alternative, before making a generic sync, and
    executing the code shown below:
    SmartSyncRuntime.getInstance().getSyncBoDescriptorFacade
    ().getAllSyncBoDescriptors()
    the returned syncBOS are those which I have defined in XML. On the
    contrary, after making a generic sync, executing the same code, the
    returned syncbos ARE NOT those whic I have defined in XML. The only
    return that I get is the MIAUTH.
    Any other ideas?
    Thanks
    Kind Regards

    hi satur,
    there are some things to take care if you want to use the persistence layer of the
    SmartSync layer from your GenericSync app.
    first, you have to let the MI client think that your application is using the
    SmartSync functionality. this can be achieved by just including a dummy metadata
    meRepMeta.xml file in the war archive during the deployment process. once the
    MI client framework sees this during the installation, it will set a flag on the MSD
    that your app is a smartsync.
    second, if your app is considered a smartsync, MI will generate the delta request
    and upload messages for your data if ever you have your SyncBo defined in the
    metadata. Since you don't want such functionalities to be ON, i would suggest to
    mark all your SyncBo as local ones; i.e. using attributes suppressDownload=true
    and suppressUpload=true. this way, the MI framework will skip creating the requests
    and delta upload messages for your app during the synchronization process.
    third, your application has to have the syncEventListener implementation to get
    notification when the Sync button (or event) was initiated. if you don't want your
    app to be notified, you may just add synchronization button within your application
    that will call your data manager to prepare your containers (i.e. retrieving the newly
    inserted syncbo, modified syncbos and the list of deleted ones -> genericSync
    containers) and to call the synchronizeWithBackend method.
    fourth, you need to have the inboundProcessor that will parse your data and insert
    them a SyncBo into your local database.
    having tried this but i guess it might work...
    regards
    jo

  • EJB 3.0 - problem with persistence unit.

    Hi everybody, I got this problem I would like you to help me.
    I'm doing a proyect with EJB 3.0 using Netbeans 5.5 and Jboss
    The data source is MySQL.
    When I deploy the proyect, the Jboss Log show me this:
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    State: FAILED
    Reason: javax.naming.NameNotFoundException: jdbc not bound
    I Depend On:
    jboss.jca:service=ManagedConnectionFactory,name=jdbc/connectionPool
    Depends On Me:
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3
    [Please help me, I'm kind of new in EJB]
    [ENTIRE JBOSS LOG]
    10:08:37,375 INFO [TomcatDeployer] undeploy, ctxPath=/DecmoCVLAC-war, warUrl=.../tmp/deploy/tmp16823DecmoCVLAC.ear-contents/DecmoCVLAC-war-exp.war/
    10:08:37,515 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:37,515 INFO [EARDeployer] Undeployed J2EE application: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:37,546 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:39,281 INFO [Ejb3Deployment] EJB3 deployment time took: 47
    10:08:39,296 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU with dependencies:
    10:08:39,296 INFO [JmxKernelAbstraction]      jboss.jca:name=jdbc/connectionPool,service=ManagedConnectionFactory
    10:08:39,312 WARN [ServiceController] Problem starting service persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    javax.naming.NameNotFoundException: jdbc not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:240)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:99)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy91.start(Unknown Source)
    at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:82)
    at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:626)
    at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:475)
    at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy36.start(Unknown Source)
    at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:449)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
    at org.jboss.ws.server.WebServiceDeployer.start(WebServiceDeployer.java:117)
    at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
    at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy37.start(Unknown Source)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
    at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy6.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
    10:08:39,812 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3 with dependencies:
    10:08:39,812 INFO [JmxKernelAbstraction]      persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    10:08:39,828 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3 with dependencies:
    10:08:39,828 INFO [JmxKernelAbstraction]      persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    10:08:39,859 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.4.GA/server/default/tmp/deploy/tmp16824DecmoCVLAC.ear-contents/DecmoCVLAC-ejb.jar
    10:08:39,859 INFO [TomcatDeployer] deploy, ctxPath=/DecmoCVLAC-war, warUrl=.../tmp/deploy/tmp16824DecmoCVLAC.ear-contents/DecmoCVLAC-war-exp.war/
    10:08:40,046 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.4.GA/server/default/deploy/DecmoCVLAC.ear
    10:08:40,062 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    --- MBeans waiting for other MBeans ---
    ObjectName: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    State: FAILED
    Reason: javax.naming.NameNotFoundException: jdbc not bound
    I Depend On:
    jboss.jca:service=ManagedConnectionFactory,name=jdbc/connectionPool
    Depends On Me:
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3
    ObjectName: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    State: NOTYETINSTALLED
    I Depend On:
    persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    ObjectName: jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3
    State: NOTYETINSTALLED
    I Depend On:
    persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: persistence.units:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,unitName=DecmoCVLAC-ejbPU
    State: FAILED
    Reason: javax.naming.NameNotFoundException: jdbc not bound
    I Depend On:
    jboss.jca:service=ManagedConnectionFactory,name=jdbc/connectionPool
    Depends On Me:
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=NewMessage,service=EJB3
    jboss.j2ee:ear=DecmoCVLAC.ear,jar=DecmoCVLAC-ejb.jar,name=PersonaEntityFacade,service=EJB3

    Reason: javax.naming.NameNotFoundException: jdbc not bound
    Although i am quite new to this as well i would say that there is a problem with your connection with the database.
    It seems it cannot connect to Mysql.
    have you download the mysql package library and imported it ?
    Also in your deploy folder in you Jboss
    have you altered the jdbc to connect to you database in your dataset ? ( i am not sure about mysql, but postgre reguired this)
    Most probably it would be the same in mysql.
    <connection-url>jdbc:postgresql://127.0.0.1:5432/Dissertation</connection-url>
    Not sure if this is what you reguire, i am new at this my self

  • Problem with Persistence.xml in JDev final after migration

    Hi,
    I am trying to migrate a current project from JDev 11gTp4 to the JDev production release. When deploying the EJB module I get the following problem though (Stack from DefaultServer.log)
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Nexus-NexusModel-ejb)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
         at javax.xml.parsers.DocumentBuilderFactory.setSchema(DocumentBuilderFactory.java:561)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.setupDocumentBuilderFactory(RegistryDocumentBuilder.java:393)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.getDefaultDocumentBuilderFactory(RegistryDocumentBuilder.java:359)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.getDocumentBuilder(RegistryDocumentBuilder.java:298)
         at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:150)
         at org.eclipse.persistence.platform.xml.jaxp.JAXPParser.parse(JAXPParser.java:163)
         at org.eclipse.persistence.platform.xml.jaxp.JAXPParser.parse(JAXPParser.java:197)
         at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:213)
         at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:309)
         at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsReader.read(XMLEntityMappingsReader.java:72)
         at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsReader.read(XMLEntityMappingsReader.java:112)
         at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.loadStandardMappingFiles(MetadataProcessor.java:343)
         at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.loadMappingFiles(MetadataProcessor.java:271)
         at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:294)
         at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:830)
         at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:189)
         at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:330)
         at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:245)
         at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:63)
         at weblogic.ejb.container.deployer.EJBModule.setupPersistenceUnitRegistry(EJBModule.java:209)
         at weblogic.ejb.container.deployer.EJBModule$1.execute(EJBModule.java:310)
         at weblogic.deployment.PersistenceUnitRegistryInitializer.setupPersistenceUnitRegistries(PersistenceUnitRegistryInitializer.java:62)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:376)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    My persistence.xml looks like
    <?xml version="1.0" encoding="windows-1252" ?>
    <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="Nexus-ejbPU">
    <provider>
    org.eclipse.persistence.jpa.PersistenceProvider
    </provider>
    <jta-data-source>
    jdbc/NexusPoolDS
    </jta-data-source>
    <mapping-file>
    META-INF/orm.xml
    </mapping-file>
    <properties>
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    <property name="eclipselink.logging.file" value="Toplink.log"/>
    <property name="eclipselink.logging.timestamp" value="true"/>
    <property name="eclipselink.logging.exceptions" value="true"/>
    <property name="eclipselink.logging.session" value="true"/>
    </properties>
    </persistence-unit>
    </persistence>
    orm.xml looks like this
    <?xml version="1.0" encoding="windows-1252" ?>
    <entity-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
    version="1.0"
    xmlns="http://java.sun.com/xml/ns/persistence/orm">
    <persistence-unit-metadata>
    <persistence-unit-defaults>
    <schema>
    XXX
    </schema>
    </persistence-unit-defaults>
    </persistence-unit-metadata>
    <package>
    za.co.medscheme.model.persistence.xxx
    </package>
    <schema>
    XXX
    </schema>
    </entity-mappings>
    I have noticed that the persistence.xml file have changed quite drastically from the version we had in TP4 release during project upgrade, but can not explain the problem we are getting. I have also tried to just create a dummy project and create a persistence unit, and the file looks exactly the same afterwards. Any thoughts?
    Drikus

    Just thought I would add a temporary solution to the problem for those of you sitting with the same issue.
    In the root folder of your application you will find a src folder with a meta-inf folder and weblogic-application.xml inside.
    Add the following before the closing weblogic-application tag...
    <xml>
    <parser-factory>
    <saxparser-factory>
    weblogic.xml.jaxp.WebLogicSAXParserFactory
    </saxparser-factory>
    <document-builder-factory>
    weblogic.xml.jaxp.WebLogicDocumentBuilderFactory
    </document-builder-factory>
    <transformer-factory>
    weblogic.xml.jaxp.WebLogicSAXTransformerFactory
    </transformer-factory>
    </parser-factory>
    </xml>
    If there wasnt an xml tag in the file, it seems that JDeveloper somehow adds one on the fly for you pointing to an oracle xml parser that does not contain the setSchema method required by weblogic on deployment.
    Hope this helps anybody else that has this problem.
    Regards
    Drikus Britz

  • Noob Question: Problem with Persistence in First Entity Bean

    Hey folks,
    I have started with EJB3 just recently. After reading several books on the topic I finally started programming myself. I wanted to develop a little application for getting a feeling of the technology. So what I did is to create a AppClient, which calls a Stateless Session Bean. This Stateless Bean then adds an Entity to the Database. For doing this I use Netbeans 6.5 and the integrated glassfish. The problem I am facing is, that the mapping somehow doesnt work, but I have no clue why it doesn't work. I just get an EJBException.
    I would be very thankfull if you guys could help me out of this. And don't forget this is my first ejb project - i might need a very detailed answer ... I know - noobs can be a real ....
    So here is the code of the application. I have a few methods to do some extra work there, you can ignore them, there are of no use at the moment. All that is really implemented is testConnection() and testAddCompany(). The testconnection() Methode works pretty fine, but when it comes to the testAddCompany I get into problems.
    Edit:As I found out just now, there is the possibility of Netbeans to add a Facade pattern to an Entity bean. If I use this, everythings fine and it works out to be perfect, however I am still curious, why the approach without the given classes by netbeans it doesn't work.
    public class Main {
        private EntryRemote entryPoint = null;
        public static void main(String[] args) throws NamingException {
            Main main = new Main();
            main.runApplication();
        private void runApplication()throws NamingException{
            this.getContext();
            this.testConnection();
            this.testAddCompany();
            this.testAddShipmentAddress(1);
            this.testAddBillingAddress(1);
            this.testAddEmployee(1);
            this.addBankAccount(1);
        private void getContext() throws NamingException{
            InitialContext ctx = new InitialContext();
            this.entryPoint = (EntryRemote) ctx.lookup("Entry#ejb.EntryRemote");
        private void testConnection()
            System.err.println("Can Bean Entry be reached: " + entryPoint.isAlive());
        private void testAddCompany(){
            Company company = new Company();
            company.setName("JavaFreaks");
            entryPoint.addCompany(company);
            System.err.println("JavaFreaks has been placed in the db");
        }Here is the Stateless Session Bean. I added the PersistenceContext, and its also mapped in the persistence.xml file, however here the trouble starts.
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(mappedName="Entry")
    public class EntryBean implements EntryRemote {
        @PersistenceContext(unitName="PersistenceUnit") private EntityManager manager;
        public boolean isAlive() {
            return true;
        public boolean addCompany(Company company) {
            manager.persist(company);
            return true;
        public boolean addShipmentAddress(long companyId) {
            return false;
        public boolean addBillingAddress(long companyId) {
            return false;
        public boolean addEmployee(long companyId) {
            return false;
        public boolean addBankAccount(long companyId) {
            return false;
    }That you guys and gals will have a complete overview of whats really going on, here is the Entity as well.
    package ejb;
    import java.io.Serializable;
    import javax.persistence.*;
    @Entity
    @Table(name="COMPANY")
    public class Company implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        @Column(name="COMPANY_NAME")
        private String name;
        public Long getId() {
            return id;
        public void setId(Long id) {
            this.id = id;
       public String getName() {
            return name;
        public void setName(String name) {
            this.name = name;
            System.err.println("SUCCESS:  CompanyName SET");
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (id != null ? id.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Company)) {
                return false;
            Company other = (Company) object;
            if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
                return false;
            return true;
        @Override
        public String toString() {
            return "ejb.Company[id=" + id + "]";
    }And the persistence.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/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">
      <persistence-unit name="PersistenceUnit" transaction-type="JTA">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <jta-data-source>jdbc/sample</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
          <property name="toplink.ddl-generation" value="create-tables"/>
        </properties>
      </persistence-unit>
    </persistence>And this is the error message
    08.06.2009 10:30:46 com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNUNG: ACC003: Ausnahmefehler bei Anwendung.
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
            at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
            at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
            at ejb.__EntryRemote_Remote_DynamicStub.addCompany(ejb/__EntryRemote_Remote_DynamicStub.java)I spend half the night figuring out whats wrong, however I couldnt find any solution.
    If you have any idea pls let me know
    Best regards and happy coding
    Taggert
    Edited by: Taggert_77 on Jun 8, 2009 2:27 PM

    Well I don't understand this. If Netbeans created a Stateless Session Bean as a facade then it works -and it is implemented as a CMP, not as a BMP as you suggested.
    I defenitely will try you suggestion, just for curiosity and to learn the technology, however I dont have see why BMP will work and CMP won't.
    I also don't see why a stateless bean can not be a CMP. As far as I read it should not matter. Also on the link you sent me, I can't see anything related to that.
    Maybe you can help me answering these questions.
    I hope the above lines don't sound harsh. I really appreciate your input.
    Best regards
    Taggert

  • Problem with persistence across scenes

    I have a student who has created some code- see below. At the moment this code is in Scene 5 - but the blocks also appear on other scenes.
    How does he limit this code to just one scene?
    Can he replicate this to be used on other scenes, but starting out fresh.
    Currently, 50 blocks spawn on top of one another. These are used for teaching addition or multiplication. When they've been dragged out into a pattern, we don't want that pattern on another scene, we want them on on top of the other.
    The code is not overly elegant, but it does work - except for being repeated across scenes.
    block = []
    //this function creates a block at a certain location and adds it to an array
    //new identifiers are block30 and so on
    function spawnBlock(){
      blockSpawn = attachMovie("block","block"+_root.getNextHighestDepth(),_root.getNextHighestDepth(),{_x:5 50,_y:300});
      block.push(blockSpawn._name);
    //this runs the spawnBlock funtion 50 times creating 50 new blocks
    //change 50 to the number of blocks desired
    for(i=0;i<50;i++){
      spawnBlock();
      //trace(block[i]); //testing if the funtion was working
    function dragSetup(clip){ //this is used to assign a movie clip to funtion that can be reused with each block that is created
      clip.onPress = function(){
      startDrag(this);
      clip.onRelease = clip.onReleaseOutside=function(){ //same as above
      stopDrag();
    //this lets each block that is needed to be dragged
    //add in more lines to let more blocks get dragged
    dragSetup(block0);
    dragSetup(block1);
    dragSetup(block2);
    dragSetup(block3);
    dragSetup(block4);
    dragSetup(block5);
    dragSetup(block6);
    dragSetup(block7);
    dragSetup(block8);
    dragSetup(block9);
    remainder removed for brevity.

    use:
    function clear_blockF():Void{
    for(var i:Number=block.length-1;i>=0;i--){
    this[block[i]].removeMovieClip();
    block.length=0;

  • Help me please : Serious problems with collection-mapping, list-mapping and map-mappi

    Hi everybody;
    I have serious problems with list-mapping, collection-mapping and map-mapping.
    Acording to specifications and requirements in a system I am working on it is needed to
    get a "list" of values or an indivudual value.I am working with ORACLE 9i Database,
    ORACLE 9i AS and ORACLE 9i JDEVELOPER.
    I tried to map a master-detail relationship in an entity-bean, using list-mapping.
    And this was very useful in order to get a "list" of details, ...but, when I wanted
    to get a single value I have some problems with persistence, something about "saving a state"
    despite I just want to get the value of a single detail.
    I decided to change it to map-mapping and the problem related with a single detail
    worked successfully, but I can get access to the whole bunch of details.
    May anyone of you help me with that?
    I am very confused I do not know what to do.
    Have any of you a solution for that problem?
    Thank you very much.

    Have you tried a restore in iTunes?

  • Problems with duplicate persistence units

    I suppose that Weblogic 10.3 do not support some locations of persistence.xml.
    For example. On Jboss server I can succesfully deploy ear with this structure
    -services-ejb.jar
    -services-ws.jar
    -/APP-INF/lib
    -/APP-INF/lib/services-jpa.jar with persistence.xml i META-INF
    -/META-INF/application.xml
    But on Weblogic 10.3 it is impossible. Weblogic got an error with duplicate PU in the same location...
    <2009-06-04 16:06:18 CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.management.DeploymentException:
    at weblogic.application.internal.flow.JpaFlow.prepare(JpaFlow.java:59)
    weblogic.deployment.EnvironmentException: duplicate persistence units with name servicesJPA in scope services-ear.
    First PU location: file:D:/apache/bea10.3/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/services-ear/skzpn4/APP-INF/lib/services-jpa.jar.
    Second PU location: file:D:/apache/bea10.3/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/services-ear/skzpn4/APP-INF/lib/services-jpa.jar
    My application.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
    <description>services ear</description>
    <display-name>services-ear</display-name>
    <module>
    <ejb>services-ejb.jar</ejb>
    </module>
    <module>
    <web>
    <web-uri>services-ws.war</web-uri>
    <context-root>/services-ws</context-root>
    </web>
    </module>
    <library-directory>APP-INF/lib</library-directory>
    </application>
    Is any solution to keep persistence in library directory?

    Edwin,
    I have tried the same thing that you describe in question one in the attached VI. If you change the data ranges and then run the VI, you will note that the numeric value will only ba allowed in the new range. (If the current value is outside of the range that you have set, then you will need to change the value of the cotrol to be in the new range before the new range properties will take effect.)
    As for your second question, can you expand upon this? I am not sure that I understand what you mean. Is an example VI possible? Thanks
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask
    Attachments:
    Data_Range_with_Units.vi ‏22 KB

  • Problem with non-container managed entity manager

    i am working on a project, in which i am using entity beans.i use netbeans, glassfish as application server and toplink as persistence provider .
    i created a java class that handles all the operations with the entitys, which means i using non-container managed entity manager.
    in the constructor
    try{
                EntityManagerFactory emf = Persistence.createEntityManagerFactory("voidPU");
                entityManager = emf.createEntityManager();
            catch(Exception ex){
                throw new EJBException(ex.getMessage());
            }then i call a function in this class from a servlet
    the code of the function
    List users = null;
            try {
                ProgLanguages progLanguage = entityManager.find(ProgLanguages.class, languageId);
                users = (List) progLanguage.getUserIdCollection();
            catch(IllegalStateException illegalStateException){
                throw new EJBException(illegalStateException.getMessage());
            catch(IllegalArgumentException illegalArgumentException) {
                throw new EJBException(illegalArgumentException.getMessage());
            }i got an IllegalArgumentException saying Unknown entity bean class: class vanguard.server.entity.ProgLanguages, please verify that this class has been marked with the @Entity annotation
    what confuses me is that sometimes it works and most of the time it does not work, have i made anything wrong?, or there is a problem with any of the tools netbeans, glassfish, or toplink?

    Is it always the same entity that is reported as 'unknown' ? You mention that it works sometimes but is it the same deployment and the same code that works? The first thing I would verify is that the ear is being created as expected by netbeans. Check the persistence.xml file and verify that all of the classes are listed that will be used as entities.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem with ClassCastException in web application

    Hello,
              I'm trying to deploy a web application in WLS 5.1 and I'm getting the
              "dreaded" ClassCastException every time when JSP tries to read a bean
              from the request or session. Under my architecture (actually it's just
              the regular "model 2" ) bean is populated by a servlet, set on the
              request and then retrieved by JSP (servlet forwards to JSP). Everything
              work fine when I register servlets in weblogic.properties, but
              ClassCastException is thrown on any attempt to read from the request if
              the same JSPs and servlets are deployed as web application.
              Has anybody come across the same problem?
              Thanks in advance for help.
              Alexander
              

    Hello,
              This is all well and good as a temporary bug, but it's totally unrealistic for
              the future. Two points:
              * The ClassLoader doesn't need to be discarded, it just needs to be cleared.
              * Other servlet engines seem to be able to handle this.
              Hope it's on its way to resolution!
              TDoan wrote:
              > Alexander:
              >
              > I had some problem with ClassCastException, and recently I found out what it
              > was that causing it. I'm sure if this is the same problem you are having,
              > but please read the following paragraph.
              >
              > I cutted this from http://www.weblogic.com/docs51/classdocs/API_servlet.html
              > ClassCastException and HTTP Sessions
              >
              > You might encounter a ClassCastException while developing servlets that use
              > HTTP sessions. This could happen as a result of the following set of events:
              >
              > a.. You store a reference to a custom class, myFoo, in an HTTP session.
              >
              > b.. While in mid-session, you change your servlet (or JSP or JHTML),
              > causing it to be reloaded. In fact, it is necessary for it to be reloaded by
              > a completely new class loader, and the old class loader that had previously
              > loaded it must be discarded.
              >
              > c.. Because your custom class myFoo is also located under the servlet
              > classpath, it too is reloaded by the new class loader.
              >
              > d.. Now, when you retrieve myFoo from the HTTP session, you cast it to the
              > expected type, but you recieve a ClassCastException. The exception is thrown
              > even if class myFoo has not changed. Because it has been loaded by a
              > different class loader, it is regarded by the JVM as incompatible.
              > Note: If you are using session persistence, the class contents must be
              > serialized, and you will not encounter this exception.
              >
              > Here are some suggested work-arounds to this problem:
              >
              > a.. Do not place your class myFoo in the servlet classpath. Instead, place
              > it in the system classpath or the weblogic.class.path, which are accessible
              > by WebLogic Server. The class will not be reloaded when the servlet is
              > modified. This drawback to this solution is that you cannot prototype the
              > myFoo class, because you must restart the server in order to reload the
              > class after it is modified.
              >
              > b.. If you need to prototype the class, you can write a wrapper method
              > within it to store and retrieve its contents to and from the session. You do
              > not access the class directly from the session, but instead call it is
              > wrapper methods to store or populate it is contents from the session. As
              > long as you use standard Java class types to store the class contents, they
              > will not be reloaded when the servlet is reloaded. This approach has
              > performance drawbacks because your wrapper methods would need to set or get
              > multiple name=value pairs for each class's attributes.
              >
              > c.. Another work-around is to catch the ClassCastException, and replace
              > the old class that is stored in the session with a newly instantiated class,
              > or remove it from the session. Unfortunately, you lose the session data that
              > was previously stored in the class, so you must write your application to
              > handle this scenario. This is the easiest solution to the problem-remember
              > that you should not be storing critical information in an HTTP session, but
              > rather storing it in a database.
              > Note: The ClassCastException generally occurs while you are developing
              > your servlets, and should not be an issue in a stable production system. If
              > you are upgrading your system online, you might wish to warn your customer
              > base.
              >
              > Hope it helps,
              > Tin
              >
              > "Alexander Ananiev" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hello,
              > >
              > > I'm trying to deploy a web application in WLS 5.1 and I'm getting the
              > > "dreaded" ClassCastException every time when JSP tries to read a bean
              > > from the request or session. Under my architecture (actually it's just
              > > the regular "model 2" ) bean is populated by a servlet, set on the
              > > request and then retrieved by JSP (servlet forwards to JSP). Everything
              > > work fine when I register servlets in weblogic.properties, but
              > > ClassCastException is thrown on any attempt to read from the request if
              > > the same JSPs and servlets are deployed as web application.
              > > Has anybody come across the same problem?
              > >
              > > Thanks in advance for help.
              > > Alexander
              > >
              

  • Problem with XMLEncoder for complex java object i

    Hi All.
    My problem with XMLEncoder is it doesnt transfrom java objects without default no arguement constructor. I was able to resolve this in my main java object class, by setting a new persistence delegate, but for other classes that are contained in the main class, they are not being encoded.
    Thanks in advance for your answers

    Better to put this in java forum :-)
    Just check, if this helps.
    http://forum.java.sun.com/thread.jspa?threadID=379614&messageID=1623434

  • Problem with timestamp in query

    I have problem with timestamp in JPA query.
    I wonna select all data from database where difference between two timestamps is more than 3 month.
    Database:
    ID timestamp1 timestamp2
    1 20008-11-19 15:02000 20008-08-19 15:02000
    2 20008-11-19 15:02000 20008-11-14 15:02000
    @Column(name = "timestamp1", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date timestamp1;
    @Column(name = "timestamp2", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date timestamp2;
    sql query works:
    select id from table where
    MONTH( DATE(timestamp1) - DATE(timestamp2) ) > 3
    but how I can write in Java?
    I't doesnt wrk:
    Query query = em.createQuery("SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3 ")
    error:
    ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method .
    Exception data: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter 'SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3'.
    Error message: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException: Encountered "MONTH (" at character 438, but expected: ["(", "+", "-", ".", ":", "", "=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1645)

    The error is indocating improper formatting of your JPQL string. MONTH is not understood. I would recommend using your SQL string in a createNativeQuery(...) call instead.
    Doug

  • Every time I try and update my iphone 4 to ios 7.1 in iTunes 11.1.5 it says "connection reset" even when there is no problem with my connection

    I have an iPhone 4. I use iTunes 11.1.5 on my Mac. I am trying to update to ios 7.1 through iTunes, but every time I do that, I get a "connection reset" error, even when I know there has been no problem with my connection.
    The exact error message is as follows:
    "There was a problem downloading the software for the iPhone "Anne's iPhone". The network connection was reset.
    Make sure your network settings are correct and your network connection is active, or try again later."
    I have checked several times. There is no problem with the connection, and I have tried to download the software several times today.
    Any help you can give me would be appreciated.

    Just managed to successfully download the update, having retried five or six times. I did unplug my phone while the download was taking place (had asked iTunes to download only, not to update) -- suspect this had no bearing on it whatsoever, and that persistence is the only way here.

  • Problem with 1-to-many relationship between entity beans

    Hi All!
    I have two tables TMP_GROUP and TMP_EMPLOYEE with following fields:
    TMP_GROUP: ID, CAPTION, COMMENT, STATUS.
    TMP_EMPLOYEE: ID, LOGIN, GROUP_ID.
    For this tables i create two entity beans GROUP and EMPLOYEE respectively.
    The relationship looks like this
    descriptor ejb.xml:
    <ejb-relation>
                <description>description</description>
                <ejb-relation-name>employeesOfGroup</ejb-relation-name>
                <ejb-relationship-role>
                    <ejb-relationship-role-name>com.mypackage.GroupBean</ejb-relationship-role-name>
                    <multiplicity>One</multiplicity>
                    <relationship-role-source>
                        <ejb-name>GroupBean</ejb-name>
                    </relationship-role-source>
                    <cmr-field>
                        <cmr-field-name>employees</cmr-field-name>
                        <cmr-field-type>java.util.Collection</cmr-field-type>
                    </cmr-field>
                </ejb-relationship-role>
                <ejb-relationship-role>
                    <ejb-relationship-role-name>com.mypackage.EmployeeBean</ejb-relationship-role-name>
                    <multiplicity>Many</multiplicity>
                    <relationship-role-source>
                        <ejb-name>EmployeeBean</ejb-name>
                    </relationship-role-source>
                </ejb-relationship-role>
            </ejb-relation>
    descriptor persistent.xml:
    <table-relation>
                   <table-relationship-role
                        key-type="PrimaryKey">
                        <ejb-name>GroupBean</ejb-name>
                        <cmr-field>employees</cmr-field>
                   </table-relationship-role>
                   <table-relationship-role
                        key-type="NoKey">
                        <ejb-name>EmployeeBean</ejb-name>
                        <fk-column>
                             <column-name>GROUP_ID</column-name>
                             <pk-field-name>ejb_pk</pk-field-name>
                        </fk-column>
                   </table-relationship-role>
              </table-relation>
    Now i implement business method:
    public Long addEmployee(String login, long groupId) {
              Long result;
              try {
                   EmployeeLocal employee = employeeHome.create(login);
                   GroupLocal group =
                        groupHome.findByPrimaryKey(new Long(groupId));
                   Collection employees = group.getEmployees();
                   employees.add(employee);
                   result = (Long) employee.getPrimaryKey();
              } catch (CreateException ex) {
                   result = new Long(0);
              } catch (FinderException ex) {
                   result = new Long(0);
              return result;
    When i call this method from web service, the following exception is raised:
    com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception in method com.mypackage.GroupLocalHomeImpl0.findByPrimaryKey(java.lang.Object).
    P.S.
    1) I have transaction attribute set to "Required" for all methods of all beans
    2) I have unique index for each table:
    TMP_GROUP_I1: CAPTION
    TMP_EMPLOYEE_I1: LOGIN (however i think GROUP_ID must be added here too)
    3) I tried many:many relationship with this tables and it works fine
    4) I try another implementation of addEmployee method with
    EmployeeLocal employee = employeeHome.create(login, groupId);
    without using GroupLocal cmr-field and GroupLocalHome findByPrimaryKey method, the result is same error.
    Can somebody help me with this problem?
    Thanks in advance.
    Best regards, Abramov Andrey.

    gimbal2 wrote:
    1: The @JoinColumn on the listOfDepartments collection in Company is wrong. It should be something like this for a bidirectional relationship:
    @OneToMany(mappedBy="company") // company is the matching property name in Department
    private List <Department> listOfDepartment = new ArrayList<Department>();Note that I removed the fetch configuration; onetomany is fetched lazy by design. Saves some clutter eh.
    2: use a Set in stead of a List (hibernate doesn't like lists much in entities and will break when you create slightly more complex entity relations)
    3: don't just slap cascades on collections, especially of type ALL. Do it with care. In the many years I've been using JPA I've only had to cascade deletes in very specific situations, maybe once or twice. I never needed any of the other cascade types, they just invite sloppy code if you ask me. When working with persistence you should apply a little precision.I made all changes as you mentioned but still compID in department table shows null value...

  • Lots of problems with newer MacBook Pro

    I bought my first Mac about a year and a half ago. Unfortunately I've had lots of problems with it. I need to get it repaired, but I'm not sure what's wrong. I live in Thailand so I want to have some idea of what's going on before taking it to a shop (so they don't try to price gouge me).
    The first problem happened about 9 months after i bought it. The computer would become incredibly slow. Sometimes it would take 15 minutes to boot up and sometimes it wouldn't boot up at all. But sometimes it was fine. If it did boot up, sometimes when I'd go into a folder in Finder, nothing would show up. The spinning loader graphic would just spin at the bottom of the Finder window. I ran a disk check and it said it found multiple errors that could not be fixed. I erased the hard drive and reinstalled Lion and everything seemed fine. Since I live in Thailand and I need my computer for work, I didn't want to ship it off to Apple to be fixed. It seemed fine after formatting the hard drive, so I figured it was fixed.
    About 3 months later the problem came back, but much worse. I couldn't boot up or anything. I took it to a small Mac repair shop because at this point the 1 year warranty had expired. Of course inside the shop it booted up fine and I had to explain to the guy that for 5 days I haven't even been able to turn it on. Finally after restarting 4 times it began slowing down and he could see what I was experiencing. He said he could try replacing the hard drive, but couldn't guarantee it would fix it. I needed my computer badly at this point so I said let's try. I came back a couple days later and he had transferred everything to the new hard drive and installed it. Everything seemed to be working fine.
    That worked, although sometimes (rarely) something weird would happen, like the computer would just shut down for no reason. But, the DVD drive stopped working. It loads a disc OK, but it can't read it and won't burn a DVD. One time it wouldn't eject my DVD for about 30 minutes. I was trying everything I could find on Google. Finally it spit it out.
    Now, about 6 months later, I was watching a movie and about 10 small colored boxes popped up on the screen. They went away after a few seconds, so I closed my movie and went to shut down my computer. The entire screen then filled with horizontal rainbow colored static. It stayed for about 30 seconds, then the screen turned grey. I could hear and feel the fans blowing at full speed.
    And then for about a full day it went away, until earlier today. As I was backing up all my files I played a quick part of a movie. The same squares popped up on the screen so I immediately closed the movie and they went away.
    I finished backing up and then erased the hard disk. I started installing Mountain Lion, and it stopped at about 75%. I canceled the installer and restarted. After a few seconds the screen turned solid blue with white staticky lines. And now that happens every time I turn on the computer after about 30 seconds. There's no operating system because before I can even get to the installer before the screen goes.
    Sorry for the huge amount of info. I just don't have enough experience with Macs to know what's going on. My current issue resembles a video card problem, the issues before resemble a hard drive and DVD drive issue. Replacing the hard drive fixed it temporarily. Could a problem with the logic board cause all of these issues?
    Thanks for any help with this.

    A few things to note...
    If you had contacted Apple about each of the issues that you reported here, they would  have kept a log of the problems that would help them determine whether to continue support after the warranty expires.
    You might consider asking about "Flat Rate Repair Pricing." See the discussion thread here and note that some users report that the flat rate repair pricing is only available in the U.S. and Japan.
    gavin310 wrote:
    (typically they just ship your computer to Singapore instead of working on it "in-house" from what I read).
    Actually, I had great  experiences with two different macs sent to the repair depot. One computer had narcolepsy on day one. Apple sent me a box, I packed up the PB and dropped it off at UPS. Apple fixed and returned to my house two days later. The second MBP had a known video card problem. I took it to an Apple Store Genius who ran a specifc test and deduct that it was the known defective video card. The store was out of parts and ordering would take a week. Knowing my past experience with the Repair Depot, I ask for that option. The genius took my MBP and shipped it to the depot that night. Three days later, I received the fixed MBP and on the work order, their tests showed failed fans that they also replaced. Three or four weeks later, the Apple Store called to tell me they got the video card in stock.
    Gather up your grit, perseverance, and persistence before contacting Apple. Try bypassing phone support by contacting them via their online support system with the link I provided in the previous post. (I remember using the online support system and was able to choose to have them call me. At the time, I had AppleCare so i'm not certain with out-of-warranty.) Another option is to seek an authorized Apple service provider.
    Good Luck!

Maybe you are looking for

  • How to print of a crystal output on paper through process Scheduler in PeopleSoft.

    Post Author: rajaumareddy CA Forum: Charts and Graphs while printing crystal through process scheduler in PeopleSoft it giving Error as Runstatus. and i given in Printer destination. Could u help me to find solution. 1. what are process scheduler set

  • Why did my entire screen get overtaken by a swirly rainbow?

    I believe my computer was in sleep mode when this happened: I saw the entire screen covered by what looked like either a crazy rainbow or a piece of brightly colored modern abstract art -- large arcs or swirls of oranges, yellows, etc. After a few se

  • SECess is calculating wrongly

    Hi All, I am facing the problem with SECess.  We are using TAXINJ. In MIGO when I change the Base Value in Excise Item Details, only SECess is getting calculated wrongly. Suppose Base Value = 10000 which I change to 12000 for Base Value=10000, BED=10

  • FM to find whether employee was on outdoor duty on a day

    Dear experts, is there any FM that could return whether for a given day the employee was on an outdoor duty? Also can the number of days for the same be obtained? Regards and New year wishes! Sumit Nene.

  • Triggering of workflow

    In CRM2007  lead creation, if status of lead is E0006 for 2 days then the workflow should trigger to the respective activity partner   i will provide details statussince : 09- 02- 2009,(this field contains created date) userstatus : E0006, if this us