NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Re: JEE6 Maven Enterprise project

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
jyeary



Joined: 21 Oct 2008
Posts: 610
Location: Simpsonville, SC

PostPosted: Mon Jun 28, 2010 10:40 pm    Post subject: Re: JEE6 Maven Enterprise project Reply with quote

Please post the segment of your POM that shows the dependency. Is the dependency in a publicly accessible repository, or has it been added to your local repo?


On Mon, Jun 28, 2010 at 3:02 PM, Marcel Overdijk <address-removed ([email]address-removed[/email])> wrote:
Quote:

This is the first time I'm using Netbeans in combination with JEE and Maven.

I've used the 'Create Maven Enterprise application wizard' to create a
project to do some prototyping.
I've also created a simple stateless session bean just printing some log
statement.

I've put a @Schedule annotation on a method and after deploying the ejb
project (run from within netbeans using GF v3) I see the log statement.

So far so good.
Now I like to add a 3th party jar which my EJB module depends on (in my case
mongodb).
I've added it using Libraries -> Add dependency. The pom.xml afterwards
includes the dependency and I can also use the Mongo classes in my own
sources now.

When I now run the app I get errors that the Mongo classes cannot be found:

SEVERE: EJB5070: Exception creating stateless session bean : [ImportBean]
WARNING: A system exception occurred during an invocation on EJB ImportBean
method public void com.mycomp.ejb.ImportBean.execute()

I've also tried addind the dependency to the ear module but this gives the
same error.

I'm wondering what I'm doing wrong...?
--
View this message in context: http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29011125.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.




--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt
Back to top
Marcel Overdijk
Posted via mailing list.





PostPosted: Fri Jul 02, 2010 5:54 pm    Post subject: Re: JEE6 Maven Enterprise project Reply with quote

After adding the dependency to the EJB module the pom file contains:

<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.0</version>
</dependency>

As soon as I added the dep, my own classes which contain the Mongo classes
compile successfully, so I can assume the Mongo jar is in my repo.

Perhaps I've forgotten some additional steps I'm not aware of.
--
View this message in context: http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29020522.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Marcel Overdijk
Posted via mailing list.





PostPosted: Fri Jul 02, 2010 5:54 pm    Post subject: Re: JEE6 Maven Enterprise project Reply with quote

Guess I found the problem

The mongo driver in Maven
(http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/2.0/) seems to
compiled with Java 1.7

In Manifest file
Created-By: 1.7.0-b21 (Sun Microsystems Inc.)



John Yeary wrote:
Quote:

Please post the segment of your POM that shows the dependency. Is the
dependency in a publicly accessible repository, or has it been added to
your
local repo?

On Mon, Jun 28, 2010 at 3:02 PM, Marcel Overdijk
<address-removed>wrote:

Quote:

This is the first time I'm using Netbeans in combination with JEE and
Maven.

I've used the 'Create Maven Enterprise application wizard' to create a
project to do some prototyping.
I've also created a simple stateless session bean just printing some log
statement.

I've put a @Schedule annotation on a method and after deploying the ejb
project (run from within netbeans using GF v3) I see the log statement.

So far so good.
Now I like to add a 3th party jar which my EJB module depends on (in my
case
mongodb).
I've added it using Libraries -> Add dependency. The pom.xml afterwards
includes the dependency and I can also use the Mongo classes in my own
sources now.

When I now run the app I get errors that the Mongo classes cannot be
found:

SEVERE: EJB5070: Exception creating stateless session bean : [ImportBean]
WARNING: A system exception occurred during an invocation on EJB
ImportBean
method public void com.mycomp.ejb.ImportBean.execute()

I've also tried addind the dependency to the ear module but this gives
the
same error.

I'm wondering what I'm doing wrong...?
--
View this message in context:
http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29011125.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.




--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to take rank with those poor spirits who
neither enjoy much nor suffer much, because they live in the gray twilight
that knows not victory nor defeat."
-- Theodore Roosevelt



--
View this message in context: http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29021814.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Marcel Overdijk
Posted via mailing list.





PostPosted: Fri Jul 02, 2010 5:56 pm    Post subject: Re: JEE6 Maven Enterprise project Reply with quote

No this was actually not the case.

Now also added commons-logging jar to ejb module as dependency but also
classnotfound exception.

I guess I'm missing a trivial part here in the setup....



Marcel Overdijk wrote:
Quote:

Guess I found the problem

The mongo driver in Maven
(http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/2.0/) seems
to compiled with Java 1.7

In Manifest file
Created-By: 1.7.0-b21 (Sun Microsystems Inc.)



John Yeary wrote:
Quote:

Please post the segment of your POM that shows the dependency. Is the
dependency in a publicly accessible repository, or has it been added to
your
local repo?

On Mon, Jun 28, 2010 at 3:02 PM, Marcel Overdijk
<address-removed>wrote:

Quote:

This is the first time I'm using Netbeans in combination with JEE and
Maven.

I've used the 'Create Maven Enterprise application wizard' to create a
project to do some prototyping.
I've also created a simple stateless session bean just printing some log
statement.

I've put a @Schedule annotation on a method and after deploying the ejb
project (run from within netbeans using GF v3) I see the log statement.

So far so good.
Now I like to add a 3th party jar which my EJB module depends on (in my
case
mongodb).
I've added it using Libraries -> Add dependency. The pom.xml afterwards
includes the dependency and I can also use the Mongo classes in my own
sources now.

When I now run the app I get errors that the Mongo classes cannot be
found:

SEVERE: EJB5070: Exception creating stateless session bean :
[ImportBean]
WARNING: A system exception occurred during an invocation on EJB
ImportBean
method public void com.mycomp.ejb.ImportBean.execute()

I've also tried addind the dependency to the ear module but this gives
the
same error.

I'm wondering what I'm doing wrong...?
--
View this message in context:
http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29011125.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.




--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to take rank with those poor spirits
who
neither enjoy much nor suffer much, because they live in the gray
twilight
that knows not victory nor defeat."
-- Theodore Roosevelt





--
View this message in context: http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29024944.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Marcel Overdijk
Posted via mailing list.





PostPosted: Fri Jul 02, 2010 5:57 pm    Post subject: Re: JEE6 Maven Enterprise project Reply with quote

Perhaps I'm just missing the information on how to add 3th party libs to a
EJB module?

This is what I tried so far:
1) Create Maven JEE6 enterprise application using wizard in NB6.9
2) Added session bean to EJB module project which contains references to
Commons Logging log classes (class won't compile)
3) Added dependency to EJB module project for Commons Logging (session bean
created in step 2 now compiles
4) Clean and Build EJB module project
5) Clean and Build EAR Assembly project
6) Run EAR Assembly project


This is what the Glassfish log contains:

Jun 29, 2010 9:37:17 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Tue Jun 29 21:37:22 CEST 2010
INFO: Starting Grizzly Framework 1.9.18-o - Tue Jun 29 21:37:22 CEST 2010
INFO: Grizzly Framework 1.9.18-o started in: 68ms listening on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 60ms listening on port 4848
INFO: Grizzly Framework 1.9.18-o started in: 18ms listening on port 7676
INFO: Grizzly Framework 1.9.18-o started in: 115ms listening on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 42ms listening on port 3700
INFO: The Admin Console is already installed, but not yet loaded.
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time :
Felix(4079ms) startup services(1277ms) total(5356ms)
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Binding RMI port to *:8686
INFO: Grizzly Framework 1.9.18-o started in: 23ms listening on port 8080
INFO: JMXStartupService: Started JMXConnector, JMXService URL =
service:jmx:rmi://192.168.0.100:8686/jndi/rmi://192.168.0.100:8686/jmxrmi
SEVERE: Class [ Lorg/apache/commons/logging/Log; ] not found. Error while
loading [ class nl.kabisa.rsstank.ejb.ImportBean ]
WARNING: Error in annotation processing: java.lang.NoClassDefFoundError:
Lorg/apache/commons/logging/Log;
SEVERE: Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar
[rsstank-ejb-2.0.0-SNAPSHOT.jar]: it contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
message-driven bean.
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library
jar.
3. If the jar file contains valid EJBs which are annotated with EJB
component level annotations (@Stateless, @Stateful, @MessageDriven,
@Singleton), please check server.log to see whether the annotations were
processed properly.
at
com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:72)
at
com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:124)
at
com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:722)
at
com.sun.enterprise.deployment.Application.visit(Application.java:1744)
at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:774)
at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:253)
at
com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:222)
at
org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:152)
at
org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at
com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at
com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at
com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at
com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at
com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at
com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:8Cool
at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:637)

INFO: Using
com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as
the delegate
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Grizzly Framework 1.9.18-o started in: 16ms listening on port 8181
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir =
/Applications/NetBeans/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles,
felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true,
felix.fileinstall.tmpdir =
/var/folders/yX/yX6dJabeG1uKyFTIZJDazU+++TI/-Tmp-/fileinstall-2945815452055792062,
felix.fileinstall.filter = null}
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir =
/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart,
felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true,
felix.fileinstall.tmpdir =
/var/folders/yX/yX6dJabeG1uKyFTIZJDazU+++TI/-Tmp-/fileinstall--7592663899102770587,
felix.fileinstall.filter = null}
INFO: Started bundle:
file:/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/osgi-web-container.jar
INFO: Updating configuration from
org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: Installed
/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir =
/Applications/NetBeans/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles,
felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true,
felix.fileinstall.tmpdir =
/var/folders/yX/yX6dJabeG1uKyFTIZJDazU+++TI/-Tmp-/fileinstall-6211833902409171462,
felix.fileinstall.filter = null}
INFO: The Admin Console is already installed, but not yet loaded.
INFO: The Admin Console is loading...
INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider
com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype
com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype
com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype
com.sun.enterprise.security.auth.realm.certificate.CertificateRealm
successfully created.
INFO: Security service(s) started successfully....
INFO: Initializing Mojarra 2.0.2 (FCS b10) for context ''
INFO: Loading application __admingui at /
INFO: Loading __admingui Application done is 6089 ms
INFO: The Admin Console application is loaded.
INFO: AMX ComplianceMonitor: ValidationLevel = full, UnregisterNonCompliant
= false, LogInaccessibleAttributes = true
INFO: AMX config read, domain config registered as amx:pp=/,type=domain
INFO: J2EEDomain registered at
amx:pp=/,type=J2EEDomain,j2eeType=J2EEDomain,name=amx
INFO: AMXStartupServiceNew: AMX ready for use, DomainRoot =
amx:pp=,type=domain-root
INFO: admin console: initSessionAttributes()
INFO: Update Component count = 0

--
View this message in context: http://old.nabble.com/JEE6-Maven-Enterprise-project-tp29011125p29027731.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo