[JBoss AS 7 Development] - JMX-Console Alternative on JBoss 7.x
by Thomas Goettlich
Thomas Goettlich [https://community.jboss.org/people/ThomasGo] created the discussion
"JMX-Console Alternative on JBoss 7.x"
To view the discussion, visit: https://community.jboss.org/message/716253#716253
--------------------------------------------------------------
Hi,
we're currently in the process to switch our projects and infrastructure from JBoss 4.2.3 (it's +really+ old, I know) to JBoss 7.x.
We have a couple of management services that we used to invoke through the old JMX-Console, e.g. in order to manually clear and rebuild caches, etc.
The beauty of that approach was that we only needed to write an MBean to expose the functionality we needed.
The problem is that in JBoss 7.x there seems to be no JMX-Console (yet).
I found a suggestion to build a JMX-Console like interface using JSF and a managed bean instead of the MBeans
but that would still require some work in order to provide the interface for each management method as well as the menu to access those methods (there are quite a lot and I'd like to have them grouped somehow).
Additionally, we'd still have to use our MBeans, although they'd now be annotated with @Singleton rather than @Service.
Thus we'd have to add at least two classes now: the MBean/Singleton and the JSF Managed Bean.
So here's my question: is there any less intrusive/expensive way to expose those management methods in a web console?
Additionally, does anyone know if and when there will be a new version of the JMX-Console?
Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/716253#716253]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss ESB Development] - Improving Spring support using annotations in annotated ESB actions.
by Duncan Doyle
Duncan Doyle [https://community.jboss.org/people/McCloud] created the discussion
"Improving Spring support using annotations in annotated ESB actions."
To view the discussion, visit: https://community.jboss.org/message/715379#715379
--------------------------------------------------------------
Hi guys,
There is still a fair amounf of JBoss ESB (and SOA-P) users that use a lot of Spring in their development. Now, I know that we support Spring through our AbstractSpringAction, however this has a number of disadvantages:
- You have to extend a JBoss ESB class, which makes the action harder to unit test.
- The AbstractSpringAction creates an applicationcontext itsetf. This means that when you require 3 Spring-based actions in your pipeline, or if you define multiple services in a jboss-esb.xml which all use a AbstractSpringAction, you end up with multiple Spring ApplicationContexts loaded.
The introduction of annotated ESB actions made writing, and especially testing, of ESB actions a lot easier. However, you can't use that approach when you want to use Spring. So I've been working out a way to improve our support for Spring. The basic idea is this:
- We define a JBoss MicroContainer bean which can be loaded via a 'jboss-beans.xml' file and which is responsible for loading a Spring ApplicationContext. The bean can be based on Spring's own ContextLoaderListener and ContextLoader beans (which are responsible for loading an ApplicationContext in web environment). We actually create a sort of EsbContextLoader class. I've been working on an implementation and it's almost finished. We deploy this bean via, for example, a 'spring-jboss-beans.xml' file in the '.esb' archive, just like any other resource we require (e.g. JBoss Messaging Queue). We can define a dependency on this MC bean via the deployment.xml.
- We create a new annotation, for example something like @InjectSpringBean(bean="mySpringBean"). The implementation of this annotation will either use the new EsbContextLoader bean or Spring's SingletonBeanFactoryLocator mechanism to retrieve the ApplicationContext of the current .esb archive and inject the bean into the action.
The advantages of this approach are:
- One only has to define a single application context for a service or .esb archive.
- One can inject Spring beans in POJO actions, which eases testing.
Overall, the integration will looks a lot better in my opinion.
Now, my problem is that I have not yet found a way to implement a new (custom) annotation. The BeanContainerAction (which is the base action for annotated actions) is loaded by the ActionProcessingPipeline, and I have not yet found a way to insert my own implementation (subclass) of BeanContainerAction which can support my new annotation. Neither have I found a way to insert, for example, a subclass of ActionProcessingPipeline which would be able to load a custom 'BeanContainerAction'.
So my questions are:
- Do you like my new idea for better Spring support? Is it something that we want to include and support in JBoss ESB and SOA-P?
- Can someone help me with defining new annotation's, hopefully by making the annotation support a bit more extendable?
Cheers,
Duncan
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/715379#715379]
Start a new discussion in JBoss ESB Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss AS 7 Development] - Class Loading Issue with HornetMQ and JBoss 7.0.2
by Ashok Madhavan
Ashok Madhavan [https://community.jboss.org/people/Ashok_94] created the discussion
"Class Loading Issue with HornetMQ and JBoss 7.0.2"
To view the discussion, visit: https://community.jboss.org/message/715369#715369
--------------------------------------------------------------
Hi All,
I am working on a JBoss 7.0.2 instance. Our app is a war and messages are dropped into the queue. This works fine. But when we read it via a listener, the system throws an exception. It is looking for a class which is present in the WEB-INF/classes.
I understand that the module classloader (if i am right it is HornetMQ) is not able to see this application class and throwing up. I dont want my application class to be part of the server lib. That class living within the war is the best place.
The exception is : javax.jms.JMSException: com.yyy.TransportMessage from [Module "org.hornetq:main" from local module loader @238b8914 (roots: /Users/xxx/jboss/multi/jboss-as-7.0.2.Final/modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)
at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:71) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158) at com.xxx.MessageReceiver.handleObjectMessage(NSMessageReceiver.java:72)
at com.xxx.jms.JMSListener.onMessage(JMSListener.java:1540) at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91)
What should i do to make this work. thanks a lot in advance for the help :)
regards
ashok
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/715369#715369]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss AS 7 Development] - Re: URL-Protocol Handler doesn't work
by Daniel Straub
Daniel Straub [https://community.jboss.org/people/dastraub] created the discussion
"Re: URL-Protocol Handler doesn't work"
To view the discussion, visit: https://community.jboss.org/message/715180#715180
--------------------------------------------------------------
Hi David
now I came back to this thread (because we're porting a large application to AS 7), and I use the following solution :
In a self developed extension we do some stuff during the deployment, and here also we add our URLStreamHandlerFactory :
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
URL url = module.getExportedResource("META-INF/services/java.net.URLStreamHandlerFactory");
if (url != null) {
log.info("registerURLStreamHandlerFactoryModule " + module.getIdentifier());
Module.registerURLStreamHandlerFactoryModule(module);
}
}
Ok, thar solves the half part.
Unfortunatly, there is no method for unregister this module during undeploy.
Is it possible to add this method to the Module ?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/715180#715180]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months