簡體   English   中英

在JBoss AS 7上部署Web應用程序時出錯

[英]Error when deploy web-application on JBoss AS 7

我最終使用JBoss AS 7.1.1,嘗試部署應用程序時遇到一個問題:

JBAS014775:新的缺少/不滿意的依賴項:服務jboss.naming.context.java。“ \\ n \\ t \\ t \\ tjava:jboss” .datasources。“ carsDS \\ n \\ t \\ t”

(缺失的)依賴項:[service jboss.persistenceunit。“ springTest.war#carsPU”] 20:33:58,250錯誤[org.jboss.as.server.deployment.scanner](DeploymentScanner-threads-1){“ JBAS014653:復合操作失敗並回滾。失敗的步驟:“ => {”操作步驟2“ => {” JBAS014771:缺少依賴項/不可用依賴項的服務“ => [” jboss.persistenceunit。\\“ springTest.war#carsPU \\ “jboss.naming.context.java \\”。\\ n \\噸\\噸\\ tjava: “數據源\\ ”“。缺少[jboss.persistenceunit \\” 的JBoss \\ carsDS的\\ n \\噸\\噸\\ springTest.war#carsPU \\ “jboss.naming.context.java \\”。\\ n \\噸\\噸\\ tjava: “數據源\\ ”的JBoss \\ carsDS的\\ n \\噸\\噸\\“]”]}}}

這是我的standalone.xml文件:

<drivers>
    <driver module="com.h2database.h2" name="h2">
        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
    </driver>
    <driver module="com.mysql" name="com.mysql">
        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
    </driver>
</drivers>
<datasource enabled="true" jndi-name="java:jboss/datasources/carsDS"
    pool-name="carsDS">
    <connection-url>jdbc:mysql://localhost:3306</connection-url>

    <driver>com.mysql</driver>

    <pool>
        <min-pool-size>10</min-pool-size>
        <max-pool-size>100</max-pool-size>
        <prefill>true</prefill>
    </pool>
    <security>
        <user-name>michal</user-name>
        <password>michal</password>
    </security>
    <statement>
        <prepared-statement-cache-size>32</prepared-statement-cache-size>
        <share-prepared-statements />
    </statement>
</datasource>

和persistence.xml:

<persistence 
    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"
    version="1.0">
    <persistence-unit name="carsPU" transaction-type="JTA" >
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>
            java:jboss/datasources/carsDS
        </jta-data-source>
        <class>pl.springtest.carEntity</class>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
            <property name="hibernate.hbm2ddl.auto" value="create-drop" />
        </properties>
    </persistence-unit>
</persistence>

請告訴我有什么問題。

  service jboss.naming.context.java."\n\t\t\tjava:jboss".datasources."carsDS\n\t\t"

這看起來很可疑。 檢查在您注入數據源的地方是否存在空白。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM