[Design of Security on JBoss] - how i set one security role in my ejb
by stephan.opitz
i want to set the role in my logic
but how?
i have a login procedure with db access and final, i know which role the user will get...
so i only want to set his role "customer" in ejb - exist there one command?
i look for it but nothing worked
i tried ctx.isCallerInRole("guest");
but get No valid security context for the caller identity
in web.xml i added
<security-constraint>
<web-resource-collection>
<web-resource-name>Test</web-resource-name>
<url-pattern>/Test/</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Guest</role-name>
<role-name>Customer</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
Authorized to limited access.
<role-name>Guest</role-name>
</security-role>
<security-role>
Authorized to access everything.
<role-name>Customer</role-name>
</security-role>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972768#3972768
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972768
19 years, 6 months
[Design of JBoss Admin Console] - JBossMQ vs JBoss Messaging
by PeterJ
We have noticed that a couple of weeks ago that JBossMQ disappeared from jboss-head. We believe that this is due to its impending replacement by JBoss Messaging in the 5.0 release. Up to now, the admin console was coded to work with JBossMQ. The short story is that we didn't want to chase a moving target (JBoss Messaging) while developing the admin console and knew we would have to, some time later, move to JBoss Messaging. Well, later is now.
At this point, the proposal is to clone the files related to JBossMQ and modify the cloned files to work with JBoss Messaging. Briefly, any directory named 'jms' will be cloned to a directory name 'messaging'. In addition, the home page will contain links to both the JBossMQ and JBoss Messaging functionality, with the later not working until all the changes are made. Once the changes are made, we can either:
1) leave it as is, thus providing management of both JBossMQ and JBoss Messaging, or
2) comment out the home page links to the JBossMQ management functions, which allows users who really need JBossMQ to uncomment the links to use that functionality, or
3) remove the JBossMQ functionality and support only JBoss Messaging.
I am leaning towards option #2, though can be easily swayed towards option #3. I would need a really good reason to support option #1.
Comments welcome.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972762#3972762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972762
19 years, 6 months
[Design of EJB 3.0] - @EJB Injection Not Working
by ALRubinger
After upgrading today my JBoss 4.0.4-GA installation to EJB3 RC9, I've found that the @EJB injections in my code are not populating my instance variables as they had been previous to the upgrade.
I have created a project with sources, build script, and deployable example of the use case. Will be happy to upload/email this if instructed.
I'd like to volunteer to fix if confirmed that this is a bug and can be shown proper branches in JBoss source to correct.
S,
ALR
Partial Code Listing from Use Case Project
package com.alrubinger.jboss.usecase.ejbinjectionfailure;
|
| import javax.annotation.EJB;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.annotation.ejb.Depends;
| import org.jboss.annotation.ejb.LocalBinding;
| import org.jboss.annotation.ejb.RemoteBinding;
| import org.jboss.annotation.ejb.Service;
|
| @Service(objectName = "alrubinger:service=ServiceA")
| @Depends( { "alrubinger:service=ServiceB" })
| @LocalBinding(jndiBinding = "alrubinger/service/serviceA/local")
| @RemoteBinding(jndiBinding = "alrubinger/service/serviceA/remote")
| public class ServiceABean implements ServiceA, ServiceAManagement {
|
| // Class Members
| private static final Log logger = LogFactory.getLog(ServiceABean.class);
|
| // Instance Members
| @EJB
| private ServiceB injectedReference;
|
| // Required Implementations
|
| /**
| * Test Method
| */
| public String test() {
| return "SUCCESSFUL TEST SERVICE A";
| }
|
| // Lifecycle Methods
| /*
| * (non-Javadoc)
| *
| * @see com.alrubinger.jboss.usecase.ejbinjectionfailure.EjbAManagement#start()
| */
| public void start() throws Exception {
| logger.info("In start...");
| logger.info("Calling injected reference...");
| // >>> NULLPOINTER DUE TO NO INJECTION <<<
| logger.info(injectedReference.test());
| // THIS LINE NOT REACHED
| logger.info("Start Done; OK.");
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972756#3972756
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972756
19 years, 6 months