[JBoss AS 7 Development] - Logging Id's
by John Bailey
John Bailey [https://community.jboss.org/people/johnbailey] modified the document:
"Logging Id's"
To view the document, visit: https://community.jboss.org/docs/DOC-16810
--------------------------------------------------------------
Logging id ranges for JBoss AS7 i18n message interfaces.
|| %1,3% *Status* ||
| C | = | Complete |
| I | = | In Progress |
| P | = | Merged, but not complete |
| W | = | Waiting Merge |
|| *Range* || *Subsystem
* || *Status
* ||
| *10100 - 10199* | *Transaction* | C |
| *10200 - 10399
* | *Clustering**
* | C |
| *10400 - 10499* | *Connector**
* | C |
| *10500 - 10599* | *CLI (not applicable)
* | N/A |
| *10600 - 10699* | *Controller Client* | C |
| *10700 - 10799, 18500 - 18799* | *CMP* | I |
| *10800 - 10899* | *Host Controller (domain packages)* | C |
| *10900 - 10999* | *Host Controller (host packages)* | C |
| *11000 - 11099* | *EE* | C |
| *11100 - 11199* | *Embedded* | C |
| *11200 - 11299* | *JAXRS* | C |
| *11300 - 11399* | *JMX* | C |
| *11400 - 11499* | *JPA* | C |
| *11500 - 11599* | *Logging* | C |
| *11600 - 11699* | *Messaging* | C |
| *11700 - 11799* | *mod_cluster* | C |
| *11800 - 11899* | *Naming* | C |
| *11900 - 11999* | *OSGi* | C |
| *12000 - 12099* | *Process Controller* | C |
| *12100 - 12199* | *Protocol* | C |
| *12200 - 12299* | *Management Client Content* | C |
| *12300 - 12399* | *Platform MBeans* | C |
| *12400 - 12499* | *Threads* | C |
| *13100 - 13199* | *Security* | C |
| *13200 - 13299* | *AppClient* | C |
| *13300 - 13399* | *JDR* | C |
| *14000 - 14099* | *JAXR* | W |
| *14100 - 14599* | *Ejb3* | P |
| *14600 - 14899* | *Controller* | C |
| *14900 - 14999* | *Deployment Repository* | C |
| *15000 - 15099* | *Deployment Scanner* | C |
| *15100 - 15199* | *Deployment HTTP API* | C |
| *15200 - 15299* | *Deployment Management* | C |
| *15300 - 15399* | *Network* | C |
| *15400 - 15499* | *Mail* | C |
| *15500 - 15699* | *Web Services* | C |
| *15700 - 15999, 18700 - 18799* | *Server* | C |
| *1**6000 - 16099* | *Weld* | C |
| *16100 - 16199* | *EE Deployment* | C |
| *16200 - 16299* | *Configadmin* | C |
| *16300 - 16499* | *Jacorb* | C |
| available block(s) |
|
|
| *17000 - 17099* | *POJO* | C |
| *17100 - 17199* | *Remoting* | W |
| *17200 - 17299* | *SAR* | W |
| *18000 - 18399* | *Web* | C |
| *18400 - 18499* | *Xts* | C |
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-16810]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
13 years
[JBoss AS 7 Development] - JBoss 7 and Ejb remote call with security
by Petr Mates
Petr Mates [https://community.jboss.org/people/mates1234] modified the document:
"JBoss 7 and Ejb remote call with security"
To view the document, visit: https://community.jboss.org/docs/DOC-17581
--------------------------------------------------------------
This article describes my tests with ejb and JBoss7.
For my test a have ear (TestEar) with one ejb module (TestEjb) and one bean (TestBean).
TestEar.ear
+---TestEjb.ejb
+--mates.test.TestBean.class
mates.test.TestBeanRemote.class
As security I use RealmUsersRoles with
*+x-users.properties+*
testX=test1234
*+x-users.properties+*
testX=bean
And now standalone.xml
and I changed ApplicationRealm
<security-realm name="ApplicationRealm">
<authentication>
<jaas name="bean-sec-domain"/>
</authentication>
</security-realm>
and security domain
<security-domain name="bean-sec-domain" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
<module-option name="defaultUsersProperties" value="file:/${jboss.server.config.dir}/x-users.properties"/>
<module-option name="defaultRolesProperties" value="file:/${jboss.server.config.dir}/x-roles.properties"/>
<module-option name="usersProperties" value="file:/${jboss.server.config.dir}/x-users.properties"/>
<module-option name="rolesProperties" value="file:/${jboss.server.config.dir}/x-roles.properties"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
And now lets look at bean.
@Stateless
@DeclareRoles("bean")
public class TestBean implements TestBeanRemote {
@Resource
private EJBContext context;
@Override
@RolesAllowed("bean")
public String getName ()
{
getNameFree();
}
@Override
public String getNameFree ()
{
String aName = "";
if (context.getCallerPrincipal() != null) {
aName = context.getCallerPrincipal().getName();
}
return "name " + aName + " " + context.isCallerInRole("bean");
}
}
Let's secure EJB
add *+jboss-app.xml+* to TestEar.ear\META-INF. I use security domain other to ensure that i secure all beans.
<?xml version="1.0" encoding="UTF-8"?>
<p:jboss-app xmlns:p="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee ../../xsd/jboss-app_7_0.xsd ">
<security-domain>other</security-domain>
</p:jboss-app>
And I want to secure TestBean. I have to add *+jboss-ejb3.xml+* to TestEjb.jar\META-INF\. TestBean is secured by *bean-sec-domain*.
<?xml version="1.0" encoding="UTF-8"?>
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="urn:security" version="3.1" impl-version="2.0">
<assembly-descriptor xmlns="http://java.sun.com/xml/ns/javaee">
<security:security xmlns:security="urn:security">
<security:security-domain>bean-sec-domain</security:security-domain>
<ejb-name>TestBean</ejb-name>
</security:security>
</assembly-descriptor>
</jboss:ejb-jar>
Remote interface is real simple with 2 methods.
Client:
Hashtable<String, Object> p = new Hashtable<String, Object>();
p.put(Context.INITIAL_CONTEXT_FACTORY, InitialContextFactory.class.getName());
p.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447/");
p.put(InitialContext.SECURITY_PRINCIPAL, "testX");
p.put(InitialContext.SECURITY_CREDENTIALS, "test1234");
p.put("jboss.naming.client.ejb.context", true);
p.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
InitialContext c = new InitialContext(p);
TestBeanRemote vLookup = (TestBeanRemote) c.lookup("java:/TestEar/TestEjb/TestBean!"+ TestBeanRemote.class.getName());
System.out.println("x" + vLookup.getNameFree());
System.out.println("x" + vLookup.getName());
After this you can see
xname testX true
xsecured name testX true
*That's all.*
*And now some other tests:*
Most important mart is
+*p.put("jboss.naming.client.ejb.context", true);*+
without this property you will see "+No EJB receiver available for handling [appName:TestEar,modulename:TestEjb,distinctname:] combination+"
when you put in class path file *+jboss-ejb-client.properties+* with standard
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=x1
remote.connection.x1.host=127.0.0.1
remote.connection.x1.port = 4447
remote.connection.x1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.x1.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
and comment +*p.put("jboss.naming.client.ejb.context", true);*+
and in console is now
xname $local false
Exception in thread "main" javax.ejb.EJBAccessException: JBAS014502: Invocation on method: public abstract java.lang.String mates.test.TestBeanRemote.getName() of bean: TestBean is not allowed
+*jboss.naming.client.ejb.context*+ setup EJBContext on client side. See *+org.jboss.naming.remote.client.InitialContextFactory+*
+*
*+
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-17581]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
13 years
[JBoss AS 7 Development] - Re: Logging with slf4j in 7.1.0.Final
by David Lloyd
David Lloyd [https://community.jboss.org/people/dmlloyd] created the discussion
"Re: Logging with slf4j in 7.1.0.Final"
To view the discussion, visit: https://community.jboss.org/message/719198#719198
--------------------------------------------------------------
Let me answer the main question first before I address the finer points: +yes+ you can provide your own logging if you want.
I do want to point out that you are incorrect about a couple points. First, the JBoss LogManager isn't so much +based+ on JUL as it completely replaces it. As it does replace log4j and provide implementations for slf4j and so on. It *does* in fact support MDC, via the slf4j or log4j or jboss-logging APIs. And it does in fact allow the usage of log4j appenders to be configured. The basic idea is that no matter which log API you use or how you use it, all the logs are handled consistently. This is why we replace JUL's log manager implementation - it's the only way to consistently and correctly merge JUL logs with log4j-style logs.
That said it does *not* presently have complete support for per-deployment logging configurations, though that is forthcoming in a (not too distant) future release.
Anyway, assuming you still want to go ahead with using your own logging API and implementation, you may also have to exclude "org.jboss.logging" in case you've got a secondary JAR linking against that.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/719198#719198]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years