[JBoss Cache: Core Edition] - How to replace CacheJmxWrapper with JmxRegistrationManager i
by alex-jboss69
I am using Jboss Cache Core 3.1.0 and Jboss 5.1.
Here is what I need to do:
1 - Deploy the cache using a xml "-jboss-beans.xml" descriptor.
2 - This descriptor must register the cache with the MBeanServer.
3 - Retrieve the cache in my code so I am able to use it.
I am currently doing this as described in section 5.4.2.2 of the documentation ("JMX-Based Deployment in JBoss AS (JBoss AS 5.x)").
<!-- JMX Management -->
| <bean name="ExampleCacheJmxWrapper" class="org.jboss.cache.jmx.CacheJmxWrapper">
| <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=myCache", exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, registerDirectly=true)</annotation>
|
| <constructor>
| <parameter><inject bean="ExampleCache"/></parameter>
| </constructor>
| </bean>
|
Then I retrieve the cache using the following code:
MBeanServer server = MBeanServerLocator.locateJBoss();
| ObjectName on = new ObjectName("jboss.cache:service=myCache");
| @SuppressWarnings("unchecked")
| CacheJmxWrapperMBean<Object, Object> cacheWrapper = (CacheJmxWrapperMBean<Object, Object>) MBeanServerInvocationHandler.newProxyInstance(server, on, CacheJmxWrapperMBean.class, false);
| Cache cache = cacheWrapper.getCache();
It works, but I am using the CacheJmxWrapper and CacheJmxWrapperMBean classes, which are deprecated. The java doc says that the JmxRegistrationManager should be used instead. Can anyone help with that ? The documentation is out of date.
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237689#4237689
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4237689
17 years, 1 month
Re: problem with calling ssl web service
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=17180 Posted on behalf of a User
did u solve this problem
In Response To:
Hello all,
I've successfully deploy jboss web service using ssl. But when calling this ssl web service from standalone client, i got error at client side as follow:
Exception in thread "main" javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message
| at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:304)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:242)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
| at $Proxy10.sslMethod(Unknown Source)
| at jb.secure.ws.client.TestMain.main(TestMain.java:26)
| Caused by: java.io.IOException: Could not transmit message
| at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:192)
| at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:322)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:230)
| ... 4 more
| Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
| at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:332)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:135)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.Client.invoke(Client.java:1550)
| at org.jboss.remoting.Client.invoke(Client.java:530)
| at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:171)
| ... 7 more
| Caused by: org.jboss.ws.WSException: Invalid HTTP server response [401] - Unauthorized
| at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:72)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:472)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:304)
| ... 12 more
|
what does it mean, and how to solve this? Please help me.
Thanks.
17 years, 1 month
[Installation, Configuration & DEPLOYMENT] - Re: Classloader issues in JBoss 5.0.0
by Tarantul
Thank you for this tip. Unfortunately the error is not resolved.
I removed the following lines out of the jboss-web.xml:
<class-loading>
| <loader-repository>reportal.loader:loader=reportal.war
| <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
| </loader-repository>
| </class-loading>
Then I have created the jboss-clasloading.xml with following content:
<?xml version="1.0" encoding="UTF-8"?>
|
| <classloading xmlns="urn:jboss:classloading:1.0"
| name="reportal.war"
| domain="MyWar_Domain"
| export-all="NON_EMPTY"
| import-all="false">
| </classloading>
Then I get the same error regarding a SAX parser:
| ...
| 2009-06-15 16:29:56,863 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/reportal
| 2009-06-15 16:29:56,863 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] (HDScanner) XML error parsing: context.xml
| org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
| at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
| at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:549)
| at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:536)
| at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
|
| ...
|
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
| at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:56)
| at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
| ... 68 more
| Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
| at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
| ... 70 more
| ...
|
After remowing the xercesImpl the application can be deployed, but then I get a runtime exception while using CollectionUtils.isNotEmpty(...).
It seems like the commons-collections.jar from JBoss is being used and that it is a version prior to 3.2, where this isNotEmpty-method had been introduced. The appropriate commons-collections-3.2.jar is in the WEB-INF/lib directory of my application. Anyway the application was previously running in Tomcat without any problems.
2009-06-15 16:52:22,136 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/reportal].[action]] (http-127.0.0.1-8080-4) Servlet.service() for servlet action threw exception
| java.lang.NoSuchMethodError: org.apache.commons.collections.CollectionUtils.isNotEmpty(Ljava/util/Collection;)Z
Thats why I think, that the JBoss libs are still loaded before the application libs.
Am I doing something wrong or is there some other possibility?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237679#4237679
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4237679
17 years, 1 month