[Management, JMX/JBoss] - Errors running multiple applications inside one Jboss 3 serv
by ben-online
Errors running multiple applications inside one Jboss 3 server instance (multiple application EARÂÂs inside one anonymous wrote : ÂÂ$JBOSS_HOME\Server\MyApps\ÂÂdirectory).
We are developing multiple J2EE applications that run within their own Jboss server instance, but now we have a Case to deploy them all inside one Jboss server instance that I mentioned above.
Because we have developed the applications independently with the idea to run in separated JBoss server instances, a lot of our applications are using different versions of third party JARÂÂs.
By deploying them all in one Jboss server instance will give us the problem of getting class version conflicts during class loading, because application A is using common.whaterver-1.0 jar and application B is using common.whatever-2.0.jar and that works perfectly if they are deployed inside separated server instances, but by putting them together we have to isolated every class/JAR version by letting Jboss know which class to use for which application.
Jboss has the option to configure isolated class loader, but we can only configure them for one namespace. (Example: com.mycompany.crm.web) but how do we do that if we use multiple versions of third party JARÂÂs that have other namespace like org.apach. and org.hibernate etc. and application A is using hibernate3 and application B is using hibernate3.2.
Is it possible to configure this kind of scenarios, or do we have to line-out all our Applications to use the same kind of third party JAR versions? If so than JBoss 3 or newer has not the functionality to run multiple Applications with different class versions inside one Jboss server instance, and the only option would be by lining-out all Applications to run the same third-party JAR versions.
Please let me know if Im wrong, and give me the solution to configure this for JBoss 3 or higher.
Documentations that we already found are:
http://www.jboss.org/community/wiki/jbossclassloadingusecases
http://www.jboss.org/community/wiki/ClassLoadingConfiguration
But how can we do it if we have multiple namespaces and class version that need to use the same class-loading repository for application A and a other class-loading repository for application B etc.?
Thanks Regards, Ben.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249252#4249252
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249252
16 years, 9 months
[Management, JMX/JBoss] - Errors running multiple applications inside one Jboss 3 serv
by ben-online
Errors running multiple applications inside one Jboss 3 server instance (multiple application EARâÂÂs inside one âÂÂ$JBOSS_HOME\Server\MyApps\â directory).
We are developing multiple J2EE applications that run within their own Jboss server instance, but now we have a Case to deploy them all inside one Jboss server instance that I mentioned above.
Because we have developed the applications independently with the idea to run in separated JBoss server instances, a lot of our applications are using different versions of third party JARâÂÂs.
By deploying them all in one Jboss server instance will give us the problem of getting class version conflicts during class loading, because application A is using common.whaterver-1.0 jar and application B is using common.whatever-2.0.jar and that works perfectly if they are deployed inside separated server instances, but by putting them together we have to isolated every class/JAR version by letting Jboss know which class to use for which application.
Jboss has the option to configure isolated class loader, but we can only configure them for one namespace. (Example: com.mycompany.crm.web) but how do we do that if we use multiple versions of third party JARâÂÂs that have other namespace like org.apach. and org.hibernate etc. and application A is using hibernate3 and application B is using hibernate3.2.
Is it possible to configure this kind of scenarios, or do we have to line-out all our Applications to use the same kind of third party JAR versions? If so than JBoss 3 or newer has not the functionality to run multiple Applications with different class versions inside one Jboss server instance, and the only option would be by lining-out all Applications to run the same third-party JAR versions.
Please let me know if IâÂÂm wrong, and give me the solution to configure this for JBoss 3 or higher.
Documentations that we already found are:
http://www.jboss.org/community/wiki/jbossclassloadingusecases
http://www.jboss.org/community/wiki/ClassLoadingConfiguration
But how can we do it if we have multiple namespaces and class version that need to use the same class-loading repository for application A and a other class-loading repository for application B etc.?
Thanks Regards, Ben.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249250#4249250
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249250
16 years, 9 months
[Installation, Configuration & DEPLOYMENT] - sar deployment problem on jboss-5.1.0.GA
by bangalore09
I am trying to deploy my ear file on jboss-5.1.0.GA which is working fine on jboss-4.2.2.GA is throwing deployment exception.
ear
|---
|---ejb jars
|---war
|---sar
jboss-service.xml contents:
| <mbean code="com.ecentives.harvester.business.reader.InboundMessageReader"
| name="harvester:name=imap1,service=inbound-message-reader">
| <attribute name="Imapserver">1</attribute>
| <attribute name="InboxFolder">Inbox</attribute>
| <attribute name="UnmanageableFolder">Unmanageable</attribute>
| <depends>jboss.messaging.destination:service=Queue,name=InboundMessageQueue</depends>
| <depends>jboss.j2ee:module=stagertoqueue.jar,service=EjbModule</depends>
| </mbean>
|
| <mbean code="org.jboss.varia.scheduler.SingleScheduleProvider"
| name="jboss:name=p1,service=HASingleScheduleProvider">
| <depends>jboss:service=${jboss.partition.name:DefaultPartition}</depends>
| <depends>jboss:service=ScheduleManager</depends>
| <depends>harvester:name=imap1,service=inbound-message-reader</depends>
| <depends>jboss.ha:service=HASingletonDeployer,type=Barrier</depends>
| <attribute name="ScheduleManagerName">jboss:service=ScheduleManager</attribute>
| <attribute name="TargetName">harvester:name=imap1,service=inbound-message-reader</attribute>
| <attribute name="TargetMethod">readInboundMessages()</attribute>
| <attribute name="DateFormat"></attribute>
| <attribute name="StartDate">NOW</attribute>
| <attribute name="Period">300000</attribute>
| <attribute name="Repetitions">-1</attribute>
| </mbean>
|
sar is failed to deploy. I have SingleScheduleProvider service. Below is the error stacktrace
19:51:41,068 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE
PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "harvester:service=inbound-message-reader1" is missing the following dependencies:
Dependency "jboss.j2ee:ear=hv.ear,jar=stagertoqueue.jar,service=EjbModule" (should be in state "
Create", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=hv.ear,jar=stagertoqueue.
jar,service=EjbModule' **")
Deployment "jboss:name=p1,service=HASingleScheduleProvider" is missing the following dependencies:
Dependency "jboss:service=harvester" (should be in state "Create", but is actually in state "**
NOT FOUND Depends on 'jboss:service=harvester' **")
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:ear=hv.ear,jar=stagertoqueue.jar,service=EjbModule" is in error due to the
following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:ear=hv.ear,jar=stagertoqueue.jar,service=Ej
bModule' **
Deployment "jboss:service=harvester" is in error due to the following reason(s): ** NOT FOUND Depe
nds on 'jboss:service=harvester' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873
)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainD
eployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Scheduled
ThreadPoolExecutor.java:65)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Schedule
dThreadPoolExecutor.java:142)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
oolExecutor.java:166)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Please help me.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249246#4249246
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249246
16 years, 9 months
[JBoss Messaging] - Messaging and transactions together
by damian.sinczak
I have a great problem with understanding transactions along with messaging. What I have to do is to write a Servlet that will receive a lot of data, e.g. POST request with 100000 numbers in content, I have to parse those numbers and do both:
- Save them into database (I'm using JPA with Hibernate below)
- For every number I have to send message on queue with it.
On the other site there are Message Driven Beans (MDB) that consumes messages, takes numbers from them and do something with those numbers (e.g. send them to another system).
What My problem is that I want it to happen in two steps
1 - Numbers parsing, persisting into database and sending messages with them (in one transaction, because if any of the numbers in content is corrupted I have to roll back both saving data to database and sending messages)
2 - After everything have been saved and send (there was a transaction commit) MDBs start to consume messages and process them and reding also the same numbers from database (in second separate transaction managed by EJB container, because if anything during processing message goes wrong I want it to go back on queue), the same numbers that were saved in previous transaction.
What I can't do is that I can not force QueueSession (Even tried XAQueueSession) to work with JTA user transaction. This is what I do:
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
| IOException {
| UserTransaction userTransaction = null;
|
| QueueConnectionFactory jmsConnectionFactory = null;
| MessageProducer jmsProducer = null;
| QueueSession jmsSession = null;
| QueueConnection jmsConnection = null;
| Queue jmsSingleNumberQueue = null;
|
| QueueConnectionFactory jmsConnectionFactory =(QueueConnectionFactory) initialContext.lookup(ServiceConstants.CONNECTION_FACTORY_JNDI);
| jmsConnection = jmsConnectionFactory.createQueueConnection();
| jmsSingleMsisdnQueue = (Queue) initialContext.lookup(ServiceConstants.SINGLE_NUMBER_QUEUE_JNDI);
| jmsSession = jmsConnection.createQueueSession(true, Session.SessionTransacted);
| jmsProducer = jmsSession.createProducer(jmsSingleNumberQueue);
|
| userTransaction = (UserTransaction) (new InitialContext())
| .lookup(ServiceConstants.USER_TRANSACTION_JNDI);
|
| userTransaction.begin();
|
| for(...every number in from request content...){
| 1. parse number
| 2. save number to DB
| 3. send message with number
| }
|
| userTransaction.commit();
|
| }
|
This is only sketch so if something is not clear please tell.
When I wrote this code I noticed that JMS session is not a part of user transaction. In other words, when I put some messages on queue they are instantly consumed by MDB. Also in this case where there is jmsSession = jmsConnection.createQueueSession(true, Session.SessionTransacted); I have to commit JMS session by my self. It seams that JMS session do not see or event cooperate with user transaction.
When I used XAQueueSession, commit was made by session but there was other problem, this commit also didn't care about user transaction and messages were consumed instantly after sending, that brought another problem, because User transaction in many cases didn't commit and numbers that were persisted (2. save number to DB) are not visible to MDB and I'm getting NoResultException when I'm trying to retrieve those numbers from DB (they are just not commited yet and MDB (with transaction attribute required) works in another transaction so those numbers are not visible for him).
Maybe I'm misunderstood the concept of JMS and JBoss messaging so please correct me. I would appreciate if you have any ideas how to solve my problem.
P.S
Sorry for my English - learning still in progress.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249245#4249245
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249245
16 years, 9 months