[JNDI/Naming/Network] - MBean's JNDI attribute times out at JBoss startup but works
by pisce
Hello,
I'm facing a curious problem, trying to expose Hibernate's statistics through JMX. I updated jboss-service.xml to add the following:
| <mbean code="org.hibernate.jmx.StatisticsService"
| name="jboss.monitoring:service=StatisticsService,name=xxxStatisticsService">
|
| <attribute name="StatisticsEnabled">true</attribute>
| <attribute name="SessionFactoryJNDIName">persistence.units:ear=xxx.ear,jar=xxx.jar,unitName=xxx_pu</attribute>
|
| </mbean>
|
When JBoss AS starts, I receive the following error:
16:36:46,532 INFO [Server] Core system initialized
| 16:36:53,188 ERROR [StatisticsService] Error while accessing session factory with JNDI name persistence.units:ear=xxx.ear,jar=xxx.jar,unitName=xxx_pu
| javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
| at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1465)
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1594)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.hibernate.jmx.StatisticsService.setSessionFactoryJNDIName(StatisticsService.java:67)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:136)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:103)
| at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:76)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:461)
| at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)
| at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:703)
| at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:332)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:462)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.install(Unknown Source)
| at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:508)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.net.SocketTimeoutException: Receive timed out
| at java.net.PlainDatagramSocketImpl.receive0(Native Method)
| at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
| at java.net.DatagramSocket.receive(DatagramSocket.java:712)
| at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1435)
| ... 57 more
|
Please note that this occur every time for this JNDI attribute, but not if I set a simple value (i.e. a plain string with no special char).
However, once the server is started, I can access my MBean through the JMX console, set the SessionFactoryJNDIName attribute with the same value, and then see updated Hibernate statistics as I first expected. I double-checked this value, which seems to be the real JNDI name for my Hibernate SessionFactory.
I guess this is a JBoss AS issue, but how can I solve this, or work around this?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213419#4213419
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213419
17 years, 1 month
[Installation, Configuration & DEPLOYMENT] - Re: Freeze and Server killed without any logs
by erache
I don't really know the configuration of the virtual machine. I just know the information by accessing by ssh:
uname -a:
| Linux *** 2.6.27-11-server #1 SMP Thu Jan 29 20:13:12 UTC 2009 x86_64 GNU/Linux
|
So yes it's a multiprocessing machine
free:
| total used free shared buffers cached
| Mem: 1024224 175512 848712 0 3992 33020
| -/+ buffers/cache: 138500 885724
| Swap: 0 0 0
|
So I think I don't really have a problem for memory usage
And my JVM args are:
JBoss Bootstrap Environment
|
| JBOSS_HOME: /apps/jboss-5.0.1.GA
|
| JAVA: /usr/lib/jvm/java-6-sun/bin/java
|
| JAVA_OPTS: -Dprogram.name=run.sh -server -Xms256m -Xmx1024m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true
|
| CLASSPATH: /apps/jboss-5.0.1.GA/bin/run.jar:/usr/lib/jvm/java-6-sun/lib/tools.jar
|
Sorry if I didn't give much information first... but actually, I didn't know what to do exactly... Because I don't have much information... no logs... no trace :'(
So I will have a look to the memory usage during launching... Do you know a good tool to watch the jvm memory usage ?!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213413#4213413
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213413
17 years, 1 month
[Installation, Configuration & DEPLOYMENT] - Re: Multiple instances from single EAR/WAR
by PeterJ
Here are some issues I can think of (other than those you already mentioned like supplying unique contexts), off the top of my head:
1) You will have to ascertain that the JNDI names for your EJBs (and anything else that needs JNDI names, such as the data source) are unique between the apps. This should not be an issue for the EJBs if you go with the default jndi naming convention of ear-name/ejb-name/local (or ../remote)
[Note that this item has the built-in assumption that you will have to rename the EAR file for each app...]
2) Each app will have to adjust how it looks up EJBs to use up the correct "ear-name" section of the JNDI name. This could be done via a properties file.
3) You will have to configure a loader repository for each app - this will keep the classloaders separate and ensure proper scoping of the classes (each ear gets its own copy of the classes)
4) You will need a *-ds.xml file for each app, each with its own custom JNDI name and the app will have to be configured to use the new name. Given that you are using Seam, I am not sure if there are mechanisms to programmatically alter the Hibernate/JPA configuration or if you will have to modify the persistence.xml file before deploying. (If you use Ant to deploy, you could modify the persistence.xml file at deploy time. Considering that you already have to modify the application.xml file to supply a unique context, this might not be all that big of a hardship.)
Those are the things I can think of. But it is usually the unforeseen issues that end up getting to you.
Good luck!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213410#4213410
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213410
17 years, 1 month