[Installation, Configuration & DEPLOYMENT] - Beanshell - MBean issues
by FrankTheTank
I was just starting to realize the pure coolness of using Beanshell in JBoss when I stumbled over this issue.
I am having some wierd issues with a Beanshell script that is accessing an MBean and trying to call the MBean's methods.
I have written an MBean that works fine and is accessible from the jmx-console and the methods can be executed there.
All methods I want to access are in the interface and I can actually list them in the Beanshell script using reflection.
I just cannot call some of them.
I presume it might be that Beanshell is interpretating get/set/is as my attempt to access one of it's Attributes.
Any one have any ideas?
| import javax.management.*;
| import org.jboss.system.server.*;
| import com.me.ManagerMBean;
| import java.lang.reflect.Method;
|
| try
| {
| MBeanServer mbs = MBeanServerFactory.findMBeanServer(null).get(0);
|
| print ( "MBeanServer : " + mbs );
|
| if (mbs == null )
| {
| return;
| }
|
| ObjectName objectName = new ObjectName("com.me:service=Manager");
|
| ManagerMBean rdm = (ManagerMBean)(MBeanServerInvocationHandler.newProxyInstance(mbs, objectName, ManagerMBean.class, false));
| print ("ManagerMBean : " + rdm);
|
| try
| {
| print ("auto : " + rdm.isAutoupdate() );
|
| }catch ( Throwable t )
| {
| print (t.getCause());
| t.printStackTrace();
| }
|
| }
| catch (Exception e )
| {
| System.out.println("Exception @ Test.MyTask.run() : " + e);
| }
|
| 08:21:48,326 INFO [STDOUT] MBeanServer : org.jboss.mx.server.MBeanServerImpl@a4e743[ defaultDomain='jboss' ]
| 08:21:48,326 INFO [STDOUT] ManagerMBean : MBeanProxy(org.jboss.mx.server.MBeanServerImpl@a4e743[ defaultDomain='jboss' ][com.me:service=Manager])
| 08:21:48,342 INFO [STDOUT] javax.management.AttributeNotFoundException: not found: Autoupdate
| 08:21:48,358 ERROR [STDERR] java.lang.reflect.UndeclaredThrowableException
| 08:21:48,358 ERROR [STDERR] at $Proxy282.isAutoupdate(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 08:21:48,358 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 08:21:48,358 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 08:21:48,358 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
| 08:21:48,358 ERROR [STDERR] at bsh.Reflect.invokeMethod(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.Reflect.invokeObjectMethod(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.Name.invokeMethod(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHMethodInvocation.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHPrimaryExpression.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHPrimaryExpression.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHBinaryExpression.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHArguments.getArguments(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHMethodInvocation.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHPrimaryExpression.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHPrimaryExpression.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHBlock.evalBlock(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHBlock.eval(Unknown Source)
| 08:21:48,358 ERROR [STDERR] at bsh.BSHBlock.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.BSHTryStatement.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.BSHBlock.evalBlock(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.BSHBlock.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.BSHBlock.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.BSHTryStatement.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.Interpreter.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at bsh.Interpreter.eval(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at org.jboss.varia.deployment.BeanShellScript.loadScript(BeanShellScript.java:369)
| 08:21:48,374 ERROR [STDERR] at org.jboss.varia.deployment.BeanShellScript.<init>(BeanShellScript.java:109)
| 08:21:48,374 ERROR [STDERR] at org.jboss.varia.deployment.BeanShellSubDeployer.create(BeanShellSubDeployer.java:153)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| 08:21:48,374 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 08:21:48,374 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| 08:21:48,374 ERROR [STDERR] at $Proxy9.deploy(Unknown Source)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| 08:21:48,374 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| 08:21:48,374 ERROR [STDERR] Caused by: javax.management.AttributeNotFoundException: not found: Autoupdate
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.getAttribute(AbstractMBeanInvoker.java:335)
| 08:21:48,374 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:556)
| 08:21:48,374 ERROR [STDERR] at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:272)
| 08:21:48,374 ERROR [STDERR] ... 50 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138862#4138862
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138862
18 years, 1 month
[JBossWS] - Re: EndPoint problems.. please help
by alessio.soldano@jboss.com
>From the jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml
| <!--
| The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
| element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
|
| If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true.
| If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
|
| If 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>.
| -->
| <property name="webServiceHost">${jboss.bind.address}</property>
| <property name="modifySOAPAddress">true</property>
|
| <!--
| Set these properties to explicitly define the ports that will be used for rewriting the SOAP address.
| Otherwise the ports will be identified by querying the list of installed connectors.
| If multiple connectors are found the port of the first connector is used.
| <property name="webServiceSecurePort">8443</property>
| <property name="webServicePort">8080</property>
| -->
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138861#4138861
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138861
18 years, 1 month
[Installation, Configuration & DEPLOYMENT] - Re: Problem in deplyoing Struts - Hibernate project
by saumesh_kumar
Some snapshot of my Server Log is.
| 2008-03-26 11:04:29,468 INFO [org.apache.struts.util.PropertyMessageResources] Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
| 2008-03-26 11:04:32,718 INFO [STDOUT] strUserName pis
| 2008-03-26 11:04:32,718 INFO [STDOUT] strPassword pis
| 2008-03-26 11:04:32,828 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/SessionFactory
| 2008-03-26 11:04:32,828 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=8ae58a8b18e994580118e99459560000
| 2008-03-26 11:04:33,078 DEBUG [org.hibernate.jdbc.JDBCContext] no active transaction, could not register Synchronization
| 2008-03-26 11:04:33,078 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4941863619903488
| 2008-03-26 11:04:33,078 INFO [STDOUT] Before Sql
| 2008-03-26 11:04:33,078 DEBUG [org.hibernate.impl.SessionImpl] find: select us.strEmpId, us.strUserName from appsrv.forms.frmbns.LoginBean us
| 2008-03-26 11:04:33,125 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {}
| 2008-03-26 11:04:33,125 WARN [org.hibernate.hql.QuerySplitter] no persistent classes found for query class: select us.strEmpId, us.strUserName from appsrv.forms.frmbns.LoginBean us
| 2008-03-26 11:04:33,140 DEBUG [org.hibernate.jdbc.JDBCContext] after autocommit
| 2008-03-26 11:04:33,140 DEBUG [org.hibernate.impl.SessionImpl] after transaction completion
| 2008-03-26 11:04:33,140 INFO [STDOUT] List Size---0
| 2008-03-26 11:04:33,140 INFO [STDOUT] After List Add
| 2008-03-26 11:04:33,140 DEBUG [org.hibernate.impl.SessionImpl] closing session
| 2008-03-26 11:04:33,140 DEBUG [org.hibernate.jdbc.ConnectionManager] connection already null in cleanup : no action
Plz help me to solve this problem.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138851#4138851
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138851
18 years, 1 month