[Clustering/JBoss] - Re: Accessing singleton MBean from a cluster node
by bstansberry@jboss.com
Looks like the jboss.jmx:type=adaptor,name=Invoker service is secured, using the same security domain as the JMX console. So, you need to associate a principal and credential that the jmx-console domain will accept with the caller thread before invoking on the adaptor.
This can be done as follows:
| ... your existing stuff
| String user = "foo"; // replace with whatever you want
| org.jboss.security.SimplePrincipal prin = new SimplePrincipal(user);
| org.jboss.security.SecurityAssociation.setPrincipal(prin);
|
| char[] pwd = "bar".toCharArray(); // replace with whatever you want
| org.jboss.security.SecurityAssociation.setCredential(pwd);
| if( (rmiAdaptor != null) && (rmiAdaptor.isRegistered(new ObjectName("kapart.mbean:service=ScheduleManager"))) ) {
| rmiAdaptor.invoke( new ObjectName("kapart.mbean:service=ScheduleManager"), "startSingleton", null, null );
| }
|
Probably a better idea is to call SecurityAssociation.getPrincipal() and getCredential() first and cache the results in a local variable. Then do the above in a try/finally block. In the finally, reset the principal and credential to whatever they were. This way if the thread has a end user's principal and credential associated with it, they won't be lost.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047246#4047246
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047246
18 years, 11 months
[EJB 3.0] - Migration from Embedded RC8 to embedded-jboss-beta2
by jc7442
Hi,
I try to migrate my junit testcase from embedded RC8 to beta2. It looks that XML configuration file have change a lot.
Using the EJB3StandaloneBootstrap classes I was able to define the jar to scan and only the jar to scan. Consequently before each testcase, I started and shutdown the embedded JBoss. That was very convenient solution (my persitence.xml have the create-drop property) to make my testcase independent each from the other.
EJB3StandaloneBootstrap still exist in beta2 but is not documented. Should I use the Bootstrap class ? Is it possible to provide to the container the list of jars and directory to scan either than scanning all the jar ?
With CR8, I have a jar that contains my config. It looks that with the Bootstrap class, jar are not supported for the config. Config must be in a directory ?
thx
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047240#4047240
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047240
18 years, 11 months
[JBoss Portal] - Re: pages in dashboard
by eagleIT
I give you my "default-object.xml" :
| <?xml version="1.0" encoding="UTF-8"?>
| <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ~ JBoss, a division of Red Hat ~
| ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
| ~ contributors as indicated by the @authors tag. See the ~
| ~ copyright.txt in the distribution for a full listing of ~
| ~ individual contributors. ~
| ~ ~
| ~ This is free software; you can redistribute it and/or modify it ~
| ~ under the terms of the GNU Lesser General Public License as ~
| ~ published by the Free Software Foundation; either version 2.1 of ~
| ~ the License, or (at your option) any later version. ~
| ~ ~
| ~ This software is distributed in the hope that it will be useful, ~
| ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
| ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
| ~ Lesser General Public License for more details. ~
| ~ ~
| ~ You should have received a copy of the GNU Lesser General Public ~
| ~ License along with this software; if not, write to the Free ~
| ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
| ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
|
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portal Object 2.6//EN"
| "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
|
| <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| PORTAIL CPAGE
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
|
|
|
| <deployments>
| <deployment>
| <parent-ref/>
| <if-exists>overwrite</if-exists>
| <portal>
| <portal-name>default</portal-name>
| <supported-modes>
| <mode>view</mode>
| <mode>edit</mode>
| <mode>help</mode>
| </supported-modes>
| <supported-window-states>
| <window-state>normal</window-state>
| <window-state>minimized</window-state>
| <window-state>maximized</window-state>
| </supported-window-states>
| <properties>
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage1Col</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| <property>
| <name>theme.id</name>
| <value>renaissance</value>
| </property>
| <!--
| | Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
| -->
| <property>
| <name>theme.renderSetId</name>
| <value>divRenderer</value>
| </property>
| <!--
| | Set the default strategy name (used by the strategy interceptor), see also portal-strategies.xml
| -->
| <property>
| <name>layout.strategyId</name>
| <value>maximizedRegion</value>
| </property>
| <!--
| | The default page name, if the property is not explicited then the default page name is "default"
| -->
| <property>
| <name>portal.defaultObjectName</name>
| <value>default</value>
| </property>
|
| </properties>
|
|
| <!--PAGE DEFAULT-->
|
| <page>
| <page-name>default</page-name>
| <window>
| <window-name>CatalogPortlet</window-name>
| <instance-ref>CatalogPortletInstance</instance-ref>
| <region>center</region>
| <height>0</height>
| </window>
| </page>
|
|
| </portal>
|
| </deployment>
|
|
| <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| PORTAIL DASHBOARD
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
|
|
| <deployment>
| <parent-ref/>
| <if-exists>keep</if-exists>
| <context>
| <context-name>dashboard</context-name>
| <properties>
|
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>generic</value>
| </property>
|
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| <property>
| <name>theme.id</name>
| <value>renaissance</value>
| </property>
|
| <!--
| | Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
| -->
| <property>
| <name>theme.renderSetId</name>
| <value>divRenderer</value>
| </property>
|
| <!--
| | Set the dashboard property
| -->
| <property>
| <name>dashboard</name>
| <value>true</value>
| </property>
|
| <!--
| | Set the dnd property
| -->
| <property>
| <name>theme.dyna.dnd_enabled</name>
| <value>true</value>
| </property>
|
| <!--
| | Set the partial refresh property
| -->
| <property>
| <name>theme.dyna.partial_refresh_enabled</name>
| <value>true</value>
| </property>
|
| </properties>
|
| </context>
| </deployment>
|
|
| <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| PORTAIL TEMPLATE
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
|
|
|
| <deployment>
| <parent-ref/>
| <if-exists>keep</if-exists>
| <portal>
| <portal-name>template</portal-name>
| <supported-modes>
| <mode>view</mode>
| <mode>edit</mode>
| <mode>help</mode>
| </supported-modes>
| <supported-window-states>
| <window-state>normal</window-state>
| <window-state>minimized</window-state>
| <window-state>maximized</window-state>
| </supported-window-states>
| <properties>
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>generic</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| <property>
| <name>theme.id</name>
| <value>renaissance</value>
| </property>
| <!--
| | Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
| -->
| <property>
| <name>theme.renderSetId</name>
| <value>divRenderer</value>
| </property>
| <!--
| | The default page name, if the property is not explicited then the default page name is "default"
| -->
| <property>
| <name>portal.defaultObjectName</name>
| <value>Bureau</value>
| </property>
|
| <!--
| | Set the dashboard property
| -->
| <property>
| <name>dashboard</name>
| <value>true</value>
| </property>
|
| <!--
| | Set the dnd property
| -->
| <property>
| <name>theme.dyna.dnd_enabled</name>
| <value>true</value>
| </property>
|
| <!--
| | Set the partial refresh property
| -->
| <property>
| <name>theme.dyna.partial_refresh_enabled</name>
| <value>true</value>
| </property>
|
|
| </properties>
|
| <security-constraint>
| <policy-permission>
| <role-name>User</role-name>
| <action-name>viewrecursive</action-name>
| </policy-permission>
| <policy-permission>
| <role-name>Admin</role-name>
| <action-name>viewrecursive</action-name>
| </policy-permission>
| </security-constraint>
|
|
| <!-- PAGE BUREAU-->
|
| <page>
| <page-name>Bureau</page-name>
| <properties>
| <property>
| <name>order</name>
| <value>1</value>
| </property>
|
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage4Col</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| </properties>
| </page>
|
| <!-- PAGE OUTILS-->
|
| <page>
| <page-name>Outils</page-name>
| <properties>
| <property>
| <name>order</name>
| <value>2</value>
| </property>
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage4Col</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
|
| </properties>
|
|
|
| </page>
|
| <!-- PAGE COLLABORATION-->
|
| <page>
| <page-name>Collaboration</page-name>
| <properties>
| <property>
| <name>order</name>
| <value>3</value>
| </property>
|
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage2ColQuart</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| </properties>
| </page>
|
| <!-- PAGE AGENDA-->
|
| <page>
| <page-name>Agenda</page-name>
| <properties>
| <property>
| <name>order</name>
| <value>4</value>
| </property>
|
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage2ColAgenda</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
|
| </properties>
| </page>
|
| <!-- PAGE INFORMATIONS-->
|
| <page>
| <page-name>Informations</page-name>
| <properties>
| <property>
| <name>order</name>
| <value>5</value>
| </property>
|
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage2ColEgales</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
|
| </properties>
|
| <window>
| <window-name>CMS</window-name>
| <instance-ref>CMSAdminPortletInstance</instance-ref>
| <region>right</region>
| <height>2</height>
| </window>
|
| <window>
| <window-name>DashboardConfigPortlet</window-name>
| <instance-ref>DashboardConfigPortletInstance</instance-ref>
| <region>right</region>
| <height>3</height>
| </window>
|
| </page>
|
|
|
| </portal>
| </deployment>
|
| <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| PORTAIL ADMIN
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
|
| <deployment>
| <parent-ref/>
| <if-exists>keep</if-exists>
| <portal>
| <portal-name>admin</portal-name>
| <supported-modes>
| <mode>view</mode>
| <mode>edit</mode>
| <mode>help</mode>
| </supported-modes>
| <supported-window-states>
| <window-state>normal</window-state>
| <window-state>minimized</window-state>
| <window-state>maximized</window-state>
| </supported-window-states>
| <properties>
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>CPage2ColEgales</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| <property>
| <name>theme.id</name>
| <value>renaissance</value>
| </property>
| <!--
| | Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
| -->
| <property>
| <name>theme.renderSetId</name>
| <value>divRenderer</value>
| </property>
| <!--
| | Set the default strategy name (used by the strategy interceptor), see also portal-strategies.xml
| -->
| <property>
| <name>layout.strategyId</name>
| <value>maximizedRegion</value>
| </property>
| <!--
| | The default page name, if the property is not explicited then the default page name is "default"
| -->
| <property>
| <name>portal.defaultObjectName</name>
| <value>default</value>
| </property>
| </properties>
| <security-constraint>
| <policy-permission>
| <action-name>viewrecursive</action-name>
| <role-name>Admin</role-name>
| </policy-permission>
| </security-constraint>
| <page>
| <page-name>default</page-name>
| <window>
| <window-name>AdminPortletWindow</window-name>
| <instance-ref>AdminPortletInstance</instance-ref>
| <region>right</region>
| <height>0</height>
| </window>
| <window>
| <window-name>CatalogPortletWindow</window-name>
| <instance-ref>CatalogPortletInstance</instance-ref>
| <region>left</region>
| <height>0</height>
| </window>
| </page>
| <page>
| <page-name>Members</page-name>
| <window>
| <window-name>UserPortletWindow</window-name>
| <instance-ref>UserPortletInstance</instance-ref>
| <region>right</region>
| <height>0</height>
| </window>
| <window>
| <window-name>RolePortletWindow</window-name>
| <instance-ref>RolePortletInstance</instance-ref>
| <region>left</region>
| <height>0</height>
| </window>
| </page>
| </portal>
| </deployment>
|
| </deployments>
|
Are there any mistake ???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047239#4047239
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047239
18 years, 11 months