私は開発を続ける必要がある継承EAR applicationを取得します。私がそれをWebsphere Liberty 16.0.0.4で動作させることができないという問題は、Websphere Application Server Full Profile 8.5ではうまくいきます。残念ながら、(幸いにも:))私のワーキングステーションはMacBook Proで、WAS Full ProfileはOSXにインストールすることはできません(今はリンクを見つけることができませんが、いくつかの検索を行い、十分な証拠を見つけることができます)。 LinuxでVirtualBoxを使用するか、Libertyでこのアプリを実行してみてください。最新のソリューションは、私にとってとてもうまく動作しないEARアプリケーションはWebsphere8.5で動作しますが、Websphere Libertyで動作することを拒否します。16.0.0.4
、私は次のエラーを取得する:
[ERROR ] CWWJP0012E: The persistence unit name is not specified and a unique persistence unit is not found in the BigEnterpriseAppEAR application and BigEnterpriseAppEJB.jar module. [ERROR ] CWWJP0029E: The server cannot find the persistence unit in the BigEnterpriseAppEJB.jar module and the BigEnterpriseAppEAR application. [ERROR ] CWNEN0035E: The java:comp/env/BigEnterpriseApp reference of type javax.persistence.EntityManager for the DataProvider component in the BigEnterpriseAppEJB.jar module of the BigEnterpriseAppEAR application cannot be resolved. [ERROR ] CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "getDataByOwner" on bean "BeanId(BigEnterpriseAppEAR#BigEnterpriseAppWEB.war#DataAPI, null)". Exception data: javax.ejb.EJBTransactionRolledbackException: nested exception is: javax.ejb.EJBException: The java:comp/env/BigEnterpriseApp reference of type javax.persistence.EntityManager for the DataProvider component in the BigEnterpriseAppEJB.jar module of the BigEnterpriseAppEAR application cannot be resolved.
アプリは私にはないEAR
= JPA
+ EJB
+ WAR
非常に単純ですどんな設定ファイルが役立つか知っているので、投稿するコメントを書き込んでください。私はそれを行います。
ありがとうございます。
UPDATE 1:
server.xml
ファイル:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>localConnector-1.0</feature>
<feature>servlet-3.1</feature>
<feature>ejbLite-3.1</feature>
<feature>jndi-1.0</feature>
<feature>jaxrs-1.1</feature>
<feature>ssl-1.0</feature>
<feature>jpa-2.0</feature>
<feature>cdi-1.0</feature>
</featureManager>
<basicRegistry id="basic" realm="BasicRealm">
<!-- <user name="yourUserName" password="" /> -->
</basicRegistry>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<applicationMonitor updateTrigger="mbean"/>
<library id="DB2JCC4Lib">
<fileset dir="/Users/anatoly/developer/sql_drivers" includes="*.jar"/>
</library>
<dataSource id="db2_slc" jndiName="jdbc/BEADB" type="javax.sql.DataSource">
<jdbcDriver libraryRef="DB2JCC4Lib"/>
<properties.db2.jcc databaseName="beadb" password="********" portNumber="50000" serverName="db2server" user="db2username"/>
</dataSource>
<keyStore id="defaultKeyStore" password="******"/>
<enterpriseApplication id="BigEnterpriseAppEAR" location="BigEnterpriseAppEAR.ear" name="BigEnterpriseAppEAR"/>
</server>
persistence.xml
ファイルに位置BigEnterpriseAppJPA> SRC>に位置するパッケージ化EAR persistence.xml
で
persistence.xmlのMETA-INF> BigEnterpriseAppEAR - > BigEnterpriseAppJPA.jar - > META-INF - > persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="BigEnterpriseApp">
<jta-data-source>jdbc/BEADB</jta-data-source>
<class>com.bea.entities.System</class>
<class>com.bea.entities.Data</class>
<class>com.bea.entities.User</class>
<class>com.bea.entities.Group</class>
<properties>
<property name="openjpa.jdbc.Schema" value="BEADB" />
<property name="openjpa.ConnectionRetainMode" value="transaction" />
</properties>
</persistence-unit>
</persistence>
良いスタートは、server.xmlとpersistence.xmlを投稿することです。 –
@FRowe、done。ありがとうございました! – Anatoly
persistence.xmlの場所はどこですか? –