[Management, JMX/JBoss] - XDOCLET tags and MBeans
by pawan1475
Hi,
We are planning to upgrade our application from Jboss 4.0.3 to Jboss 4.0.5.GA and have been experiencing some issues with it. We have lots of mbeans defined in our system, but during the upgrade we are seeing lot of exceptions on accessing the mbeans that have the XDOCLET tag @jmx.managed-attribute. There are no changes to the code except the Jboss upgrade, I am wondering if somebody can help me understand the reason why this is happening. I am seeing MethodNotDefine, IllegalArgument exception (Standard Reflection exception when you invoke a method). The most wierd thing is when i changed the XDOCLET tag to @jmx.managed-operation impact = "INFO" everything works fine on the new Jboss server. Since there is a lot of core code, i am really reluctant to change.
Regards
Pawan Kharbanda
/**
| * MBeanProxySupports
| *
| * Implements MBeanProxy
| *
| * @author westraj
| */
| public class MBeanProxySupports implements MBeanProxy {
| /**
| * Default serial version UID
| */
| private static final long serialVersionUID = 1L;
| private static final String EQUALS = "equals";
| private static final String HASH_CODE = "hashCode";
| private static final String TO_STRING = "toString";
|
| private MBeanServer server = null;
| private String mbeanName;
| private ObjectName objectName = null;
| private int hashCode = -1;
|
| private static int HASHCODE = 0;
| private static final Object lock = "";
|
| /**
| * Constructor
| * @throws MalformedObjectNameException if unacceptable name
| */
| public MBeanProxySupports(MBeanServer server, String mbeanName) throws MalformedObjectNameException {
| super();
| this.server = server;
| this.mbeanName = mbeanName;
| objectName = new ObjectName(mbeanName);
|
| synchronized(lock) {
| hashCode = HASHCODE++;
| }
| }
|
| /* (non-Javadoc)
| * @see cdot.util.MBeanProxy#getMBeanName()
| */
| public String getMBeanName() {
| return mbeanName;
| }
|
| /* (non-Javadoc)
| * @see cdot.util.MBeanProxy#getMBeanServer()
| */
| public MBeanServer getMBeanServer() {
| return server;
| }
|
| /* (non-Javadoc)
| * @see cdot.util.MBeanProxy#invoke(java.lang.String, java.lang.Object[], java.lang.String[])
| */
| public Object invoke(String methodName, Object[] methodParams,
| String[] signature) throws MBeanException {
|
| if (TO_STRING.equals(methodName)) {
| return objectName.toString();
| } else if (HASH_CODE.equals(methodName)) {
| return new Integer(hashCode);
| } else if (EQUALS.equals(methodName)) {
| return new Boolean(methodParams[0].equals(this));
| }
|
| Object result = null;
| try {
| result = server.invoke(objectName, methodName, methodParams, signature);
|
| } catch(InstanceNotFoundException ex) {
| throw new MBeanException(ex,"MBean '"+objectName+"' does not exist, which caused "+methodName+"() to fail.");
| } catch(RuntimeException ex) {
| throw new MBeanException(ex,"Exception caused "+methodName+"() to fail");
| } catch(ReflectionException ex) {
| throw new MBeanException(ex,"ReflectionException caused "+methodName+"() to fail.");
| }
|
| return result;
| }
|
| /* (non-Javadoc)
| * @see cdot.util.MBeanProxy#invoke(java.lang.String)
| */
| public Object invoke(String methodName) throws MBeanException {
| return invoke(methodName, null, null);
| }
|
| /**
| * Returns equality of two objects
| * @param object
| * @return boolean
| */
| public boolean equals(Object object) {
| if (!(object instanceof MBeanProxySupports)) {
| return false;
| }
| MBeanProxySupports other = (MBeanProxySupports)object;
| if (!other.mbeanName.equals(this.mbeanName)) {
| return false;
| }
|
| return true;
| }
|
| }
|
|
| // XDOCLET code in Mbean
| /**
| * @jmx.managed-attribute
| /**
| * @jmx.managed-operation
| * description="Returns HashMap for the Standard Fonts"
| *
| */
| public Hashtable getStandardFonts() {
| return super.getStandardFonts();
| }
|
|
| // Access code
| ServiceLocator serviceLocator = ServiceLocator.getInstance();
| MBeanProxy propMgrMBean = serviceLocator.getMBean(MBEAN_NAME);
| Hashtable stdFonts = null;
| Hashtable compFonts = null;
|
| try
| {
| stdFonts = (Hashtable ) propMgrMBean.invoke("getStandardFonts");
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036146#4036146
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036146
19 years
[JBoss Seam] - Ear works on Windows but fails on Ubuntu..
by tony.herstell@gmail.com
I have taken the ear, created on a Windows box (java 1.6) and deployed it onto an Ububntu box (java 1.6) both on the same versions of JBoss (4.0.5)
I don't think I have altered the Windows install of JBoss at all.
I am a little confused in what class it can't find...
Please advise...
| 09:01:49,412 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| java.lang.NoClassDefFoundError: javax/el/ELContext
| at org.jboss.seam.util.UnifiedELValueBinding.<init>(UnifiedELValueBinding.java:18)
| at org.jboss.seam.security.Identity.evaluateExpression(Identity.java:506)
| at org.jboss.seam.security.Identity.checkRestriction(Identity.java:149)
| at org.jboss.seam.pages.Page.enter(Page.java:206)
| at org.jboss.seam.core.Pages.enterPage(Pages.java:276)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:276)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:214)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:56)
| at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:619
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036144#4036144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036144
19 years
[JBoss Eclipse IDE (users)] - JBoss IDE 2.0.0Beta2 Useless
by gredzisz
In my opinion the single and most important feature of JBoss IDE
should be the intergation with JBoss Server. Unfortunately in this area
JBoss IDE miserably fails. I do not need all stupid wizards for editing
xml files, but when a class or jsp is modified in IDE it should be
automatically redeployed on the server!!! This is the most BASIC
functionality expected from such IDE and supported by IBM WSAD
back in 2002!
Instead, in JBoss IDE you have to manually select "ear" file and
choose "Redeploy" action ("Redeploy" action on the server does not work)
The IDE will package ALL files and create new "ear", then copy it
to JBoss server "deploy" folder where they will be unpacked again. If you
are lucky you will not get "out of heap space" error, if not, you have to
restart the server (even after single jsp or css change!!). The whole
process is cumbersome at best and, in my opinion, renders JBoss IDE useless.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036141#4036141
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036141
19 years
[Security & JAAS/JBoss] - authentication and roles from 2 different ldap servers?
by dbarker
I'm wondering if it is possible to authenticate users against one ldap server, but then obtain roles for the same user from a different ldap server. The passwords in these two ldap servers are different. The first ldap server has the correct password, but only the second ldap server has the correct role information
I have tried to set this up using a login-config.xml file that has been excerpted below.
If I use only the first login-module, I get authenticated properly, but the application does not get the necessary roles. When I include both login-modules I get what appears to be a password failure no matter which password (ldap1 or ldap2) that I use.
Does anyone know if this is possible and how to do it?
Thanks, Doug
| <application-policy name="AppName">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
| <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
| <module-option name="java.naming.provider.url">ldap://ldap1.domain.com:389/</module-option>
| <module-option name="java.naming.security.authentication">simple</module-option>
| <module-option name="principalDNPrefix">uid=</module-option>
| <module-option name="principalDNSuffix">,cn=users,dc=domain,dc=com</module-option>
| <module-option name="allowEmptyPasswords">false</module-option>
| </login-module>
| <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" >
| <module-option name="java.naming.provider.url">ldap://ldap2:389</module-option>
| <module-option name="bindDN">uid=admin,ou=people,dc=domain,dc=com</module-option>
| <module-option name="bindCredential">adminapassword</module-option>
| <module-option name="baseCtxDN">ou=people,o=Organization,dc=domain,dc=com</module-option>
| <module-option name="baseFilter">(uid={0})</module-option>
| <module-option name="rolesCtxDN">ou=people,o=Organization,dc=domain,dc=com</module-option>
| <module-option name="roleFilter">(uid={0})</module-option>
| <module-option name="roleAttributeID">nsRoleDN</module-option>
| <module-option name="roleAttributeIsDN">true</module-option>
| <module-option name="roleNameAttributeID">cn</module-option>
| <module-option name="roleRecursion">-1</module-option>
| <module-option name="searchScope">ONELEVEL_SCOPE</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036138#4036138
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036138
19 years