[EJB 3.0 Users] - Re: Client calls Timer only once
by Fuchs
Excuse that I have not explained my post enough.
Now, I want to make up this.
build.xml:
The build.xml script generates an *.ejbjar file which is not deployed by my jboss 5.0.1.GA default server. So I changed the build-script to make a *.jar file.
I also changed the directories, where EJB is found, from "/server/default/deploy/ejb3.deployer" to "/server/default/deployers/ejb3.deployer".
The path to "jboss-aop-jdk50.deployer", I changed to "/server/default/deployers/jboss-aop-jboss5.deployer".
That was all what I changed on the server-side.
Client.java:
The client.java in the tutorial looks like this:
| InitialContext ctx = new InitialContext();
| ExampleTimer timer = (ExampleTimer) ctx.lookup(ExampleTimer.class.getName());
| timer.scheduleTimer(5000);
|
It use a "jndi.properties" which looks like this:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=localhost
With this Configuration, I get the following exception:
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl <init>
| WARNUNG: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: xxx.xx.xx.xxx; port: 900"
| org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
| ...
| Caused by: java.net.ConnectException: Connection refused: connect
900 is the wrong port, so I implemented the following in the client.java:
try {
| Properties p = new Properties();
| p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
| Context ctx = new InitialContext(p);
| Object ref = ctx.lookup("TimerBean/remote");
| ExampleTimer cbr =(ExampleTimer) PortableRemoteObject.narrow(ref, ExampleTimer.class);
| cbr.scheduleTimer(5000);
|
| } catch (NamingException e){
| e.printStackTrace();
| }
The next exception was:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
| ...
| Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
After I added the jbossall-client.jar it deployed.
I could not reproduce why I added these arguments (-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory), so I removed them.
Client-Console:
HELLO FROM CLIENT !
| log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
| log4j:WARN Please initialize the log4j system properly.
Server-Console:
| Jboss start
| ...
| 10:58:20,775 INFO [JndiSessionRegistrarBase] Binding the following Entries in G
| lobal JNDI:
|
| SecureDeploymentManager/remote - EJB3.x Default Remote Business Interfac
| e
| SecureDeploymentManager/remote-org.jboss.deployers.spi.management.deploy
| .DeploymentManager - EJB3.x Remote Business Interface
|
| 10:58:20,934 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileservice
| -secured.jar,name=SecureManagementView,service=EJB3
| 10:58:20,934 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.ejb.Secu
| reManagementView ejbName: SecureManagementView
| 10:58:20,966 INFO [JndiSessionRegistrarBase] Binding the following Entries in G
| lobal JNDI:
|
| SecureManagementView/remote - EJB3.x Default Remote Business Interface
| SecureManagementView/remote-org.jboss.deployers.spi.management.Managemen
| tView - EJB3.x Remote Business Interface
|
| 10:58:21,156 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileservice
| -secured.jar,name=SecureProfileService,service=EJB3
| 10:58:21,156 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.ejb.Secu
| reProfileServiceBean ejbName: SecureProfileService
| 10:58:21,204 INFO [JndiSessionRegistrarBase] Binding the following Entries in G
| lobal JNDI:
|
| SecureProfileService/remote - EJB3.x Default Remote Business Interface
| SecureProfileService/remote-org.jboss.profileservice.spi.ProfileService
| - EJB3.x Remote Business Interface
|
| 10:58:21,744 INFO [TomcatDeployment] deploy, ctxPath=/admin-console
| 10:58:22,649 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/
| admin-console'
| 10:58:29,398 INFO [TomcatDeployment] deploy, ctxPath=/
| 10:58:29,763 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
| 10:58:30,001 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8
| 080
| 10:58:30,112 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 10:58:30,128 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=
| JBoss_5_1_0_GA date=200905221053)] Started in 1m:55s:949ms
|
|
| After deploy:
| 11:01:13,169 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS
| DeploymentContext@16634496{vfszip:/D:/server/exp-server/jboss-5.1.0.GA/server/de
| fault/deploy/tutorial.jar/}
| 11:01:13,201 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS
| DeploymentContext@16634496{vfszip:/D:/server/exp-server/jboss-5.1.0.GA/server/de
| fault/deploy/tutorial.jar/}
| 11:01:13,421 INFO [JBossASKernel] Created KernelDeployment for: tutorial.jar
| 11:01:13,421 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=tutorial.jar,
| name=TimerBean,service=EJB3
| 11:01:13,421 INFO [JBossASKernel] with dependencies:
| 11:01:13,421 INFO [JBossASKernel] and demands:
| 11:01:13,421 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
| 11:01:13,421 INFO [JBossASKernel] and supplies:
| 11:01:13,421 INFO [JBossASKernel] jndi:TimerBean/remote
| 11:01:13,421 INFO [JBossASKernel] jndi:TimerBean/remote-ejb.timer.createbi
| ll.ExampleTimer
| 11:01:13,421 INFO [JBossASKernel] Class:ejb.timer.createbill.ExampleTimer
| 11:01:13,421 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=tutorial.jar,name=T
| imerBean,service=EJB3) to KernelDeployment of: tutorial.jar
| 11:01:13,421 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@150f2ec{na
| me=jboss.j2ee:jar=tutorial.jar,name=TimerBean,service=EJB3_endpoint bean=org.jbo
| ss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=
| null autowireCandidate=true}
| 11:01:13,499 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=tutorial.jar,n
| ame=TimerBean,service=EJB3
| 11:01:13,499 INFO [EJBContainer] STARTED EJB: ejb.timer.createbill.TimerBean ej
| bName: TimerBean
| 11:01:13,515 INFO [JndiSessionRegistrarBase] Binding the following Entries in G
| lobal JNDI:
|
| TimerBean/remote - EJB3.x Default Remote Business Interface
| TimerBean/remote-ejb.timer.createbill.ExampleTimer - EJB3.x Remote Busin
| ess Interface
|
| After start
| 11:13:50,323 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsF
| actory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the b
| ean container
| 11:13:50,323 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsF
| actory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the b
| ean container
| 11:13:55,497 INFO [STDOUT] ---------------------
| 11:13:55,497 INFO [STDOUT] * Received Timer event: Hello World
| 11:13:55,497 INFO [STDOUT] ---------------------
But the receiving of the timer event appears only once.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261215#4261215
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261215
16 years, 8 months
[jBPM Users] - Re: [jBPM4] Programatic deployment - DEPLOYPROP table is emp
by DrBrain
And here's the log output in case someone has a hint:
2009-10-20 12:18:52,379 DEBUG org.hibernate.jdbc.JDBCContext - successfully registered Synchronization
| 2009-10-20 12:18:52,379 DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 5144700241424384
| 2009-10-20 12:18:52,379 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2009-10-20 12:18:52,379 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
| 2009-10-20 12:18:52,380 DEBUG org.hibernate.SQL - select hibernate_sequence.nextval from dual
| 2009-10-20 12:18:52,381 DEBUG org.hibernate.id.SequenceGenerator - Sequence identifier generated: 103
| 2009-10-20 12:18:52,381 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2009-10-20 12:18:52,381 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
| 2009-10-20 12:18:52,381 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
| 2009-10-20 12:18:52,381 DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 103, using strategy: org.hibernate.id.SequenceGenerator
| 2009-10-20 12:18:52,382 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2009-10-20 12:18:52,382 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
| 2009-10-20 12:18:52,382 DEBUG org.hibernate.SQL - select hibernate_sequence.nextval from dual
| 2009-10-20 12:18:52,383 DEBUG org.hibernate.id.SequenceGenerator - Sequence identifier generated: 104
| 2009-10-20 12:18:52,383 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2009-10-20 12:18:52,393 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
| 2009-10-20 12:18:52,393 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
| 2009-10-20 12:18:52,393 DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 104, using strategy: org.hibernate.id.SequenceGenerator
| 2009-10-20 12:18:52,394 DEBUG .hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
| 2009-10-20 12:18:52,396 DEBUG .hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
| 2009-10-20 12:18:52,396 DEBUG org.hibernate.engine.Collections - Collection found: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#103], was: [<unreferenced>] (initialized)
| 2009-10-20 12:18:52,396 DEBUG .hibernate.event.def.AbstractFlushingEventListener - Flushed: 2 insertions, 0 updates, 0 deletions to 2 objects
| 2009-10-20 12:18:52,396 DEBUG .hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
| 2009-10-20 12:18:52,398 DEBUG org.hibernate.pretty.Printer - listing entities:
| 2009-10-20 12:18:52,398 DEBUG org.hibernate.pretty.Printer - org.jbpm.pvm.internal.lob.Lob{blob=org.hibernate.lob.SerializableBlob@139160e, dbid=104, dbversion=0}
| 2009-10-20 12:18:52,398 DEBUG org.hibernate.pretty.Printer - org.jbpm.pvm.internal.repository.DeploymentImpl{timestamp=0, resources=[org.jbpm.pvm.internal.lob.Lob#104], name=null, objectProperties=nul
| l, state=active, dbid=103}
| 2009-10-20 12:18:52,401 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2009-10-20 12:18:52,401 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
| 2009-10-20 12:18:52,401 DEBUG org.hibernate.SQL - insert into JBPM4_DEPLOYMENT (NAME_, TIMESTAMP_, STATE_, DBID_) values (?, ?, ?, ?)
| 2009-10-20 12:18:52,401 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
| 2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.Expectations - success of batch update unknown: 0
| 2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.ConnectionManager - skipping aggressive-release due to flush cycle
| 2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2009-10-20 12:18:52,403 DEBUG org.hibernate.SQL - insert into JBPM4_LOB (DBVERSION_, BLOB_VALUE_, DBID_) values (?, ?, ?)
| 2009-10-20 12:18:52,404 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
| 2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.Expectations - success of batch update unknown: 0
| 2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.ConnectionManager - skipping aggressive-release due to flush cycle
| 2009-10-20 12:18:52,407 DEBUG e.persister.collection.AbstractCollectionPersister - Inserting collection: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#103]
| 2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2009-10-20 12:18:52,407 DEBUG org.hibernate.SQL - update JBPM4_LOB set DEPLOYMENT_=?, NAME_=? where DBID_=?
| 2009-10-20 12:18:52,409 DEBUG e.persister.collection.AbstractCollectionPersister - done inserting collection: 1 rows inserted
| 2009-10-20 12:18:52,409 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
| 2009-10-20 12:18:52,410 DEBUG org.hibernate.jdbc.Expectations - success of batch update unknown: 0
| 2009-10-20 12:18:52,410 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2009-10-20 12:18:52,411 DEBUG org.hibernate.jdbc.ConnectionManager - skipping aggressive-release due to flush cycle
| 2009-10-20 12:18:52,412 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
| 2009-10-20 12:18:52,412 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261205#4261205
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261205
16 years, 8 months
[JBoss OSGi Users] - Re: JBossOSGi vs. Pax-Runner/Pax-Exam
by thomas.diesler@jboss.com
anonymous wrote :
| And both are working with an remote framework. Remote meaning that the Client Runner and Osgi Framework are running in separate processes.
|
Husky supports OSGi testing in a remote container. i.e. You can have a jboss instance running somewhere on the network and test osgi bundle functionality in that remote osgi environment.
For details on the various runtime model see: http://jbossosgi.blogspot.com/2009/06/jboss-osgi-runtime-as-integration.html
anonymous wrote :
| we consider that all the tests have to run the osgi container
|
This is ok for isolated functional tests, but not for integration tests, where osgi bundles need to interact with container provided services.
anonymous wrote :
| I would even say that Pax Exam adds more to the table because you can configure the osgi framework use for tests for things like system properties, boot delegation packages, system packages, provisioned bundles, ... IT may be that Husky supports that too but was not obvious from the blog post.
|
Husky does not assume that a framework needs to be configured/started in any way. It is the responsibility of the TestCase or test environment to provide the Framework. A Husky Test gets the system BundleContext injected.
The Service Provider Interface (SPI) takes care of the abstraction of the Framework. This includes configuration and also its embedded/remote nature
http://jbmuc.dyndns.org/jboss-osgi/userguide/html/ChapDeveloperGuide.html...
http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...
I agree that this is not clear enough from the blog post and probably also not covered sufficiently in the user guide.
We can fix that documentation aspect in Beta5:
https://jira.jboss.org/jira/browse/JBOSGI-185
anonymous wrote :
| why don't you join us? Pax Exam provides an extension point where you can plug in another test container , beside pax runner based one. Implement that based on JBoss and just have it in the classpath and your pax exam tests will be running in JBoss.
|
Currently, I can parametrize the jboss osgi testrun like this
| mvn -Dtarget.container=jboss520 -Dframework=felix test
|
For details please see
http://jbmuc.dyndns.org/jboss-osgi/userguide/html/ChapProvidedExamples.ht...
This is part of the key requirements I have on the testing framework used by JBoss OSGi.
Additionally, as we move forward towards integration with existing jboss services. It will become necessary that we can deploy/test various other components. The test framework will have to support the (remote) deployment/access of EJB3, WebBeans, MBeans, ESB endpoints, etc.
This might not all be on the PAX-Exam roadmap. Neither is it clear that it even should be.
anonymous wrote :
| Actually the collaboration could be batter as we can work on adding support for JBoss in Pax Runner. This will mean that jboss can be easy started and used by pax runner users, directly used in Pax Exam
| anonymous wrote :
| |
| | This has a dependency on the JBoss Embedded project. It is not as easy as you might think to bootstrap JBoss as part of a unit test and it can certainly not be done as part of every TestCase setup. In this respect, what applies to an OSGi Framework does not necessarily also apply to a whole Application Server.
| |
| | Again, strategically it is important that whatever test framework JBoss OSGi uses - it must support integration aspects with a (remote) instance of the JBoss Application Server.
| |
| | It is mandatory that we actually test what JBoss OSGi users do (i.e. they deploy OSGi bundles in JBoss).
| |
| | What appears like a big overlap between Husky and PAX-Exam now, might turn out to be not so critical if you consider the scope of test functionality that JBoss OSGi actually has. i.e. we test much more than OSGi bundle functionality in a Framework that runs in a different process.
| |
| | Nevertheless, I am also open towards cooperation and it would be good if JBoss OSGi could simply "use" a test framework, without being its primary maintainer.
| |
| | Thanks for your feedback
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261201#4261201
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261201
16 years, 8 months