Ray Blue

Greenhorn
+ Follow
since Jul 12, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ray Blue

Hi.

I decided to do the OCPJEE7AD some weeks ago. And I got the Oracle Java subscription (50% off, Blackfriday deal). I have experienced a lot of problems setting up my environment to work like told in the Developing Applications for the Java EE 7 Platform video course.
So I wanted to share my experience here, so maybe I can help out one or two of you guys.

First of all:
If you are new to Oracle university, as I am, it seems you dont even have to setup the stuff on your local computer anyways. There is a feature called LABS and its free as long as you use the subscription. You get a remote desktop to where you can install and configure your stuff.You will need some software called Oracle Secure Global Server installed on your computer to connect to your test environment. You will have to schedule via learn.oracle.com (inside your course) to get these resources and a mail with connection details. See also: https://www.oracle.com/de/secure-global-desktop/. When you downloaded it under Ubuntu and the deb file won't install correctly call it in your console (sudo apt install
./sgdclient_5.40.935-ubuntu16.04_x86_64.deb), so that you can see if missing dependencies need to be installed too.

If you are also interested in setting this up manually on your computer, like I did, you may experience some problems. I tried it under Ubuntu 18 and did the following steps in this order to solve it:
- Search for and downloada Oracle JDK 1.8 (NOT OpenJDK!). It isnt included in SDKMAN so you have to download it manually. Use the TAR/ZIP version! Just extract it
- Then correctly setup JAVA_HOME!
- You will then be able to download and install WebLogic 12c without problems as it will find the right Java 1.8 version.
- Then download NetBeans 8.1 (really THIS version, no newer ones! Its the one you need for this course and it works)
- Start NetBeans via console with the following parameter: --jdkhome /opt/jdk-8u231-linux-x64/jdk1.8.0_231/

This should do it. Good luck!
You should be fine. The offer and page is fine.
hi vijitha.

thanks for your fast reply. what i already tried was extracting the ear file. then i could see all my jar files. after even extracting the model.jar there was the class that threw the ClassNotFoundException. So the packaging "should" be ok, at least i cant see anything wrong.

Maybe you are right with glassfish having problems using this ejb version... what i tried there was putting all javax... and other ejb jar files in the lib external folder of domain1. But that didnt work either after a server reboot. How can i further examine this possible glassfish problem?

The used glassfish version is GlassFish Server Open Source Edition 3.1.2.2 (5).

Maybe it isnt a glassfish problem but i violated some constraint on how to setup the project?? I dont know
Hi there.

I started a project with EJB3.2, JSF2.2 and Maven on Glassfish latest. I tried several alphas and experienced all kinds of problems. In example it was very difficult to mix "Eclipse facet behavior" and "Standard Maven POM configured projects". Right now I think i managed to get a clear multi module EAR app inlcuding 2 ejb and a war project and some util stuff.. My project looks a bit like this:

projectx - inlcuding parent pom
projectx-ear - for EAR export (rightclick EAR export in Eclipse works)
projectx-ejb - for my stateless session beans and local interfaces
projectx-jpa - another EJB project that only manages reading and writing to database via EntityManager /javax.persistence JPA latest
projectx-model - includes my entity beans
projectx-web - includes the facelets and jsf part

I previously got a alpha running with mixed maven and eclipse (.settings, .project..) facetted stuff. I was able to export and see my jsf login page. my managed beans got loaded, only my persistence made problems. so i did a redo on the project, made it clean and maven only...

Now the question. The project itself compiles fine. No errors or warnings. I can also export the EAR file including my JAR files. But now when I try to deploy the EAR on glassfish, I get an error:
Error occurred during deployment: Exception while loading the app : EJB Container initialization error. Please see server.log for more details.

Stacktrace:


2014-04-15T10:01:11.078+0200|INFO: uploadFileName=projectx-ear.ear
2014-04-15T10:01:15.731+0200|SEVERE: DPL8008: method/class loading failure : (EjbDescriptor.getBusinessMethodDescriptors())
method/class name - {1}
2014-04-15T10:01:15.732+0200|SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer load method
java.lang.RuntimeException: EJB Container initialization error
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:242)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:305)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:108)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)
at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:219)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:229)
... 56 more
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
at com.sun.enterprise.deployment.EjbDescriptor.getLocalRemoteBusinessMethodDescriptors(EjbDescriptor.java:2302)
at com.sun.enterprise.deployment.EjbDescriptor.getBusinessMethodDescriptors(EjbDescriptor.java:2312)
at com.sun.enterprise.deployment.EjbDescriptor.getMethodDescriptors(EjbDescriptor.java:2217)
at org.glassfish.ejb.security.application.EJBSecurityManager.convertEJBMethodPermissions(EJBSecurityManager.java:546)
at org.glassfish.ejb.security.application.EJBSecurityManager.loadPolicyConfiguration(EJBSecurityManager.java:256)
at org.glassfish.ejb.security.application.EJBSecurityManager.initialize(EJBSecurityManager.java:317)
at org.glassfish.ejb.security.application.EJBSecurityManager.<init>(EJBSecurityManager.java:190)
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:209)
... 57 more
Caused by: java.lang.NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.privateGetPublicMethods(Class.java:2571)
at java.lang.Class.getMethods(Class.java:1429)
at com.sun.enterprise.deployment.EjbDescriptor.addAllInterfaceMethodsIn(EjbDescriptor.java:2327)
at com.sun.enterprise.deployment.EjbDescriptor.getLocalRemoteBusinessMethodDescriptors(EjbDescriptor.java:2295)
... 64 more
Caused by: java.lang.ClassNotFoundException: de.myname.projectx.model.AbstractEntity
at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:808)
at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 70 more

2014-04-15T10:01:15.734+0200|SEVERE: Exception while loading the app
2014-04-15T10:01:15.739+0200|SEVERE: Exception while loading the app : EJB Container initialization error
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:219)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:229)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:305)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:108)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)
at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
at com.sun.enterprise.deployment.EjbDescriptor.getLocalRemoteBusinessMethodDescriptors(EjbDescriptor.java:2302)
at com.sun.enterprise.deployment.EjbDescriptor.getBusinessMethodDescriptors(EjbDescriptor.java:2312)
at com.sun.enterprise.deployment.EjbDescriptor.getMethodDescriptors(EjbDescriptor.java:2217)
at org.glassfish.ejb.security.application.EJBSecurityManager.convertEJBMethodPermissions(EJBSecurityManager.java:546)
at org.glassfish.ejb.security.application.EJBSecurityManager.loadPolicyConfiguration(EJBSecurityManager.java:256)
at org.glassfish.ejb.security.application.EJBSecurityManager.initialize(EJBSecurityManager.java:317)
at org.glassfish.ejb.security.application.EJBSecurityManager.<init>(EJBSecurityManager.java:190)
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:209)
... 57 more
Caused by: java.lang.NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.privateGetPublicMethods(Class.java:2571)
at java.lang.Class.getMethods(Class.java:1429)
at com.sun.enterprise.deployment.EjbDescriptor.addAllInterfaceMethodsIn(EjbDescriptor.java:2327)
at com.sun.enterprise.deployment.EjbDescriptor.getLocalRemoteBusinessMethodDescriptors(EjbDescriptor.java:2295)
... 64 more
Caused by: java.lang.ClassNotFoundException: de.myname.projectx.model.AbstractEntity
at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:808)
at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 70 more



I think the root problem could be: NoClassDefFoundError: de/myname/projectx/model/AbstractEntity
But thats my class, placed in the projectx-model module. And it is exported in the EAR file and added
as dependency to all maven modules. I can extract the JAR files inside the EAR, the zipped files dont
seem to be corrupt.

Any ideas? Thanks in advance.
actually it was quiet easy at last (after i found maven). The jsf project must not include the sources or any reference to the EJB project inside eclipse. In the next step the ejb and jsf project both need a pom. And finally i set a dependency in jsf to ejb with only compile time scope. So the source could be compiled, but the exported war file doesnt contain any ejb jars anymore and the ejb can simply be deployed apart from jsf ;)
9 years ago
I already did some EJB3/JSF projects and know how to deploy them as EAR on JBoss. To do this i used 3 projects in Eclipse (EAR project, JSF project and EJB3 project). Now i would like to start with maven. I am very new to this and wonder if its possible with maven to deploy ONLY the JSF or the EJB part without having to deploy the whole EAR file. Reason is that it could be that only web changes took effect, but the EJB is already finished. In my concrete case I am planning to get some web developer and I only want him to be allowed to checkout the JSF project and deploy that part into the JBOSS without having to deploy EJB and without having access to that EJB project source code. I guess a JAR of the EJB project should be enough for the JSF module / this web developer. But how is this setup in Eclipse / Maven2 using standard Spring 3?
9 years ago
you´re right. sorry for that. you can move it ;)
10 years ago
Ok my test was already on 14th of April. So a little late this post ;) But I fullfilled some dream and got my certification ;) Next step would be SCBCD if there were already any actual good books about it. SCJP was really fun with the study guide from Katherine Sierra and Bert Bates. Love those two ;)

100 % Declaration, Initialization and Scoping :-) :-)
81% Flow Control
90% OO concepts

But only 40% in generics (shame on me ^^)
Leads to overall of 75% (which have could been more if I only had learnt more about generics). But certified is certified ;)
10 years ago
does comp/env also work with windows?? my app ran under jboss. and in glassfish i managed to get it deployed too. even my stateless session beans work. but i am not allowed to use DI for stateful session beans. so I would have to use lookup. But lookup works different in Glassfish than in JBoss Some "full" example would be great. I already added some ConnectionPool successfuly and some jdbc/mydb connection resource. The only thing that i think is missing is the correct JNDI lookup
As far as I can see you are trying to DI a stateful session bean. You will have to use lookup instead of injection. Can anyone paste some lookup example, because I have the same problem right now ;) My JNDI lookup works in JBoss but unforunately not in GlassFish. Where is the difference?