[JBoss Portal] - Re: adding themes to portal core?
by FredF
"thomas.heute(a)jboss.com" wrote : You could use the ThemeService.
| org.jboos.portal.theme.ThemService
|
| It has the following method:
| addTheme(RuntimeContext runtimeContext, PortalThemeMetaData metaData) throws ThemeException;
|
| You should be able to achieve this goal.
Thank you for a quick answer. When the user has created a new theme, is it possible to edit the themes programmatically? I.e. can I call some setThemeMetaData() on an existing theme? I did not find any. The idea is to let the user upload her/his own portlet-frame-images to our server and modify an existing theme. (her dedicated theme folder in the core)
I have also found out that adding a new theme requires me to restart the server in order to find the theme in the portlet manager. Need I restart the server in order to call the org.jboos.portal.theme.ThemService.addTheme ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027971#4027971
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027971
19Â years, 1Â month
[JBossCache] - 2.0.0.ALPHA Configuration
by nstoddar
I'm having problems configuring JBC on JBoss 5.0.0.Beta1. I was thinking I could just drop the sample "tree-service.xml" into the "all" deploy directory, and see something work so I could customize from there.
However, I'm getting an error indicating that my MBean isn't really an MBean (my interpretation). Any help would be great. The other caches get created just fine (EJB, etc).
Here's my stacktrace and configuration file.
2007-03-14 10:53:40,609 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.cache:service=testTreeCache with code: org.jboss.cache.TreeCache
| 2007-03-14 10:53:40,609 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Instantiated: name=jboss.cache:service=testTreeCache state=Described mode=Manual requiredState=Configured
| org.jboss.deployment.DeploymentException: Unable to createMBean for jboss.cache:service=testTreeCache
| at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:52)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:141)
| at org.jboss.system.microcontainer.InstantiateAction.installAction(InstantiateAction.java:45)
| at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:198)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:709)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:429)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:538)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:472)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:320)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:190)
| at org.jboss.system.ServiceController.doChange(ServiceController.java:656)
| at org.jboss.system.ServiceController.install(ServiceController.java:272)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:76)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:44)
| at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:53)
| at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
| at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:145)
| at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:440)
| at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:451)
| at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:381)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:366)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:246)
| at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
| at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:401)
| at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:340)
| at org.jboss.Main.boot(Main.java:210)
| at org.jboss.Main$1.run(Main.java:508)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:102)
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:191)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1359)
| at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:345)
| at org.jboss.system.ServiceCreator.installPlainMBean(ServiceCreator.java:197)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:115)
| ... 29 more
| 2007-03-14 10:53:40,619 DEBUG [org.jboss.system.ServiceController] Creating service jboss.cache:service=testTreeCache
| 2007-03-14 10:53:40,619 DEBUG [org.jboss.system.ServiceController] Ignoring create request for service: jboss.cache:service=testTreeCache at state FAILED
| 2007-03-14 10:53:40,619 DEBUG [org.jboss.system.ServiceController] starting service jboss.cache:service=testTreeCache
| 2007-03-14 10:53:40,619 DEBUG [org.jboss.system.ServiceController] Ignoring start request for service: jboss.cache:service=testTreeCache at state FAILED
<?xml version="1.0" encoding="UTF-8"?>
|
| <!-- ===================================================================== -->
| <!-- -->
| <!-- Sample TreeCache Service Configuration -->
| <!-- -->
| <!-- ===================================================================== -->
|
| <server>
|
| <classpath codebase="./lib" archives="jbosscache.jar, jgroups.jar"/>
|
|
| <!-- ==================================================================== -->
| <!-- Defines TreeCache configuration -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.cache.TreeCache"
| name="jboss.cache:service=testTreeCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <!--
| Configure the TransactionManager
| -->
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
|
| <!--
| Node locking level : SERIALIZABLE
| REPEATABLE_READ (default)
| READ_COMMITTED
| READ_UNCOMMITTED
| NONE
| -->
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <!--
| Valid modes are LOCAL
| REPL_ASYNC
| REPL_SYNC
| INVALIDATION_ASYNC
| INVALIDATION_SYNC
| -->
| <attribute name="CacheMode">LOCAL</attribute>
|
| <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
| cluster in order to find each other.
| -->
| <attribute name="ClusterName">TreeCache-Cluster</attribute>
|
| <!--Uncomment next three statements to enable JGroups multiplexer.
| This configuration is dependent on the JGroups multiplexer being
| registered in an MBean server such as JBossAS. -->
| <!--
| <depends>jgroups.mux:name=Multiplexer</depends>
| <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
| <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
| -->
|
| <!-- JGroups protocol stack properties.
| ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
| -->
| <attribute name="ClusterConfig">
| <config>
| <!-- UDP: if you have a multihomed machine,
| set the bind_addr attribute to the appropriate NIC IP address -->
| <!-- UDP: On Windows machines, because of the media sense feature
| being broken with multicast (even after disabling media sense)
| set the loopback attribute to true -->
| <UDP mcast_addr="228.1.2.5" mcast_port="45577"
| ip_ttl="64" ip_mcast="true"
| mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
| ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
| loopback="false"/>
| <PING timeout="2000" num_initial_members="3"
| up_thread="false" down_thread="false"/>
| <MERGE2 min_interval="10000" max_interval="20000"/>
| <FD shun="true" up_thread="true" down_thread="true"/>
| <VERIFY_SUSPECT timeout="1500"
| up_thread="false" down_thread="false"/>
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
| up_thread="false" down_thread="false"/>
| <pbcast.STABLE desired_avg_gossip="20000"
| up_thread="false" down_thread="false"/>
| <UNICAST timeout="600,1200,2400" down_thread="false"/>
| <FRAG frag_size="8192"
| down_thread="false" up_thread="false"/>
| <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
| shun="true" print_local_addr="true"/>
| <pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
| </config>
| </attribute>
|
|
| <!--
| The max amount of time (in milliseconds) we wait until the
| initial state (ie. the contents of the cache) are retrieved from
| existing members in a clustered environment
| -->
| <attribute name="InitialStateRetrievalTimeout">20000</attribute>
|
| <!--
| Number of milliseconds to wait until all responses for a
| synchronous call have been received.
| -->
| <attribute name="SyncReplTimeout">15000</attribute>
|
| <!-- Max number of milliseconds to wait for a lock acquisition -->
| <attribute name="LockAcquisitionTimeout">10000</attribute>
|
|
| <!-- Name of the eviction policy class. Not supported now. -->
| <attribute name="EvictionPolicyClass"></attribute>
| </mbean>
|
|
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027969#4027969
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027969
19Â years, 1Â month
[Security & JAAS/JBoss] - Re: Programmatic Authentication in JBoss?
by knignick
Hi, gurus.
My question is about authentication data propagation from servlet to EJB.
We use one security domain for our application based on custom LoginModule.
The only security config in our web.xml is
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>
| The Protected Calculator
| </web-resource-name>
| <url-pattern>*.jsf</url-pattern>
| </web-resource-collection>
|
| <user-data-constraint>
| <transport-guarantee>NONE</transport-guarantee>
| </user-data-constraint>
| </security-constraint>
|
It seemed it doesn't matter cause we don't use any Tomcat provided ways of servlet authentication (cause our login logic is more complex).
So in one JSF action method I interact with LoginContext directly:
| public String login() {
| String outcome = Constants.FAILED;
| try {
| IdmCallbackHandler callbackHandler = new IdmCallbackHandler(getLoginName(), getPassword(), getAccountId());
| loginContext = new LoginContext(AuthenticationBean.SECURITY_REALM, callbackHandler);
| loginContext.login();
| Subject subject = loginContext.getSubject();
| getFacesContext().getExternalContext().getSessionMap().put(Constants.SUBJECT_SESSION_KEY, subject);
|
| for(Principal p : subject.getPrincipals()) {
| if (p instanceof IdmPrincipal) {
| setCurrentUserAccount( new UserAccount( ((IdmPrincipal)p).getAccount() ) );
| break;
| }
| }
|
login() passes successfully and subject is valid
The problem occurs inside setCurrentUserAccount() when local stateless session bean method (marked with @PermitAll) is called:
18:05:21,943 ERROR [AuthenticationBean] Exception:
javax.ejb.EJBAccessException: Authentication failure
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:70)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:70)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
at $Proxy4155.getPermissions(Unknown Source)
at com.image.idm.jsf.beans.UserAccount.loadPermissions(UserAccount.java:51)
at com.image.idm.jsf.beans.UserAccount.setAccount(UserAccount.java:47)
at com.image.idm.jsf.beans.UserAccount.(UserAccount.java:36)
at com.image.idm.jsf.beans.AuthenticationBean.login(AuthenticationBean.java:140)
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 com.sun.el.parser.AstValue.invoke(AstValue.java:151)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:281)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:257)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:412)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
Caused by: com.image.idm.jaas.IdmLoginException
at com.image.idm.jaas.IdmLoginModule.login(IdmLoginModule.java:110)
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 javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:601)
at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:535)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
at org.jboss.aspects.security.AuthenticationInterceptor.authenticate(AuthenticationInterceptor.java:123)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:66)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
at $Proxy4155.getPermissions(Unknown Source)
at com.image.idm.jsf.beans.UserAccount.loadPermissions(UserAccount.java:51)
at com.image.idm.jsf.beans.UserAccount.setAccount(UserAccount.java:47)
at com.image.idm.jsf.beans.UserAccount.(UserAccount.java:36)
at com.image.idm.jsf.beans.AuthenticationBean.login(AuthenticationBean.java:140)
It seemed that during EJB method invokation our LoginModule is called again. Is it really needed or it is a wrong behaviour?
Is it possible to make EJB container "undestand" that authentication is done and take authentication info?
Both jboss.xml and jboss-web.xml are configured to the same security domain.
JBOSS version is 4.0.5 GA.
If you know the decision or at least the root of the problem - please let me know
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027967#4027967
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027967
19Â years, 1Â month