java ee - EAR application and application.xml: library-directory element values -
starting basic ear
file documentation , proceeding official oracle documentation, can't find on application.xml
. should application.xml
file have library-directory
element?
deploy fails:
thufir@doge:~$ thufir@doge:~$ glassfish_server/bin/asadmin deploy /home/thufir/netbeansprojects/gradleear/build/libs/gradleear.ear remote failure: error occurred during deployment: org.xml.sax.saxparseexception; linenumber: 4; columnnumber: 22; deployment descriptor file meta-inf/application.xml in archive [gradleear]. cvc-complex-type.2.4.a: invalid content found starting element 'library-directory'. 1 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}' expected.. please see server.log more details. command deploy failed. thufir@doge:~$
build.gradle:
plugins { id 'com.gradle.build-scan' version '1.8' id 'java' id 'application' id 'ear' } mainclassname = 'net.bounceme.doge.json.main' buildscan { licenseagreementurl = 'https://gradle.com/terms-of-service' licenseagree = 'yes' } repositories { jcenter() } jar { manifest { attributes 'main-class': 'net.bounceme.doge.json.main' } } task fatjar(type: jar) { basename = project.name + '-all' { configurations.compile.collect { it.isdirectory() ? : ziptree(it) } } jar manifest { attributes 'implementation-title': 'gradle quickstart', 'implementation-version': '3.4.0' attributes 'main-class': 'net.bounceme.doge.json.main' } } dependencies { compile group: 'javax.json', name: 'javax.json-api', version: '1.1' compile group: 'org.glassfish', name: 'javax.json', version: '1.1' compileonly 'javax:javaee-api:7.0' }
project:
gradleear/ ├── build.gradle ├── gradle │ └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src ├── main │ ├── java │ │ └── net │ │ └── bounceme │ │ └── doge │ │ ├── ejb │ │ │ ├── newsessionbean.java │ │ │ └── newsessionbeanremote.java │ │ └── json │ │ ├── jsonreaderclient.java │ │ ├── jsonreader.java │ │ ├── main.java │ │ ├── marshaller.java │ │ ├── marshalljson.java │ │ ├── objecta.java │ │ └── propertiesreader.java │ └── resources └── test └── java 13 directories, 15 files
ear file:
thufir@doge:~/netbeansprojects/gradleear/build/libs$ thufir@doge:~/netbeansprojects/gradleear/build/libs$ ll total 20 drwxr-xr-x 2 thufir thufir 4096 aug 21 22:47 ./ drwxr-xr-x 6 thufir thufir 4096 aug 21 22:47 ../ -rw-r--r-- 1 thufir thufir 8569 aug 21 22:47 gradleear.ear thufir@doge:~/netbeansprojects/gradleear/build/libs$ thufir@doge:~/netbeansprojects/gradleear/build/libs$ jar xf gradleear.ear thufir@doge:~/netbeansprojects/gradleear/build/libs$ thufir@doge:~/netbeansprojects/gradleear/build/libs$ tree . ├── gradleear.ear ├── meta-inf │ ├── application.xml │ └── manifest.mf └── net └── bounceme └── doge ├── ejb │ ├── newsessionbean.class │ └── newsessionbeanremote.class └── json ├── jsonreader.class ├── jsonreaderclient.class ├── main.class ├── marshaller.class ├── marshalljson.class ├── objecta.class └── propertiesreader.class 6 directories, 12 files thufir@doge:~/netbeansprojects/gradleear/build/libs$ thufir@doge:~/netbeansprojects/gradleear/build/libs$ cat meta-inf/manifest.mf manifest-version: 1.0 thufir@doge:~/netbeansprojects/gradleear/build/libs$ thufir@doge:~/netbeansprojects/gradleear/build/libs$ cat meta-inf/application.xml <?xml version="1.0"?> <application 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_6.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="6"> <display-name>gradleear</display-name> <library-directory>lib</library-directory> </application> thufir@doge:~/netbeansprojects/gradleear/build/libs$
it looks like lib
, above, default -- or @ least standard. surely it's not necessary resort groovy? i'd expect gradle.
wiki
Comments
Post a Comment