简体   繁体   中英

Problem running a simple EJB application

I am currently running a simple EJB application using a stateless Session Bean. I am working on NetBeans 6.8 with Personal Glassfish 3.0 and I have installed on my system both the Java EE and the Java SE. I don't know whether it is relevent but I am running Windows7 64-bit version. The Session Bean I implemented has just one method sayHello(); which just prints hello on the screen. When I try to run the application I'm getting the following error:

pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
MyEnterprise-app-client.init:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
MyEnterprise-app-client.deps-jar:
MyEnterprise-app-client.compile:
MyEnterprise-app-client.library-inclusion-in-manifest:
MyEnterprise-app-client.dist-ear:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
post-dist:
dist-directory-deploy:
pre-run-deploy:
Starting Personal GlassFish v3 Domain
Personal GlassFish v3 Domain is running.
Undeploying ...
Initializing...
Initial deploying MyEnterprise to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\gfdeploy\MyEnterprise
Completed initial distribution of MyEnterprise
post-run-deploy:
run-deploy:
run-display-browser:
run-ac:
pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
MyEnterprise-app-client.init:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
MyEnterprise-app-client.deps-jar:
MyEnterprise-app-client.compile:
MyEnterprise-app-client.library-inclusion-in-manifest:
MyEnterprise-app-client.dist-ear:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
post-dist:
dist-directory-deploy:
pre-run-deploy:
Undeploying ...
Initial deploying MyEnterprise to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\gfdeploy\MyEnterprise
Completed initial distribution of MyEnterprise
post-run-deploy:
run-deploy:
Warning: Could not find file C:\Users\Naqsam\.netbeans\6.8\GlassFish_v3\generated\xml\MyEnterprise\MyEnterpriseClient.jar to copy.
Copying 1 file to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist
Copying 4 files to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\MyEnterpriseClient
Copying 1 file to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\MyEnterpriseClient
java.lang.NullPointerException
        at org.glassfish.appclient.client.acc.ACCLogger$1.run(ACCLogger.java:149)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.glassfish.appclient.client.acc.ACCLogger.reviseLogger(ACCLogger.java:146)
        at org.glassfish.appclient.client.acc.ACCLogger.init(ACCLogger.java:93)
        at org.glassfish.appclient.client.acc.ACCLogger.<init>(ACCLogger.java:80)
        at org.glassfish.appclient.client.AppClientFacade.createBuilder(AppClientFacade.java:360)
        at org.glassfish.appclient.client.AppClientFacade.prepareACC(AppClientFacade.java:247)
        at org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.premain(AppClientContainerAgent.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Java Result: 1
run-MyEnterprise-app-client:
run:
BUILD SUCCESSFUL (total time: 1 minute 59 seconds)

The server also shows this error message:

http://pastebin.com/NNu1eGA1

What do you think is the problem? This is still my first EJB application so I'm new to this API.

Remove all EJBs and restart Glassfish server. See if you get any error. If you get error without EJB, then something is wrong with your Glassfish installation.

If the Glassfish starts fine without EJBs, then pls post your EJB code. There could be some issue with the EJB code.

The user Pascal Thivent was kind enough to delete the post which contained the answer for this problem for some strange and odd reason. So I will have to repost the solutions.

So basically the solutions are:

1: Glassfish was throwing a lot of warnings because it was installed in a directory whose path name had a space "Program Files". So to solve this problem, just install it in C:/

2: As regards the NullPointerException which was being thrown (see the first post and scroll a bit down) there seems an issue see this link https://glassfish.dev.java.net/issues/show_bug.cgi?id=11494 with glassfish and java6u18. So to solve this problem either wait for java to fix this bug in future updates, or else downgrade to java6u17 or lower.

Hope this might be helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM