[JBoss AS 7 Development] - sun/security packages to activate
by Ufuk TÜL
Ufuk TÜL [https://community.jboss.org/people/darkrider] created the discussion
"sun/security packages to activate"
To view the discussion, visit: https://community.jboss.org/message/753325#753325
--------------------------------------------------------------
We need some packages to activate about sun/security packages. Otherwise we get *java.lang.NoClassDefFoundError.* We need "*sun/security/pkcs"* and "*sun/security/x509"* modules to activate.*
*
Is it possible to add some required packages to JBoss 7 A.S. as default like the following.
*+jboss-as-web-7.0.2.Final\modules\sun\jdk\main+*
altında *+module.xml+* dosyasında aşağıdaki satırlar eklenir.
*<path name="sun/security/pkcs"/>*
*<path name="sun/security/x509"/>*
*
*
Here is the exception cause:
javax.servlet.ServletException: java.lang.NoClassDefFoundError: *sun/security/pkcs*/PKCS7
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:115)
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
tr.gov.tubitak.bte.ebelgem.util.CustomCharacterEncodingFilter.doFilter(CustomCharacterEncodingFilter.java:38)
javax.servlet.ServletException: java.lang.NoClassDefFoundError: *sun/security/x509*/AlgorithmId
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:115)
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
tr.gov.tubitak.bte.ebelgem.util.CustomCharacterEncodingFilter.doFilter(CustomCharacterEncodingFilter.java:38)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/753325#753325]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months
[JBoss ESB Development] - Client Side Authentication in HTTP Gateway
by Rajnish Kumar
Rajnish Kumar [https://community.jboss.org/people/rajnish.kumar.76] created the document:
"Client Side Authentication in HTTP Gateway "
To view the document, visit: https://community.jboss.org/docs/DOC-19730
--------------------------------------------------------------
*Dear All,
I had to do this for my project. If any one of you have this requirement then you can use it.
Environment Details :-
Consumer on HTTPs with client auth enabled
web server (apache or can be anything)
app server (Jboss ESB +++++) [I was using SOA-P 5.2]
Issue :-
httpgateway (basically a listener) can't get client cert to authenticate the details of the customer.
Descritption, short coming and Solution :-
Basically problem lies in the layer where HTTP request with all it's header is passed to the action chain in the service where typicaly your gatewaty is httpgateway.
<http-gateway name=++"HTTP-Gateway".....++
Internally it uses few classes. Of particular interest to us are two classes which is used and needs to be customized to meet the need.
org.jboss.soa.esb.listeners.gateway.http.HttpMessageComposer
org.jboss.soa.esb.listeners.gateway.http.HttpRequestWrapper
*
Changes that you will need to are following :-
[1] Instruct ESB service to use your custom message composer class
[2] Create a custom message composer class
[3] Create a custom HttpRequestWraper class which can handle attributes, http headers and locales (what ever you need is, not necessary to handle everything)
Steps in details
[1] Instruct ESB service to use your custom message composer class
Modify your jboss-esb.xml file and add below statement as part of <http-gateway> tag
<property name="composer-class" value="esb.gateway.CustomHttpMessageComposer"/>
This tell the service to use the customized HttpMessageComposer
[2] Create a custom message composer class
package esb.gateway;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.http.HttpHeader;
import org.jboss.soa.esb.http.HttpRequest;
import org.jboss.soa.esb.listeners.gateway.http.HttpMessageComposer;
import org.jboss.soa.esb.listeners.gateway.http.HttpRequestWrapper;
public class CustomHttpMessageComposer<T extends HttpRequestWrapper> extends HttpMessageComposer<T>{
private static final Logger logger = Logger.getLogger(CustomHttpMessageComposer.class);
@Override
/*
* this is the only method you need to override.
* make it return your custom httprequest class which can handle attributes and headers and locale
* retain all the original functionality by calling the super class method
*/
public CustomHttpRequest getRequestInfo(HttpServletRequest request) {
logger.info("co.za.fnbwealth.esb.gateway.CustomHttpMessageComposer getRequestInfo() called");
HttpRequest requestInfo = super.getRequestInfo(request);
CustomHttpRequest customRequestInfo = new CustomHttpRequest(requestInfo);
//Copy the attributes. This will have cert info
Enumeration attrNames = request.getAttributeNames();
while(attrNames.hasMoreElements()){
String attrName = (String)attrNames.nextElement();
Object val = request.getAttribute(attrName);
customRequestInfo.setAttribute(attrName, val);
}
//Copy Headers
Enumeration hdrNames = request.getHeaderNames();
List<HttpHeader> hdrs = customRequestInfo.getHeaders();
while(hdrNames.hasMoreElements()){
String hdrName = (String)hdrNames.nextElement();
String hdrVal = request.getHeader(hdrName);
HttpHeader hdr = new HttpHeader(hdrName, hdrVal);
hdrs.add(hdr);
}
//Copy Locale
customRequestInfo.setLocales(request.getLocales());
return customRequestInfo;
}
}
[3] Create a custom HttpRequestWraper class
package esb.gateway;
import java.io.Serializable;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.http.HttpRequest;
public class CustomHttpRequest extends HttpRequest implements Serializable{
private static final Logger logger = Logger.getLogger(CustomHttpRequest.class);
private X509Certificate clntCerts[];
private Map<String, Object> attrs = new HashMap<String, Object>();
//Locales implementation hasn't been tested including getter and setter for locales
private Enumeration locales;
/*
* In the costructor get all the values by making call to the super class
* Add getter and setter method for nea features you want
* Here methods have been added to handle attribute(cleint cert comes in this), http header and locale
*/
public CustomHttpRequest(HttpRequest parent){
logger.info("co.za.fnbwealth.esb.gateway.CustomHttpRequest constructor called");
super.setRemoteAddr(parent.getRemoteAddr());
super.setAuthType(parent.getAuthType());
super.setCharacterEncoding(parent.getCharacterEncoding());
super.setContentType(parent.getContentType());
super.setContextPath(parent.getContextPath());
super.setLocalAddr(parent.getLocalAddr());
super.setLocalName(parent.getLocalName());
super.setMethod(parent.getMethod());
super.setPathInfo(parent.getPathInfo());
super.setProtocol(parent.getProtocol());
super.setQueryString(parent.getQueryString());
super.setRemoteAddr(parent.getRemoteAddr());
super.setRemoteHost(parent.getRemoteHost());
super.setRemoteUser(parent.getRemoteUser());
super.setContentLength(parent.getContentLength());
super.setRequestSessionId(parent.getRequestSessionId());
super.setRequestURI(parent.getRequestURI());
super.setScheme(parent.getScheme());
super.setServerName(parent.getServerName());
super.setRequestPath(parent.getRequestPath());
super.setPathInfo(parent.getPathInfo());
}
public Object getAttribute(String attrName){
logger.info("co.za.fnbwealth.esb.gateway.CustomHttpRequest getAttribute("+attrName+") called");
return attrs.get(attrName);
}
public void setAttribute(String attrName, Object value){
logger.info("co.za.fnbwealth.esb.gateway.CustomHttpRequest setAttribute("+attrName+", "+value+") called");
attrs.put(attrName, value);
}
public void removeAttributeNames(String attrName){
logger.info("co.za.fnbwealth.esb.gateway.CustomHttpRequest removeAttributeNames("+attrName+") called");
attrs.remove(attrName);
}
public Map<String, Object> getAttributes(){
logger.info("co.za.fnbwealth.esb.gateway.CustomHttpRequest getAttributes() called");
return attrs;
}
public Enumeration getLocales(){
return locales;
}
public void setLocales(Enumeration locales){
this.locales = locales;
}
}
This is all that's required for this.
Finally note that you need to get and use customHttpRequest you have created in your custom action where you want to inspect the client cert(or. anything you customized).
CustomHttpRequest req = (CustomHttpRequest)message.getProperties().getProperty(
"org.jboss.soa.esb.http.HttpRequest#request"
);
Good Luck !!!
Cheers,
-Rajnish
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-19730]
Create a new document in JBoss ESB Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 2 months
[JBoss AS 7 Development] - AS 7 Management versions
by Kabir Khan
Kabir Khan [https://community.jboss.org/people/kabirkhan] modified the document:
"AS 7 Management versions"
To view the document, visit: https://community.jboss.org/docs/DOC-19172
--------------------------------------------------------------
This shows the management versions of the various subsystems for released AS 7 versions. The tables are generated by starting the target AS 7 version using standalone.sh --server-config=standalone-full-ha.xml and running org.jboss.as.controller.util.GrabModelVersionsUtil (in controller/src/test)
Known issues between management versions are documented in https://community.jboss.org/docs/DOC-19586 AS7ManagementVersionsKnownIssues
h2. 7.1.2.Final
|| Subsystem || Management Version || Schemas (http://www.jboss.org/schema/jbossas/) ||
| *Standalone core* | 1.2.0 |
|
| *cmp* | 1.0.0 | urn:jboss:domain:cmp:1.0 |
| *configadmin* | 1.0.0 | urn:jboss:domain:configadmin:1.0 |
| *datasources* | 1.1.0 | urn:jboss:domain:datasources:1.0
urn:jboss:domain:datasources:1.1 |
| *deployment-scanner* | 1.0.0 | urn:jboss:domain:deployment-scanner:1.0
urn:jboss:domain:deployment-scanner:1.1 |
| *ee* | 1.0.0 | urn:jboss:domain:ee:1.0
urn:jboss:domain:ee:1.1 |
| *ejb3* | 1.1.0 | urn:jboss:domain:ejb3:1.0
urn:jboss:domain:ejb3:1.1
urn:jboss:domain:ejb3:1.2
urn:jboss:domain:ejb3:1.3 |
| *infinispan* | 1.3.0 | urn:jboss:domain:infinispan:1.0
urn:jboss:domain:infinispan:1.1
urn:jboss:domain:infinispan:1.2
urn:jboss:domain:infinispan:1.3 |
| *jacorb* | 1.1.0 | urn:jboss:domain:jacorb:1.0
urn:jboss:domain:jacorb:1.1
urn:jboss:domain:jacorb:1.2 |
| *jaxr* | 1.1.0 | urn:jboss:domain:jaxr:1.1
urn:jboss:domain:jaxr:1.0 |
| *jaxrs* | 1.0.0 | urn:jboss:domain:jaxrs:1.0 |
| *jca* | 1.1.0 | urn:jboss:domain:jca:1.0
urn:jboss:domain:jca:1.1 |
| *jdr* | 1.0.0 | urn:jboss:domain:jdr:1.0 |
| *jgroups* | 1.1.0 | urn:jboss:domain:jgroups:1.0
urn:jboss:domain:jgroups:1.1 |
| *jmx* | 1.0.0 | urn:jboss:domain:jmx:1.0
urn:jboss:domain:jmx:1.1 |
| *jpa* | 1.1.0 | urn:jboss:domain:jpa:1.0 |
| *jsr77* | 1.0.0 | urn:jboss:domain:jsr77:1.0 |
| *logging* | 1.1.0 | urn:jboss:domain:logging:1.0
urn:jboss:domain:logging:1.1 |
| *mail* | 1.1.0 | urn:jboss:domain:mail:1.0 |
| *messaging* | 1.1.0 | urn:jboss:domain:messaging:1.0
urn:jboss:domain:messaging:1.1
urn:jboss:domain:messaging:1.2 |
| *modcluster* | 1.2.0 | urn:jboss:domain:modcluster:1.0
urn:jboss:domain:modcluster:1.1 |
| *naming* | 1.1.0 | urn:jboss:domain:naming:1.0
urn:jboss:domain:naming:1.1
urn:jboss:domain:naming:1.2 |
| *osgi* | 1.0.0 | urn:jboss:domain:osgi:1.0
urn:jboss:domain:osgi:1.1
urn:jboss:domain:osgi:1.2 |
| *pojo* | 1.0.0 | urn:jboss:domain:pojo:1.0 |
| *remoting* | 1.1.0 | urn:jboss:domain:remoting:1.0
urn:jboss:domain:remoting:1.1 |
| *resource-adapters* | 1.1.0 | urn:jboss:domain:resource-adapters:1.0 |
| *sar* | 1.0.0 | urn:jboss:domain:sar:1.0 |
| *security* | 1.1.0 | urn:jboss:domain:security:1.0
urn:jboss:domain:security:1.1
urn:jboss:domain:security:1.2 |
| *threads* | 1.0.0 | urn:jboss:domain:threads:1.1
urn:jboss:domain:threads:1.0 |
| *transactions* | 1.1.0 | urn:jboss:domain:transactions:1.0
urn:jboss:domain:transactions:1.1
urn:jboss:domain:transactions:1.2 |
| *web* | 1.1.0 | urn:jboss:domain:web:1.1
urn:jboss:domain:web:1.0 |
| *webservices* | 1.1.0 | urn:jboss:domain:webservices:1.0
urn:jboss:domain:webservices:1.1 |
| *weld* | 1.0.0 | urn:jboss:domain:weld:1.0 |
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-19172]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 2 months