Re: [jboss-dev-forums] [JBoss AS 7 Development] - Hacking on AS7
by Craig Ringer
Craig Ringer [https://community.jboss.org/people/ringerc] commented on the document
"Hacking on AS7"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-15596#comment-9998
--------------------------------------------------
It's frequently desirable when debugging AS7, or even just apps running on top of AS7, to get the sources for absolutely everything an AS7 release includes - not just directly JBoss AS 7 code, but things like Hibernate, Coyote, Mojarra, etc etc etc. An easy way to do this would be seriously nice.
I landed up doing:
git clone git://github.com/jbossas/jboss-as.git
cd jboss-as
git checkout 7.1
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
for a somewhat unsatisfactory result, in that lots of libraries in the JBoss and Central repositories lack sources and/or JavaDoc. While IMO Central should reject artifacts whose pom specifies an open source license when not accompanied by sources and JavaDoc, alas it doesn't, so lots of libs are binary only.
When debugging, it's a serious pain to run into things you don't have sources for. How do *you* handle this? Is there some sane and simple technique to get all the sources, or do you have to go delving into the version control for each project you need sources for and do local Maven builds of the desired versions?
--------------------------------------------------
12 years, 7 months
[JBoss AS 7 Development] - No EJB receiver available for handling in JBoss AS 7
by Zaw Than Oo
Zaw Than Oo [https://community.jboss.org/people/javamutu] created the discussion
"No EJB receiver available for handling in JBoss AS 7"
To view the discussion, visit: https://community.jboss.org/message/738735#738735
--------------------------------------------------------------
When I loockup the EBJ Remote by JNDI, I get the the following exception.
INFO: Connection default will not be available in EJB client context org.jboss.ejb.client.EJBClientContext@60420f
Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:YomaBankService,distinctname:]
My EJB Module and Configuration is :
In jboss-ebj-jndi.properties,
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=10.20.30.40
remote.connection.default.port = 4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=admin
remote.connection.default.password=admin
Libray is :
jboss-ejb-api_3.1_spec-1.0.1.Final.jar
jboss-ejb-client-1.0.0.Beta11.jar
jboss-logging-3.1.0.CR2.jar
jboss-marshalling-1.3.4.GA.jar
jboss-marshalling-river-1.3.4.GA.jar
jboss-remoting-3.2.0.CR6-darranl-1.jar
jboss-sasl-1.0.0.Beta9.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
xnio-api-3.0.0.CR5.jar
xnio-nio-3.0.0.CR5.jar
Reference :
| | java:global/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceLocal |
| | java:app/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceLocal |
| | java:module/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceLocal |
| | java:global/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote |
| | java:app/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote |
| | java:module/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote |
| | java:jboss/exported/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote |
My EJB Client is :
package com.mutu.gbt.ejb.client;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.mutu.gbt.ejb.Bank;
import com.mutu.gbt.ejb.Customer;
import com.mutu.gbt.ejb.YomaBankService;
import com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote;
import com.mutu.gbt.interfaces.IYomaBankService;
public class YomaBankServiceClient2 {
public Context getInitialContext() throws NamingException {
Properties jndiProperties = new Properties();
jndiProperties.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
return new InitialContext(jndiProperties);
}
private IYomaBankService getYomaBankService() {
IYomaBankService result = null;
try {
String applicationName = "";
String moduleName = "YomaBankService";
String distinctName = "";
String beanName = YomaBankService.class.getSimpleName();
System.out.println("BeanName \t:" + beanName);
String viewClassName = IYomaBankServiceRemote.class.getName();
System.out.println("ViewClassName \t:" + beanName);
Context context = getInitialContext();
IYomaBankServiceRemote yomaBankServiceRemote = (IYomaBankServiceRemote)context.lookup("ejb:" + applicationName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
result = (IYomaBankService)yomaBankServiceRemote;
} catch(NamingException e) {
e.printStackTrace();
}
return result;
}
public void runtTest() {
IYomaBankService yomaBankService = getYomaBankService();
Customer from = new Customer("zawthanoo", "Zaw Than Oo");
Customer to = new Customer("test", "Test User");
yomaBankService.transferCash(from, to, 5000, Bank.KBZ);
}
public static void main(String[] args) {
YomaBankServiceClient2 client = new YomaBankServiceClient2();
client.runtTest();
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/738735#738735]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[PicketBox Development] - JBoss AS7: Enabling JASPI Authentication for Web Applications
by Josef Cacek
Josef Cacek [https://community.jboss.org/people/jcacek] modified the document:
"JBoss AS7: Enabling JASPI Authentication for Web Applications"
To view the document, visit: https://community.jboss.org/docs/DOC-17782
--------------------------------------------------------------
This document describes the steps needed to enable JASPI authentication for Web applications on JBoss AS7.
h2. Application Server Configuration
The first step to enable JASPI is to configure a security domain that installs the JASPI login modules. So, in your standalone.xml (or domain.xml if using domain mode), add the JASPI configuration in the security subsystem:
<!-- security domain configuration for the jaspi web basic test -->
<security-domain name="jaspi-test" cache-type="default">
<authentication-jaspi>
<login-module-stack name="lm-stack">
<login-module code="UsersRoles" flag="required">
<module-option name="usersProperties" value="../standalone/configuration/jaspi-users.properties"/>
<module-option name="rolesProperties" value="../standalone/configuration/jaspi-roles.properties"/>
</login-module>
</login-module-stack>
<auth-module code="org.jboss.as.web.security.jaspi.modules.HTTPBasicServerAuthModule" login-module-stack-ref="lm-stack" flag="required"/>
</authentication-jaspi>
</security-domain>
In this example we are configuring the *HTTPBasicServerAuthModule*, which will perform the *BASIC* authentication of a Web application. If *FORM* authentication is desired, just change the auth-module to *org.jboss.as.web.security.jaspi.modules.HTTPFormServerAuthModule*. Notice the configuration style is very similar to what is found in previous JBoss AS versions. The configured JASPI module can delegate the authentication and role mapping processes to a login module stack. In this case, we're using a simple UsersRoles module to authenticate and obtain roles for the users.
The sample security-domain can also be configured by using CLI management tool using following commands:
/subsystem=security/security-domain=jaspi-test:add(cache-type=default)
/subsystem=security/security-domain=jaspi-test/authentication=jaspi:add(auth-modules=[{"code"=>"org.jboss.as.web.security.jaspi.modules.HTTPBasicServerAuthModule", "login-module-stack-ref"=>"lm-stack", "flag"=>"required"}])
/subsystem=security/security-domain=jaspi-test/authentication=jaspi/login-module-stack=lm-stack:add(login-modules=[{"code"=>"UsersRoles", "flag"=>"required", "module-options"=>{"usersProperties"=>"../standalone/configuration/jaspi-users.properties", "rolesProperties"=>"../standalone/configuration/jaspi-roles.properties"}}], operation-headers={"allow-resource-service-restart"=>"true"})
h3. Web Application Configuration
The next step is to configure the Web application. First, we specify the type of authentication that is to be performed. For example, an application that requires *BASIC* authentication must specify that in the *WEB-INF/web.xml* file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
<security-constraint>
<web-resource-collection>
<web-resource-name>Home</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>architect</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>JASPI</realm-name>
</login-config>
<security-role>
<role-name>architect</role-name>
</security-role>
</web-app>
Finally, we need to link the Web application to the security domain that will perform the authentication and configure the valve that will enable the JASPI authentication. Both things are done in the *WEB-INF/jboss-web.xml* file:
<?xml version="1.0"?>
<jboss-web>
<security-domain>jaspi-test</security-domain>
<valve>
<class-name>org.jboss.as.web.security.jaspi.WebJASPIAuthenticator</class-name>
</valve>
</jboss-web>
The specified *<security-domain>* must match the name of the security domain that has been configured in the application server. It is also important that the *WebJASPIAuthenticatorValve* is configured as this valve replaces the Web container authenticator ir order to perform the JASPI authentication.
*NOTE:* the *WebJASPIAuthenticator* replaces the previous *org.jboss.web.tomcat.security.jaspi.TomcatJASPIAuthenticator* and *MUST* be configured in the *jboss-web.xml* file. JBoss AS7 doesn't allow for the configuration of authenticator valves in the JBossWeb subsystem like previous versions.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-17782]
Create a new document in PicketBox Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 7 months
[JBoss Web Development] - Logs for rejected http post requests
by Sanoj Kumar
Sanoj Kumar [https://community.jboss.org/people/sanoj.prof] created the discussion
"Logs for rejected http post requests"
To view the discussion, visit: https://community.jboss.org/message/738672#738672
--------------------------------------------------------------
Hi All,
I have a Webservice which is deployed as a web-application in Jboss 5.1. I have to limit the number of requests that can be processed by my application.
I have set the maxPoolSize to "1" in jboss-service.xml:
<mbean code="org.jboss.util.threadpool.BasicThreadPool"
name="jboss.system:service=ThreadPool">
<attribute name="Name">JBoss System Threads</attribute>
<attribute name="ThreadGroupName">System Threads</attribute>
<attribute name="KeepAliveTime">60000</attribute>
<attribute name="MaximumPoolSize">1</attribute>
<attribute name="MaximumQueueSize">1</attribute>
<attribute name="BlockingMode">abort</attribute>
</mbean>
This did not have much impact and when I tried with parallel requests, all the requests were getting processed, I changed the bolcking mode to "discard" as well but did not work.
I then did the change in http connector in server.xml:
<Connector maxThreads="1" acceptCount="1" allowTrace="true" debug="1" protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
connectionTimeout="20000" redirectPort="8443" />
When I tried this, then the requests started getting rejected but I do not see any logs for all these rejected http post requests. It is very strange, I changed the logging levels in jboss-log4j.xml but did not work as well.
Please let me know if there is a way through which all these rejected http post requests can be logged in jboss log files.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/738672#738672]
Start a new discussion in JBoss Web Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss ESB Development] - Message delivery guarantee in JBoss ESB
by Junzhe Hu
Junzhe Hu [https://community.jboss.org/people/hujunzhe] created the discussion
"Message delivery guarantee in JBoss ESB"
To view the discussion, visit: https://community.jboss.org/message/736231#736231
--------------------------------------------------------------
I'm evaluating JBoss SOA Platform 5.2 (I'll call it JBoss ESB in short) for my organization now. And I'm very concerned about its "Message Delivery Guarantee" capability when I came across its related document. It looks to me that JBoss ESB can only guarantee the message delivery by using JMS transportation. (You can see details in section 8.2.1. Message Loss at http://docs.redhat.com/docs/en-US/JBoss_Enterprise_SOA_Platform/5/html/ES... http://docs.redhat.com/docs/en-US/JBoss_Enterprise_SOA_Platform/5/html/ES...).
Here is the "Message Delivery Guarantee" requirement I'm trying to evaluate upon JBoss ESB. We have an application A sending a message to ESB through HTTP transportation, and ESB will delivery the message to receiver B and C through web service call. Everything is working fine if all systems are up. But for example, if receiver C is turned down, how ESB can guarantee that all messages that A sends to ESB will be re-delivered to receiver C once it's turned up again? I know I can develop some customer actions to support this with coding, but I'm wondering if JBoss ESB can support this just by its out-of-box configuration?
Here is the testing environment I setup, I downloaded SOA Platform 5.2 (not standard alone), it's running on JDK 1.6 64 bits, and I hook it up with a backend MS SQL Server 2008 database, OS is Windows server 2008 R2 64bits.
Please help me to figure this out, since this feature is very important for us. And it will lead us to the decision whether to use JBoss ESB or not.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/736231#736231]
Start a new discussion in JBoss ESB Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss AS 7 Development] - Logging Id's
by Pedro Igor
Pedro Igor [https://community.jboss.org/people/pcraveiro] 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 - 18699, 18800-18999* | *CMP* | C |
| *10800 - 10899* | *Host Controller (domain packages)* | C |
| *10900 - 10999, 16500 - 16599* | *Host Controller (host packages)* | C |
| *11000 - 11099, 16700 - 16799* | *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, 16600 - 16699* | *Process Controller* | C |
| *12100 - 12199* | *Protocol* | C |
| *12200 - 12299* | *Management Client Content* | C |
| *12300 - 12399* | *Platform MBeans* | C |
| *12400 - 12499* | *Threads* | C |
| *12500 - 12599* | *PicketLink* | I |
| available block(s) |
|
|
| *13100 - 13199* | *JDR* | C |
| *13200 - 13299* | *AppClient* | C |
| *13300 - 13399* | **Security*
* | C |
| available block(s) |
|
|
| *14000 - 14099* | *JAXR* | W |
| *14100 - 14599* | *Ejb3* | P |
| *14600 - 14899* | *Controller* | C |
| *14900 - 14999* | *Deployment Repository* | C |
| *15000 - 15099* | *Deployment Scanner* | C |
| *15100 - 15199* | *Domain Management HTTP Interface* | 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 |
| *10900 - 10999, 16500 - 16599* | *Host Controller (host packages)* | C |
| *12000 - 12099, 16600 - 16699* | *Process Controller* | C |
| *11000 - 11099, 16700 - 16799* | *EE* | C |
| available block(s) |
|
|
| *17000 - 17099* | *POJO* | C |
| *17100 - 17199* | *Remoting* | W |
| *17200 - 17299* | *SAR* | W |
| available block(s) |
|
|
| *18000 - 18399* | *Web* | C |
| *18400 - 18499* | *Xts* | C |
| *15700 - 15999, 18700 - 18799* | *Server* | C |
| *19000-19999* | *JSR-77* | I |
--------------------------------------------------------------
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...]
12 years, 7 months