[EJB 3.0] - Improvement for org.jboss.ejb3.embedded.EJB3StandaloneBootst
by jc7442
When we start scanClasspath method, EJB3StandaloneBoostrap class defines a set of ignoredJars. These jars are not scan for deploy.
ignoredJars is public static, consequently we can add some of our jars in the list (such as junit, jdbc driver, ...)
When using build tools such as maven jars are named with - for example junit-3.8.2.jar. If we have added junit-3.8.2.jar in the set of jar to ignore, when we will migrate to next junit version we will have to update the set. When we have a lot of dependency the risk is to forget some librairies.
A nice features will be that list of jars to ignore contains regular expression for jar (such has junit*.jar: ".*.junit-\\d.\\d.\\d.jar").
Then it will be possible to list all our jars without taking care about the release. And when we will change the release of our components, it will not affect our list of jar to ignore.
Code may looks like:
protected boolean accept(String file) {
| for (String pattern : ignoredJars) {
| if (file.matches(pattern)) {
| return false;
| }
| }
| return true;
| }
|
| public static HashSet<String> ignoredJars = new HashSet<String>();
|
| static {
| ignoredJars.add(".*.junit.*.jar");
| ignoredJars.add(".*.commons-.*.jar");
| ignoredJars.add(".*.jboss-.*.jar");
| ...
| }
| public static void scanClasspath()
| {
| //if (ignoredJars.contains(fp.getName())) continue;
| if (!accept(fp.getName())) continue;
| ...
|
| ...}
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961503#3961503
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961503
19 years, 9 months
[Management, JMX/JBoss] - [JBOSS 4] Pb Schedulers
by bobunny
Hi every one,
I don't know if it's the good group to post my problem ...
Anyway, I have migrated from a Jboss application Server 3.0.3 release to a 4.0.3 release and i encountered some troubles in my applications.
To give a simple example, I have severals schedulers. We can take 2 of them for example. In the release 3.0.3, the different schedulers runs independently, due to the use of distinct thread i think.
Now with the 4.0.3 release, they run one by one. So it's a problem for me because i need them to run simulneously. I don't know how to configure that.
Here some logs from the 3.0.3 release :
| 2006-07-27 18:15:00,004 INFO [jpea.dataimport.equilend.CompareReport] [Thread-35] No remote file found
| 2006-07-27 18:16:00,003 INFO [jpea.dataimport.equilend.CompareReport] [Thread-32] No remote file found
| 2006-07-27 18:17:00,004 INFO [jpea.dataimport.equilend.CompareReport] [Thread-30] No remote file found
| 2006-07-27 18:18:00,005 INFO [jpea.dataimport.equilend.CompareReport] [Thread-31] No remote file found
We can notice that for each call, a different thread is used [Thread-XX]. So i suppose that a pool of thread is used here.
Now in the 4.0.3 release, i have something like this :
2006-07-27 18:15:35,802 INFO [jpea.dataimport.equilend.CompareReport] [Timer-2] No remote file found
| 2006-07-27 18:16:35,762 INFO [jpea.dataimport.triparty.jpmorgan.JPMorganFileImporter] [Timer-2] No remote file. 0 local file(s).
| 2006-07-27 18:16:35,813 INFO [jpea.dataimport.equilend.CompareReport] [Timer-2] No remote file found
Here we can notice [Timer-2]. So when 2 process must be launched at the same time, [Timer-2] runs the first of them, and once finished, runs the second.
Does anyone know how to configure JBOSS 4.0.3 to use different threads to run my schedulers?
Thanks for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961501#3961501
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961501
19 years, 9 months
[Beginners Corner] - Integrating ActiveMQ with Jboss4
by cosjav
Hi,
I am relatively new to JMS and have been looking to migrate our current JBossMQ implementation of JMS to ActiveMQ and at the same time move from using JBoss 3.2.3 to JBoss 4.0.4.
Our product is deployed over two servers whereby MDBs deployed on server1 will write to queues located on server2 which server2 will then read from. Server2 also writes to queues located on itself that server1 will read from. Finally server1 also has some local queues that it writes to and reads from (accessed by server1 only).
This above-mentioned setup is working perfectly fine with the JBossMQ implementation of JMS and the only reason why we are migrating to ActiveMQ is because JBossMQ doesnt support indexing on message selectors (i.e. when a queue that has multiple receivers, which receive messages based on a msg selector, grows large with messages that dont match a particular receiver, performance degrades significantly).
Now the question I'm asking is a newbie one in relation to MDBs reading from remote JMS queues. It was my understanding that to achieve this one would have to follow something similar to: http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureAnMDBToTalkToARem...
Which is pretty much identical to the way we have set up with JBossMQ. But when it comes to ActiveMQ I couldnt find any samples that show me how to do this (the ActiveMQ Jboss Integration Guide seems to take a different approach thats not for remote queue access). Does this mean there is another way to do it? (btw, I will also post this on the ActiveMQ forums but wanted to get an idea from the Jboss community as to whether there are better/different ways of doing this)
I will appreciate any guidance (even RTFM advice but with references please). Like what should I read first, and what comes next, etc... because at the moment there seems to be loads of information that I cant make much sense of in terms what links with what.
Thanks,
cosjav
P.S the attempts I have made so far are shown below:
I changed the server1 JMSProviderLoader (contained in a file named jms-providers-service.xml in deploy/jms) details from:
<server>
| <!--
| JMS Providers to access server2 queues
| -->
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=RemoteJBossMQProvider_server2">
| <attribute name="ProviderName">RemoteJMSProvider_server2</attribute>
| <attribute name="ProviderUrl">jnp://server2:1099</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attribute>
| <attribute name="QueueFactoryRef">UIL2XAConnectionFactory</attribute>
| <attribute name="TopicFactoryRef">UIL2XAConnectionFactory</attribute>
| </mbean>
|
| </server>
to
<server>
| <!--
| JMS Providers to access server2 queues
| -->
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=RemoteActiveMQProvider_server2,server=server2">
| <attribute name="ProviderName">RemoteJMSProvider_indium</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
| <!--<attribute name="QueueFactoryRef">ConnectionFactory</attribute>-->
| <attribute name="QueueFactoryRef">ActiveMQConnectionFactory</attribute>
| <attribute name="TopicFactoryRef">ActiveMQConnectionFactory</attribute>
| <attribute name="Properties">
| java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
| java.naming.factory.url.pkgs=org.jnp.interfaces
| java.naming.provider.url=server2:1099
| </attribute>
| </mbean>
| </server>
|
(I think I have set the connection factory incorrectly above because I'm getting exceptions saying "javax.naming.NameNotFoundException: ActiveMQConnectionFactory")
Then I changed jms-ds.xml (in deploy/jms) on server1 from:
<tx-connection-factory>
| <jndi-name>RemoteJmsXA_server2</jndi-name>
| <xa-transaction/>
| <track-connection-by-tx>true</track-connection-by-tx>
| <adapter-display-name>JMS Adapter</adapter-display-name>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/RemoteJMSProvider_server2</config-property>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
| <security-domain-and-application>RemoteJmsXA_server2_Realm</security-domain-and-application>
| <max-pool-size>100</max-pool-size>
| </tx-connection-factory>
|
to
<tx-connection-factory>
| <jndi-name>RemoteJmsXA_server2</jndi-name>
| <xa-transaction/>
| <track-connection-by-tx/>
| <adapter-display-name>JMS Adapter</adapter-display-name>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/RemoteJMSProvider_server2</config-property>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
| <security-domain-and-application>RemoteJmsXA_server2_Realm</security-domain-and-application>
| <max-pool-size>100</max-pool-size>
| <rar-name>activemq-ra-4.0.1.rar</rar-name>
| <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
| </tx-connection-factory>
|
(this was changed based on the ActiveMQ sample)
Finally I changed a the queue definitons from:
<mbean code="org.jboss.mq.server.jmx.Queue"
| name="jboss.mq.destination:service=Queue,name=queue1">
| <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
| </mbean>
to
<mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=queue1">
| <attribute name="JNDIName">queue/queue1</attribute>
|
| <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.1.rar'</depends>
| <attribute name="Type">javax.jms.Queue</attribute>
| <attribute name="Properties">PhysicalName=queue.queue1</attribute>
| </mbean>
|
I fiddled around with some other configs too but it'll make my post too long if I show all those...
I'm clearly missing a link somewhere because after all these changes I am getting:
java.lang.ClassCastException
| at org.jboss.mq.SpyQueueReceiver.<init>(SpyQueueReceiver.java:42)
| at org.jboss.mq.SpySession.createReceiver(SpySession.java:689)
|
whenever I try to create a receiver (and I think its the same for creating a sender too)
Thanks again...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961500#3961500
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961500
19 years, 9 months