admin管理员组

文章数量:1125112

I am working on a project inglobing three modules: ear, ejb and web. The clean and build command in netbeans works and each module is built successfully. When I try to deploy the .ear package just built on my local payara server, the deploy fails and the server.log error says:

[Payara 5.2021.9] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=789 _ThreadName=admin-thread-pool::admin-listener(26)] [timeMillis: 1736417429711] [levelValue: 800] 
[[Exception Occurred :Error occurred during deployment: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; Deployment descriptor file META-INF/application.xml in archive [APPNAME-ear-1.0-SNAPSHOT].  cvc-complex-type.2.4.a: Invalid content was found starting with element '{";:library-directory}'. One of '{";:display-name, ";:icon, ";:initialize-in-order, ";:module}' is expected.. Please see server.log for more details.]]

Checking on that file, all that I can see is:

<?xml version="1.0" encoding="UTF-8"?>
<application version="6" xmlns="; xmlns:xsi="; xsi:schemaLocation=" .xsd">
   <display-name>APPNAME-ear</display-name>
   <library-directory>lib</library-directory>
</application>

So I suppose that the value lib is not so appreciated but I cannot understand how it is possible given the fact that the application.xml file is created once the project is built. Could you give me some hints? Thank you in advance

I am working on a project inglobing three modules: ear, ejb and web. The clean and build command in netbeans works and each module is built successfully. When I try to deploy the .ear package just built on my local payara server, the deploy fails and the server.log error says:

[Payara 5.2021.9] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=789 _ThreadName=admin-thread-pool::admin-listener(26)] [timeMillis: 1736417429711] [levelValue: 800] 
[[Exception Occurred :Error occurred during deployment: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; Deployment descriptor file META-INF/application.xml in archive [APPNAME-ear-1.0-SNAPSHOT].  cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://java.sun.com/xml/ns/javaee":library-directory}'. One of '{"http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":initialize-in-order, "http://java.sun.com/xml/ns/javaee":module}' is expected.. Please see server.log for more details.]]

Checking on that file, all that I can see is:

<?xml version="1.0" encoding="UTF-8"?>
<application version="6" 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_6.xsd">
   <display-name>APPNAME-ear</display-name>
   <library-directory>lib</library-directory>
</application>

So I suppose that the value lib is not so appreciated but I cannot understand how it is possible given the fact that the application.xml file is created once the project is built. Could you give me some hints? Thank you in advance

Share Improve this question asked 2 days ago Patrick PalmeriniPatrick Palmerini 114 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I have found the issue: the problem was inside the pom.xml of the ear module

<dependencies>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>APPNAME-ejb</artifactId>
            <version>${project.version}</version>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>APPNAME-web</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
    </dependencies>

these dependencies after build block in the xml file were not added; after the edit the error disappeared.

本文标签: deploymentDeploy ear (Payara Server 520219Netbeans 125Maven 363)Stack Overflow