SAPUI5 Project - Missing persistence.xml

Hi,
I have created a simple SAPUI5 application having an Employee form. The values should be saved in the HANA DB. As there are multiple ways to save the data in HANA, I am exploring the JPA based approach.
I am following the Container-Managed Persistence Example and able to create the project. Instead of Dynamic Web project, I have created SAPUI5 project and also changed the project facets as mentioned in the tutorial.
Now the problem is that I am not able to deploy the project on SAP HCP. It is giving me following error -
2014 09 04 07:45:24#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##Unable to load Persistence Unit from EAR: /usr/sap/ljs/webapps/jadyn, module: file:/usr/sap/ljs/webapps/jadyn/WEB-INF/classes/. Exception: unexpected element (uri:"http://xmlns.jcp.org/xml/ns/persistence", local:"persistence"). Expected elements are <{http://java.sun.com/xml/ns/persistence}persistence>javax.xml.bind.UnmarshalException: unexpected element (uri:"http://xmlns.jcp.org/xml/ns/persistence", local:"persistence"). Expected elements are <{http://java.sun.com/xml/ns/persistence}persistence>
  at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:647)....
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##FAIL ... EmpBean:
Missing required persistence.xml for @PersistenceContext ref "em" to unit ""|
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##Invalid EjbModule(name=jadyn, path=/usr/sap/ljs/webapps/jadyn)|
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##FAIL ... jadyn:
Missing required persistence.xml for @PersistenceContext ref "em" to unit ""|
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##Invalid WebModule(name=jadyn, path=/usr/sap/ljs/webapps/jadyn)|
2014 09 04 07:45:27#+00#ERROR#org.eclipse.virgo.web.enterprise.openejb.deployer.VirgoDeployerEjb##anonymous#fs-watcher##p137653trial#jadyn#web##Error while deploying application with real path '/usr/sap/ljs/webapps/jadyn' and web context path '/jadyn'org.apache.openejb.config.ValidationFailedException: Module failed validation. AppModule(name=jadyn)
Anyone has any idea on what wrong I am doing.  Please check the attached error log for more details. Thanks!
Regards
Abhi

Actually yes - please get familiar with The SCN Rules of Engagement! In particular, don't push if you haven't received an answer after 3 hours or so.
Now, I am not sure how a UI5 project is exported and what it packages but I would recommend using a Dynamic Web project which is intended for Java web development and supports JPA. You can also have your HTML and JS static resources in it.
Cheers,
--Vlado

Similar Messages

  • Persistence.xml under classes/META-INF makes other jar references to miss

    Hi,
    When I am adding persistence.xml to classes/META-INF folder where classes folder got other packages under it, classes in such packages are not getting reference to respective jar files in lib folder. So, deployment of the web project in OAS (Oracle application server) 10g fails mentioning NoClassDef found for classes from library jars referred. If I remove persistence.xml from here, the war file is getting deployed. Deployment fails even when the persistence.xml is available anywhere in classpath (like WEB-INF).
    What is the reason & how to correct it?Any alternative approach like manifest or use some settings in OAS?

    Hi,
    To be accessible to the EJB JAR, WAR, or EAR file, a class or a JAR file must be on the deployment classpath. You can achieve this in one of the following ways:
    Put the JAR file in the manifest classpath of the EJB JAR or WAR file. Do this by adding a classpath entry to the META-INF/MANIFEST.MF file in the JAR or WAR file. You may specify one or more directories or JAR files, separating them by spaces. The following example shows how the manifest file classpath entry adds the employee/emp-classes.jar file and the employee/classes directory to the classpath of the JAR file that contains the manifest file:
    Class-Path: employee/emp-classes.jar employee/classes
    Place the JAR file in the library directory of the EAR filethis will make this JAR file available on the application classpath and accessible by all of the modules deployed within the EAR file. By default, this would be the lib directory of the EAR file, although you may configure it to be any directory in the EAR file using the library-directory element in the application.xml deployment descriptor. The following example shows the application.xml file:
    <application ...>
    <library-directory>myDir/jars</library-directory>
    </application>
    Java EE allows for persistence support in a variety of packaging configurations. You can deploy your application to the following module types:
    EJB modules: you can package your entities in an EJB JAR. When defining a persistence unit in an EJB JAR, the persistence.xml file is not optionalyou must create and place it in the META-INF directory of the JAR alongside the deployment descriptor, if it exists.
    Web modules: you can use WAR file to package your entities. In this case, place the persistence.xml file in the WEB-INF/classes/META-INF directory. Since the WEB-INF/classes directory is automatically on the classpath of the WAR, specify the mapping file relative to that directory.
    Persistence archives: a persistence archive is a JAR that contains a persistence.xml file in its META-INF directory and the managed classes for the persistence unit defined by the persistence.xml file. Use a persistence archive if you want to allow multiple components in different Java EE modules to share or access a persistence unit. The following example shows how to package entities in a persistence archive:
    emp.ear
    emp-persitence.jar
    META-INF/persistence.xml
    META-INF/orm.xml
    examples/model/Employee.class
    examples/model/Phone.class
    examples/model/Address.class
    examples/model/Department.class
    examples/model/Project.class
    Once you created a persistence archive, you can place it in either the root or the application library directory of the EAR. Alternatively, you can place the persistence archive in the WEB-INF/lib directory of a WAR. This will make the persistence unit accessible only to the classes inside the WAR, but it enables the decoupling of the definition of the persistence unit from the web archive itself.
    Regards,
    Vinay

  • 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

  • Group Tree: Error in Ajax response - message: missing } in XML expression

    Hi,
    We were using a previous version of Crystal libs and viewer. I wanted to get up to date with the latest jars and viewer so I downloaded and installed the version with Eclipse 3.4.1 and crystal development bundled together.
    I've copied the new jars from there into my existing project. I've also copied the folder cyrstalreportviewers into the project. We're using Tomcat 6.
    I've now got a problem with the Group Tree at the moment since I started using the latest libraries and crystal report viewers.
    My web.xml looks like this.
            <context-param>
              <param-name>crystal_image_uri</param-name>
              <param-value>/crystalreportviewers</param-value>
         </context-param>
         <context-param>
              <param-name>crystal_image_use_relative</param-name>
              <param-value>webapp</param-value>
         </context-param>
            <servlet id="CrystalReportViewerServlet">
              <servlet-name>CrystalReportViewerServlet</servlet-name>
              <display-name>CrystalReportViewerServlet</display-name>
              <servlet-class>
                   web.servlet.ReportingViewerServlet
              </servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
           <servlet-mapping id="CrystalReportViewerServletMapping">
              <servlet-name>CrystalReportViewerServlet</servlet-name>
              <url-pattern>/CrystalReportViewerHandler</url-pattern>
         </servlet-mapping>
    A request to the uri https://......../WebApp/CrystalReportViewerHandler?id=3
    The servlet doesn't do anything that seems to be uncommon. I can post more precisely what it does if needed.
    The report will load correctly, I don't get an error page asking if my crystalreportviewers/ path is accessable to the server.
    I get a parameter page asking for a value. I enter that and click OK.
    The viewer sends a POST request to my Servlet and is handled correctly.
    The report is then loaded.
    On the click of an item in the Group Tree it sends an Ajax POST request and I then get the following error:
    message: missing } in XML expression
    fileName: https://localhost:8080/WebApp/crystalreportviewers/allInOne.js
    lineNumber: 10
    stack: ()@:0
    eval("(\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n)")@:0
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object Object],[object Object],[object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:12
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ()@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object Object],[object Event])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object Event])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    name: SyntaxError
    Clicking on the Groups headers on the right hand pane work as expected. Although I notice they are not Ajax requests.
    I've spent a few days at this now and I feel like I'm running out of options but to revert back to the previous version we were using. I presume this works elsewhere so I've got to be doing something incorrectly with my setup.
    If anyone needs more info then please ask.
    Thanks,
    Patrick

    Hi Ted,
    Thanks for your reply.
    That's our own Servlet. It extends javax.servlet.http.HttpServlet
    doGet does the following stuff:
    Creates a ReportClientDocument.
    Sets the ReportAppServer to "inproc:jrc".
    Opens the report as read only.
    Gets the DBController and calls logon on it.
    Then calls replaceConnection.
    Adds some discrete param values.
    Creates a CrystalReportViewer.
    gets the report source from the report client document.
    sets the report source on the crystal report viewer.
    set own page to true.
    sets the report source in the session.
    The crystal Report Viewer then processes the Http Request.
    doPost:
    gets the report source from the session.
    creates a CrystalReportViewer.
    sets the report source on the crystal report viewer.
    set own page to true.
    The crystal Report Viewer then processes the Http Request.
    One thing I changed in there was the way the data source was changed. It used to loop through tables.
    Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
    newTable.setQualifiedName(qualifiedName);
    clientDoc.getDatabaseController().setTableLocation(origTable, newTable);
    Now it does this:
    DatabaseController dbController = clientDoc.getDatabaseController();
    dbController.logon(username, password);
    dbController.replaceConnection(new ConnectionInfo(), connectionInfo, null, DBOptions._useDefault);
    If you need more info please do let me know. Thanks for your help.
    Patrick

  • Share persistence.xml file between two EJB modules in EAR

    Hello, everybody!
    First of all, I would like to say that I already posted this question in another forum:
    [http://community.jboss.org/thread/154128?tstart=0]
    But as I haven't got any answer from there and this issue is very crucial to me I'm posting it here too in the hope that I get an answer. So, here it goes:
    I have two EJB modules in an EAR module. I would like to know how to share a single persistence.xml file with these two EJB modules. If I replicate the persistence.xml file in the two EJB modules, the EAR project deploys ok, but of course that's not what we want. If I remove the persistence.xml file from any of the EJB projects, the EAR doesn't deploy properly. I'm stuck with this. I've already tried many kind of configurations but none worked. I really would like to have some help with this issue to proceed working. This is my EAR structure:
    solicitacoes-ejb.jar       (EJB session beans)
    solicitacoes-dao.jar       (EJB interfaces)
    solicitacoes-dao-jpa.jar   (EJB session beans)
    solicitacoes-ejbClient.jar (entities and EJB interfaces)
    solicitacoes-web.war
    META-INF/This is my application.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <application
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
    version="5">
        <display-name>solicitacoes-ear</display-name>
        <module>
            <ejb>solicitacoes-ejb.jar</ejb>
        </module>
        <module>
            <ejb>solicitacoes-dao-jpa.jar</ejb>
        </module>
        <module>
            <web>
                <web-uri>solicitacoes-web.war</web-uri>
                <context-root>solicitacoes</context-root>
            </web>
        </module>
    </application>If I remove the persistence.xml file from one of the EJB modules, let's say solicitacoes-dao-jpa.jar, I get this error when deploying the EAR file:
    ... 39 more
    Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'null' in AbstractVFSDeploymentContext@28359170{vfs:///C:/jboss-6.0.0.20100429-M3/server/default/deploy/solicitacoes-ear.ear/solicitacoes-dao-jpa.jar/}
    at org.jboss.jpa.resolvers.BasePersistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(BasePersistenceUnitDependencyResolver.java:107) [:1.0.2-alpha-1]
    at org.jboss.ejb3.Ejb3Deployment.resolvePersistenceUnitSupplier(Ejb3Deployment.java:778) [:1.3.1]
    at org.jboss.ejb3.EJBContainer.resolvePersistenceUnitSupplier(EJBContainer.java:1517) [:1.3.1]
    at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:130) [:1.3.1]
    ... 43 moreI need help with this issue. As you could see, the EJB container doesn't like to see an EJB module without a persistence.xml file. This is clearly a dumb decision though. I agree with it if there was only one EJB module in an EAR. But the container should have been smart enough to require only one persistence.xml file in an EAR module with more than one EJB module, and share that persistece context with the whole EAR.
    Acting the way it is acting now, the container forces us to duplicate the persistece.xml file and kill our application modularity. This is clearly wrong. I've already tried to put the entity classes and persistence.xml file in the lib directory of the EAR, but it didn't work either. The container needs to have the persistence.xml file in both EJB modules.
    I don't know if this is a JBoss implementation decision or if it comes from the Java EE 6 specification. Whatever it is, it goes against all good modular and good design decision. Please if some of you know how to solve this, took a little time to tell me how. I would be very grateful.
    Thank you in advance.
    Marcos

    Dear Mr. gimbal2,
    In another occasion I would not reply to such a 'helpful' answer like the one you gave me (yes, it is undoubtedly an answer because that's how you classified it in the beginning of your reply), but as today I have plenty of time here in my job, for this week we're not working full time as usual, I decided to reply to it.
    You have to completely overhaul your attitude.I really didn't know I was taking so personal on this issue to have to 'completely overhaul my attitude'. Thank you for pointing that out.
    In stead of calling the technology dumb, admit to yourself that perhaps you don't understand it properly and that your ideas of what is correct design perhaps is a little lacking. I didn't call the technology dumb because I stated very clearly that I don't know for sure if it is working this way. I said in the last paragraph:
    +"I don't know if this is a JBoss implementation decision or if it comes from the Java EE 6 specification. Whatever it is, it goes against all good modular and good design decision."+
    So, I let implicit the fact that the technology or the implementation of the technology is dumb only if it doesn't allow this possibility. Regarding the fact that your said that I should
    admit to myself that perhaps I don't understand it properly, where did I stated in my question that I understand it completely? It's clear in the last paragraph that I don't. If I'm asking that's because I have doubts. Maybe my ideas of what is correct is wrong, and that's why I'm here in this forum. But everyone with a good sense knows that what I propose in this discussion is by no means a wrong design decision. Where is it a sin to have more than one EJB module in a EAR and a persisntece.xml file shared for the whole EAR? Does everyone that has more than one EJB module in an EAR module need to connect to more than one database? Is it wrong to want to have your DAO implementation in a separate EJB module in order to make deployment easy and also changes, if you later want to replace that implementation with another one without affecting
    the other modules? I don't think that a design decision that seeks this is lacking. I don't think that Java EE today is a dumb technoloby, but everyone knows that before it gets to the present level, it was a technology known to have made big dumb decisions that the community latter corrected, with ideas like O/R mapping (Hibernate), dependency injection (Spring), Struts and lots of other examples that we all know. No one can deny this and lots of wrong things will continue to be fixed in later releases.
    Maybe when you rise yourself back to that level, you open yourself up again to thinking in correct solutions in stead of trying to hammer through your own poorly chosen one.To be sincere, I see you took very personal about this issue. You really shows to be someone that has no respect to other people and you judge them too. I must say that I got surprised by the way you answered my post. I didn't expect to get such sarcastic answer to what I asked. I personally don't act this way. If I can't help a person, I also don't try to ridicularize him.
    Marcos

  • JPA - the container - persistence.xml file

    Hi,
    I'm just starting out with JPA so these are basic questions.
    Firstly, this is what I've done:
    1) Created JPA entities from tables
    2) I've used JDeveloper to create a Java Service Facade using the wizards.
    3) Created a persistence unit and added the JPA entities to this.
    The resulting persistence.xml is in a project with only JPA stuff in it (in META-INF).
    The project which is run (some EJB 2.0 session beans and message driven beans, all specified in the ejb-jar.xml) has the JPA's projects classpath on its classpath.
    The JPA code itself accesses the entity manager programatically i.e. it does not make use of any J2EE container services.
    My question is:
    Are my JPA entities fully fledged EJB 3.0 entities i.e. are they being managed by the container? I'm accessing the JPA entities in a J2SE way, they just happen to be running within a J2EE container.

    Are my JPA entities fully fledged EJB 3.0 entities
    i.e. are they being managed by the container? I'm
    accessing the JPA entities in a J2SE way, they just
    happen to be running within a J2EE container.The meaning of "managed" for Entities has changed from EJB 2 to 3. In JPA, Entities are managed by a Persistence Provider and not by the container per se. This is why you can have a managed Entity in a Java SE environment.
    But to answer your question, yes your classes are full fledged JPA Entities if read through, merged, or persisted with an EntityManager. You can find out more about the JPA definition of "managed" in section 3.2 of the JPA Spec.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Persistence.xml in Hybrid Flex-Java

    Hi all,
    I've started working on a Hybrid project of Flex-Java using a new setup that is available since Flex Builder 3 Final. It creates 1 project that will hold a flex_src folder, java_src folder and WebContent folder where the compiled files will go to using an internal Eclipse Tomcat server.
    Now I want to use persistence.xml for hibernate. But I can't figure out where to place this file inside this project? Is there someone here who does know? Thanks a lot in advance.
    Cheers,
    Rick

    Create a META-INF subdirectory of src and place it in there. This will then be deployed in the resulting WAR file to <appbase>/WEB-INF/classes/META-INF/persistence.xml which is where it needs to end up.

  • Frameworks/projects/framework/build.xml

    This file is missing from the distribution. Was that a mistake or on purpose?
    A few other files are missing too I've noticed.
    One cannot build the source without these files.

    The build.xml that is meant for the "customers" to use to rebuild a swc is in sdk/frameworks.  The individual build.xml that might be in the source tree is used for building the SDK itself.<br /><br />Matt<br /><br /><br />On 5/22/08 7:07 PM, "Chris Hinkle" <[email protected]> wrote:<br /><br />A new discussion was started by Chris Hinkle in<br /><br />Developers --<br />  frameworks/projects/framework/build.xml<br /><br />This file is missing from the distribution.  Was that a mistake or on purpose?<br /><br />A few other files are missing too I've noticed.<br /><br />One cannot build the source without these files.<br /><br />________________________________<br />View/reply at frameworks/projects/framework/build.xml <a href=http://www.adobeforums.com/webx?13@@.59b5557e><a href=http://www.adobeforums.com/webx?13@@.59b5557e><br />Replies by email are OK.<br />Use the unsubscribe <a href=http://www.adobeforums.com/webx?280@@.59b5557e!folder=.3c060fa3><a href=http://www.adobeforums.com/webx?280@@.59b5557e!folder=.3c060fa3>  form to cancel your email subscription.

  • Configure the persistence.xml file

    Hi experts,
    i want to develop a little JPA-Project in the NWDS 7.3. It was no problem to create entities but i dont know how to configure the persistence.xml-flie to get a connection to the database.? I use an Oracle database.
    Thanks in advance

    I solved the problem. I had no database connection.
    Edited by: jtrebess on Oct 13, 2011 9:28 AM

  • Classnot found exception- persistence.xml

    While Executing Unit test from Eclipse itself, Keep getting exception saying......Unable to load entity class, it's not on the classpath, check your persistence.xml
    if anyone have some clue on that?
    Entity classes are in some different project in eclipse & have added those Entities jars in My classpath.

    Nicky26 wrote:
    While Executing Unit test from Eclipse itself, Keep getting exception saying......Unable to load entity class, it's not on the classpath, check your persistence.xml
    if anyone have some clue on that?
    Entity classes are in some different project in eclipse & have added those Entities jars in My classpath.Java does not agree with you and Java is the boss.
    A thought: perhaps the wrong persistence.xml is loaded? In other words, do you have multiple persistence.xml files on the classpath?

  • Issue while saving the project plans into XML

    Hi,
    Could anyone of you please help me here.
    We are having one custom field(Type: Text) in the project level(Custom field name: ProjectComments) and end users are entering the data against this custom field more than 200 characters.
    The problem here is when we are saving the project plans into XML and opening the same file again thorugh MPP, the data for this custom field(ProjectComments)  is showing till 129 Characters only. Seems to be the data is truncating till 129 charachers.
    Could anyone suggest me how to resolve this issue without trucnating the characters in the custom fields.
    Thanks in advance!
    Regards,
    Venkat

    Hi,
    I cannot reproduce this issue with Project Pro 2010 SP2. Which SP do you have? How is configured your custom field?
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, MCP |

  • Override JNDI names in persistence.xml and @resource annotation

    I have a Java EE 7 application that I am developing for use with both GlassFish and WildFly, but I have discovered that both application servers use a slightly different format for specifying JNDI names.
    In GlassFish the persistence.xml file references the data source jdbc/myDataSouce, but in WildFly the data source needs to be java:/jdbc/myDataSource.The same is also true for classes that are annotated with @Resource. In GlassFish the annotation for a class using JavaMail would be @Resource(name = "mail/myMailSession"), but to deploy onto WildFly this would need to be @Resource(name = "java:mail/myMailSession").
    The only solution I've got at present is using Maven to create two different releases of the EAR file, with one EAR file containing a persistence.xml file with the data source jdbc/myDataSouce for use with GlassFish, and the second EAR file containing a persistence.xml file with the data source java:/jdbc/myDataSource for use with WildFly. Unfortunately, I haven't found a solution for the @Resource annotation.
    I've taken a look at the documentation for glassfish-application.xml and glassfish-ejb-jar.xml and have tried using resource-ref to override the JNDI names but the application fails to deploy due to an error in the name.
    My question is does GlassFish provide any capability to override the JNDI names specified in the persistence.xml file and classes with the @resource annotation?
    Many Thanks
    Paul

    Have you been able to solve this? I'm attempting to understand what Web Server 7 can do with regard to Java Persistence and what elements of it require Glassfish.
    I've also spent great amounts of time in WS6.1 trying to figure out why a JNDI resource couldn't be found. The rules of thumb I've learned are:
    - Try dropping the *'java:/comp/env/* prefix; just use jdbc/pact part
    - Make sure all referrences (in web.xml and sun-web.xml) are identical with regard to that name.
    I'm hoping you're not still dealing with this (it's been two months!) but if anybody else stumbles on this, maybe it'll help them.
    Dave

  • Problems with deploy on OC4J 10.1.3.2 with hibernate persistence.xml

    Hi all,
    I can't deploy an EAR/WAR into oc4j 10.3.2.0 stand-alone, I have the following error message :
    2008-03-26 19:50:38.721 NOTIFICATION Binding opsky-webapp-1.0-SNAPSHOT web-module for application opsky to site default-web-site under context root /opsky
    08/03/26 19:50:38 oracle.oc4j.admin.internal.DeployerException: [opsky:opsky-webapp-1.0-SNAPSHOT] - Exception creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersistence for persistence unit ApplicationEntityManager.
    08/03/26 19:50:38 at com.evermind.server.ejb.exception.DeploymentException.exceptionCreatingEntityManagerFactory(DeploymentException.java:130)
    08/03/26 19:50:38 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:197)
    08/03/26 19:50:38 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initializePersistenceUnit(PersistenceUnitManagerImpl.java:159)
    08/03/26 19:50:38 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize(PersistenceUnitManagerImpl.java:86)
    08/03/26 19:50:38 at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:733)
    08/03/26 19:50:38 at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)
    08/03/26 19:50:38 at com.evermind.server.Application.getHttpApplication(Application.java:571)
    08/03/26 19:50:38 at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1990)
    08/03/26 19:50:38 at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1909)
    08/03/26 19:50:38 at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1606)
    08/03/26 19:50:38 at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:238)
    08/03/26 19:50:38 at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)
    08/03/26 19:50:38 at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)
    08/03/26 19:50:38 at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)
    08/03/26 19:50:38 at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
    08/03/26 19:50:38 at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
    08/03/26 19:50:38 at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
    08/03/26 19:50:38 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
    08/03/26 19:50:38 at java.lang.Thread.run(Thread.java:619)
    2008-03-26 19:50:38.987 NOTIFICATION Application Deployer for opsky FAILED.
    2008-03-26 19:50:38.987 NOTIFICATION Application UnDeployer for opsky STARTS.
    I'm using hibernate 3 with spring, here is my persistence.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
    <persistence-unit name="ApplicationEntityManager" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>org.appfuse.model.User</class>
    <class>org.appfuse.model.Role</class>
    </persistence-unit>
    </persistence>
    Does enyone know anything about this issue?

    Hi,
    It would be helpful if you copied and pasted the error messages you get.
    For what its worth, it probably isn't a bug, just a configuration problem. You may need to alter more than your application.xml file.
    If you developed the EJBs with JDeveloper, you can create a deployment descriptor that adds the necessary configuration files for the OAS platform, and package them into a WAR or EAR. Use Enterprise Manager to deploy the WAR/EAR to the OAS OC4J and everything will be placed where its needed.
    More info in the JDeveloper and OAS 10.1.3 documentation.
    Jim

  • Multiple PUs in a single persistence.xml

    Hi,
    I'm trying to define two different PUs for a standalone and Java EE environments, so a single persistence.xml could be used.
    Here goes 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="derbyPU" transaction-type="RESOURCE_LOCAL">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
        <class>pl.jaceklaskowski.jsf.tomahawk.entities.Pracownik</class>
        <properties>
          <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver" />
          <property name="openjpa.ConnectionURL" value="jdbc:derby:target/derbyDB;create=true" />
          <property name="openjpa.ConnectionUserName" value="app" />
          <property name="openjpa.ConnectionPassword" value="app" />
          <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
          <property name="openjpa.Log" value="DefaultLevel=WARN,SQL=TRACE" />
        </properties>
      </persistence-unit>
      <persistence-unit name="Kadry">
        <jta-data-source>jdbc/derby</jta-data-source>
        <class>pl.jaceklaskowski.jsf.tomahawk.entities.Pracownik</class>
      </persistence-unit>
    </persistence>and here goes the managed bean of a JSF application I'm developing.
    package pl.jaceklaskowski.jsf.tomahawk;
    import java.util.List;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    public class Pracownicy {
        @PersistenceContext(name="Kadry")
        EntityManager em;
        DataModel pracownicy = new ListDataModel();
        public DataModel getLista() {
            List resultList = em.createQuery("SELECT p FROM Pracownik p ORDER BY p.lastName").getResultList();;
            pracownicy.setWrappedData(resultList);
            return pracownicy;
    }When I run it on GF v2b36 I'm getting the following exception:
    com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error -- Could not resolve a persistence unit corresponding to the persistence-context-ref-name [Kadry] in the scope of the module called [C:\projs\myfaces-tomahawk\target\myfaces-tomahawk]. Please verify your application.
            at com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPCRefs(BundleDescriptor.java:689)
            at com.sun.enterprise.deployment.WebBundleDescriptor.findReferencedPUs(WebBundleDescriptor.java:709)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.getAllPersistenceUnitDescriptors(PersistenceProcessor.java:158)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:119)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:198)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:159)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109)
            at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66)
            at com.sun.enterprise.deployment.backend.ModuleDeployer.handlePostDeployEvent(ModuleDeployer.java:618)
            at com.sun.enterprise.deployment.backend.ModuleDeployer.postDeploy(ModuleDeployer.java:607)
            at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:172)
            at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:174)
            at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
            at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:892)
            at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
            at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:761)
            at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
            at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)I double-checked that the jar with the Kadry PU is in WEB-INF/lib directory of the web application.
    Does anyone have any idea what might be wrong?
    Jacek
    Jacek Laskowski
    http://www.jaceklaskowski.pl

    Hi Jacek,
    The attribute you should set is unitName(), not name(). name() defines the location of the
    @PersistenceContext dependency within the component environment (java:comp/env). It
    is independent of the dependency type and appears on all Java EE environment annotations :
    @EJB, @Resource, etc.
    unitName() specifies the name of the associated persistence unit. If there is only one defined it's
    not needed. However, in your case there are two so since it's not specified there isn't enough
    information to resolve the correct one.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • After migrating to new Mac Pro Dreamweaver won't launch, says missing menus.xml file. How do I resolve this?

    After migration to a new Mac Pro Dreamweaver CS6 won't launch. It says it is missing menus.xml file. How do I resolve this?

    Hi rustyg12,
    Go to Applications/Adobe Dreamweaver CS6/Configuration/Menus/menus.bak
    You'll see a menus.xml there - it is a backup copy of the actual menus.xml file that DW uses.
    Copy it from that folder, paste it 1 level above (in Menus folder).
    Fire up DW. See if it works.

Maybe you are looking for

  • Booting ubuntu 13.04 on HP ENVY H9 1355 tower

    So I've been trying to replace the ridiculous windows 8 OS from my new-ish HP Envy tower, and have encountered nothing but headaches.  From what I've read, its an issue with "secure boot keys" that microsoft would have to issue a software vendor for

  • I can't not use face time it's said not available

    i can't not use face time on macbook it's said not available

  • FI-FM : BAPI/RFC for Funds reservation Creation ?

    Hi, I was asked to web enable the creation of funds reservation (= web enable what transaction FMX1 does). I have searched for available BAPI's/RFC's for this but I didn't found one. Since I'm not familiar with FI and FI-FM I maybe didn't search well

  • Callback for specific step group

    Hi, I have a sequence, Main sequence. In this sequence, there is Setup, Main and Cleanup step group. Setup is to initialise my devices, Main is to perform the tests on my UUTs, Cleanup is to stop and clear task for my devices. I would like to have a

  • When I open a new tab it won't do ANYTHING!

    The tab that automatically opens when I open firefox works fine. If I open any additional tabs, they do nothing. I put in an address or search term and get a blank/white screen. I have to start over in the first tab over and over!!!!