java - Glassfish appclient deploys from EAR -- how is it executed? -
helloearacc
, "hello world" using glassfish application client container (acc), deploys cli fine , runs f6 on netbeans. after initial run, it's possible run client cli.
how client, helloearacc
, executed outside of netbeans?
when helloearacc
created, project added helloear
module ear deploys within ear
appclient
:
thufir@dur:~$ thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin list-applications nothing list. no applications deployed target server. command list-applications executed successfully. thufir@dur:~$ thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin deploy netbeansprojects/helloear/dist/helloear.ear application deployed name helloear. command deploy executed successfully. thufir@dur:~$ thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin list-applications helloear <ear, appclient, ejb> command list-applications executed successfully. thufir@dur:~$ thufir@dur:~$ jar -tf netbeansprojects/helloear/dist/helloear.ear meta-inf/ meta-inf/manifest.mf lib/ helloear-ejb.jar helloearacc.jar lib/hellolibrary.jar thufir@dur:~$
it's helloearacc.jar
interests me -- how execute it?
i can run helloearacc
cli ant clean;ant run
with:
run-deploy: -as-retrieve-option-workaround: [copy] copying 1 file /home/thufir/netbeansprojects/helloearacc/dist [copy] copying 2 files /home/thufir/netbeansprojects/helloearacc/dist/helloearaccclient [copy] warning: /home/thufir/netbeansprojects/helloearacc/dist/gfdeploy/helloearacc not exist. -init-run-macros: -run-pregfv3: -run: [java] hello world run: build successful total time: 25 seconds thufir@dur:~/netbeansprojects/helloearacc$
provided i'm in project directory , use ant clean;ant run
after running f6 ide -- other attempts execute client fail to:
thufir@dur:~$ thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -jar netbeansprojects/helloearacc/dist/helloearacc helloearaccclient/ helloearaccclient.jar helloearacc.jar thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -jar netbeansprojects/helloearacc/dist/helloearaccclient.jar exception in thread "main" java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ sun.instrument.instrumentationimpl.loadclassandstartagent(instrumentationimpl.java:382) @ sun.instrument.instrumentationimpl.loadclassandcallpremain(instrumentationimpl.java:397) caused by: java.lang.noclassdeffounderror: lgreetings/greetingsbeanremote; @ java.lang.class.getdeclaredfields0(native method) @ java.lang.class.privategetdeclaredfields(class.java:2397) @ java.lang.class.getdeclaredfield(class.java:1946) @ com.sun.enterprise.deployment.util.componentvalidator.acceptwithcl(componentvalidator.java:857) @ com.sun.enterprise.deployment.util.componentvalidator.accept(componentvalidator.java:781) @ com.sun.enterprise.deployment.util.appclientvalidator.accept(appclientvalidator.java:64) @ com.sun.enterprise.deployment.bundledescriptor.visit(bundledescriptor.java:625) @ com.sun.enterprise.deployment.archivist.appclientarchivist.validate(appclientarchivist.java:184) @ org.glassfish.appclient.client.acc.facadelaunchable.validatedescriptor(facadelaunchable.java:183) @ org.glassfish.appclient.client.acc.appclientcontainer.completepreparation(appclientcontainer.java:366) @ org.glassfish.appclient.client.acc.appclientcontainer.prepare(appclientcontainer.java:320) @ org.glassfish.appclient.client.appclientfacade.prepareacc(appclientfacade.java:279) @ org.glassfish.appclient.client.acc.agent.appclientcontaineragent.premain(appclientcontaineragent.java:83) ... 6 more caused by: java.lang.classnotfoundexception: greetings.greetingsbeanremote @ java.net.urlclassloader$1.run(urlclassloader.java:366) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ org.glassfish.appclient.client.acc.accclassloader.findclass(accclassloader.java:237) @ java.lang.classloader.loadclass(classloader.java:425) @ java.lang.classloader.loadclass(classloader.java:358) ... 19 more fatal error in native method: processing of -javaagent failed ^c aborted (core dumped) thufir@dur:~$ thufir@dur:~$ thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -jar netbeansprojects/helloearacc/dist/helloearacc.jar sep 22, 2014 7:36:09 pm org.glassfish.apf.impl.defaulterrorhandler error severe: class [ lgreetings/greetingsbeanremote; ] not found. error while loading [ class helloearacc.main ] exception in thread "main" java.lang.noclassdeffounderror: greetings/greetingsbeanremote @ helloearacc.main.main(main.java:11) caused by: java.lang.classnotfoundexception: greetings.greetingsbeanremote @ java.net.urlclassloader$1.run(urlclassloader.java:366) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ org.glassfish.appclient.client.acc.accclassloader.findclass(accclassloader.java:237) @ java.lang.classloader.loadclass(classloader.java:425) @ java.lang.classloader.loadclass(classloader.java:358) ... 1 more thufir@dur:~$
while it's possible run ejb ear on glassfish, jndi lookup, prefer use appclient
-- correct way package , deploy appclient
usage?
Comments
Post a Comment