[Security & JAAS/JBoss] - studying material, weird diagrams
by alfonz19
Hi, I have to study security in JBoss so I'm reading through this
http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch8.chapter.html
but I find it quite hard and thus reading takes an awful amount of time. Do you know any better material (if possibly exists) with meaning of better readability?
If not, then nevermind, but please help me how to understand those weird diagrams there. I totally don't understand them. There are some squares, sometimes connected with lines, some of them are not connected at all, some of them are with extra border, then there are some operators like * or 1, and in squares there are some icons... What that means?? I've NEVER seen diagrams like this and I saw a lot of different diagram types. Can someone, who understand them, explain me even what kind of diagram are they for starter and then what each symbol means? I've already ask few analytics and even them did not know the answer. I've got some ideas what some parts of diagrams could depict, but that's not enough.
thanks in advance
alfonz.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206345#4206345
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206345
17 years, 2 months
[JBoss Cache: Core Edition] - Re: Problems with Transaction Manager
by fatboysuns
This is the stacktrace, if it helps.
javax.naming.NameAlreadyBoundException
at org.jnp.server.NamingServer.bind(NamingServer.java:144)
at org.jnp.interfaces.NamingContext.bind(NamingContext.java:566)
at org.jnp.interfaces.NamingContext.bind(NamingContext.java:531)
at javax.naming.InitialContext.bind(InitialContext.java:359)
at org.jboss.cache.transaction.DummyTransactionManager.getInstance(DummyTransactionManager.java:61)
at org.jboss.cache.transaction.GenericTransactionManagerLookup.getTransactionManager(GenericTransactionManagerLookup.java:113)
at org.jboss.cache.factories.TransactionManagerFactory.construct(TransactionManagerFactory.java:68)
at org.jboss.cache.factories.ComponentRegistry.getOrCreateComponent(ComponentRegistry.java:312)
at org.jboss.cache.factories.ComponentRegistry.invokeInjectionMethod(ComponentRegistry.java:273)
at org.jboss.cache.factories.ComponentRegistry$Component.injectDependencies(ComponentRegistry.java:939)
at org.jboss.cache.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:249)
at org.jboss.cache.factories.ComponentRegistry.getOrCreateComponent(ComponentRegistry.java:319)
at org.jboss.cache.factories.ComponentRegistry.invokeInjectionMethod(ComponentRegistry.java:273)
at org.jboss.cache.factories.ComponentRegistry$Component.injectDependencies(ComponentRegistry.java:939)
at org.jboss.cache.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:249)
at org.jboss.cache.factories.InterceptorChainFactory.createInterceptor(InterceptorChainFactory.java:60)
at org.jboss.cache.factories.InterceptorChainFactory.buildInterceptorChain(InterceptorChainFactory.java:75)
at org.jboss.cache.factories.InterceptorChainFactory.construct(InterceptorChainFactory.java:225)
at org.jboss.cache.factories.ComponentRegistry.getOrCreateComponent(ComponentRegistry.java:312)
at org.jboss.cache.factories.ComponentRegistry.invokeInjectionMethod(ComponentRegistry.java:273)
at org.jboss.cache.factories.ComponentRegistry$Component.injectDependencies(ComponentRegistry.java:939)
at org.jboss.cache.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:249)
at org.jboss.cache.DefaultCacheFactory.bootstrap(DefaultCacheFactory.java:155)
at org.jboss.cache.DefaultCacheFactory.createAndWire(DefaultCacheFactory.java:141)
at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:120)
at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:105)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206341#4206341
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206341
17 years, 2 months
[Installation, Configuration & DEPLOYMENT] - Re: EjbModule is already installed JBossAS-5.0.0.GA
by karltraunmueller
Similar issue with persistence units - if two ears (say, test1.ear and test2.ear) include the same ejb jar (with same META-INF/persistence.xml), you get
19:51:46,959 WARN [AbstractDeploymentContext] Unable to register deployment mbean org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.TestEjb
| javax.management.InstanceAlreadyExistsException: jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.TestEjb",type=Component already registered.
| at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
| at sun.reflect.GeneratedMethodAccessor89.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:376)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.addComponent(AbstractDeploymentContext.java:719)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.addComponent(AbstractDeploymentUnit.java:249)
| at org.jboss.jpa.deployers.AbstractDeploymentVisitor.addComponent(AbstractDeploymentVisitor.java:49)
| at org.jboss.jpa.deployers.AbstractDeploymentVisitor.deploy(AbstractDeploymentVisitor.java:64)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.deploy(AbstractRealDeployerWithInput.java:125)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.internalDeploy(AbstractRealDeployerWithInput.java:102)
| at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.internalDeploy(AbstractComponentDeployer.java:78)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
| at org.jboss.Main.boot(Main.java:209)
| at org.jboss.Main$1.run(Main.java:547)
| at java.lang.Thread.run(Thread.java:637)
|
|
application.xml (identical in test1.ear and test2.ear):
<application>
| <display-name>Test Application</display-name>
|
| <module>
| <ejb>TestEjb.jar</ejb>
| </module>
|
| </application>
|
persistence.xml (in TestEjb.jar's META-INF):
<?xml version="1.0" encoding="UTF-8"?>
| <persistence version="1.0"
| xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
| <persistence-unit name="TestEjb">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/TestDatasource</jta-data-source>
| <properties>
| <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
| </properties>
| </persistence-unit>
| </persistence>
|
Although the JNDI View shows both persistence units:
+- persistence.unit:unitName=test2.ear (class: org.jnp.interfaces.NamingContext)
| | +- TestEjb.jar#TestEjb (class: org.hibernate.impl.SessionFactoryImpl)
| ...
| +- persistence.unit:unitName=test1.ear (class: org.jnp.interfaces.NamingContext)
| | +- TestEjb.jar#TestEjb (class: org.hibernate.impl.SessionFactoryImpl)
|
regards,
Karl
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206340#4206340
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206340
17 years, 2 months
[Security & JAAS/JBoss] - JBoss 5 authentication / authorization problem
by apph_
Hello,
I'm having problems integrating JBoss 5 authentication / authorization in my application. I'm using EJB3, JSF 2 (but it's maven project, so actually JBoss JSF implementation is used) + Facelets.
The configuration is as follows:
1. First i've added jboss-web.xml to my WEB-INF directory. File content looks like this:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
| <jboss-web>
| <security-domain>java:/jaas/toy-shop-realm</security-domain>
| </jboss-web>
|
2. I have added security domain configuration to login-config.xml located in JBOSS_INSTALL_DIR\server\default\conf\ like this:
| <application-policy name="toy-shop-realm">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
| <module-option name="usersProperties">props/toy-shop-users.properties</module-option>
| <module-option name="rolesProperties">props/toy-shop-roles.properties</module-option>
| <module-option name="securityDomain">java:/jaas/toy-shop-realm</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
As you can see there are two files: toy-shop-users.properties and toy-shop-roles.properties in JBOSS_INSTALL_DIR\server\default\conf\props\ directory.
toy-shop-users.properties content is as simple as:
admin=admin
user=user
and toy-shop-roles.properties:
admin=admin
user=user
3. I have defined URL addresses security in web.xml in WEB-INF directory:
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>all</web-resource-name>
| <url-pattern>/*</url-pattern>
| </web-resource-collection>
| <auth-constraint>
| <role-name>user</role-name>
| </auth-constraint>
| </security-constraint>
|
| <security-role>
| <role-name>admin</role-name>
| </security-role>
| <security-role>
| <role-name>user</role-name>
| </security-role>
|
| <login-config>
| <auth-method>FORM</auth-method>
| <form-login-config>
| <form-login-page>/login.jsp</form-login-page>
| <form-error-page>/error.jsp</form-error-page>
| </form-login-config>
| </login-config>
|
The login.jsp page simply uses j_security_check for authentication.
4. And finally some security annotation in EJB bean:
| @SecurityDomain("toy-shop-realm")
| @RolesAllowed({"admin", "user"})
| @Stateless
| public class PaymentLogic implements PaymentContract {
|
| @EJB(mappedName="PaymentJpaDao/local")
| private PaymentDao paymentDao;
|
| @RolesAllowed({"admin"})
| public List<Payment> getActivePayments() {
| return paymentDao.getActivePayments();
| }
| }
|
PaymentContract is simple interface with one method and no annotations.
PaymentJpaDao is defined as Stateless bean.
Now, when i start the application it requires authentication. If i provide non-defined user name i will not go through. If it's 'user' or 'admin' defined in properties file it is ok. But it looks like security annotations are completely ignored. Everybody can invoke getActivePayments method. Web application is tested as war (will be packed as ear in future) and it uses another library with defined EJB's (PaymentLogic, PaymentJpaDao, etc.). Now if i add jboss.xml file to META-INF directory of this library:
| <jboss>
| <security-domain>toy-shop-realm</security-domain>
| </jboss>
|
then when i invoke getActivePayments logged as 'user' i'll get EJBAccessException: Caller unauthorized. This is great. But when i invoke it as 'admin', i'll get the 403 error - access denied. If I add <role-name>admin</role-name> in <auth-constraint> in web.xml i'll also get EJBAccessException: Caller unauthorized for 'admin' login.
What am i missing?
Thx for any help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206330#4206330
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206330
17 years, 2 months