[JBoss AS 7 Development] - policyConfig.xml issue
by biswa mishra
biswa mishra [https://community.jboss.org/people/mishra900] created the discussion
"policyConfig.xml issue"
To view the discussion, visit: https://community.jboss.org/message/778433#778433
--------------------------------------------------------------
i am facing an issue with Jboss 7.1.1 as . i am using picketlink-fed-2.0.3.Final.jar with jbossxacml-2.0.8-SNAPSHOT.jar , i am seeing the below exception like :
Caused by: java.lang.IllegalStateException: PL00075: File could not be located :policyConfig.xml
at org.picketlink.identity.federation.core.pdp.SOAPSAMLXACMLPDP.getPDP(SOAPSAMLXACMLPDP.java:115)
at org.picketlink.identity.federation.core.pdp.SOAPSAMLXACMLPDP.<init>(SOAPSAMLXACMLPDP.java:75)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_29]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_29]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_29]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_29]
at java.lang.Class.newInstance0(Class.java:355) [rt.jar:1.6.0_29]
at java.lang.Class.newInstance(Class.java:308) [rt.jar:1.6.0_29]
at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.newInstance(NonSpringBusHolder.java:170)
... 10 more
so is the issue still exists as per the above mail threads ... i am actually deploying a war file in Jboss 7 as and picketlink-fed-2.0.3.Final.jar is inside web-inf\lib and jbossxacml-2.0.8-SNAPSHOT.jar is configured in jboss-deployment-structure.xml file ...
still i am seeing the above exception , any suggestion will be highly appriciated ????
Thanks,
Biswa
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/778433#778433]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 3 months
Re: [jboss-dev-forums] [JBoss AS 7 Development] - Extending AS 7
by John Mazzitelli
John Mazzitelli [https://community.jboss.org/people/mazz] commented on the document
"Extending AS 7"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-25627#comment-11173
--------------------------------------------------
For the record, here's some code that answers my question I had with the Mixed Approach supporing exploded deployments (I tested this and it works) - thanks to Brian for pointing me to the correct way to build the contentItem ModelNode. I put this if-stmt in there just to show you how you can do both exploded and unexploded deployment via this Mixed Approach (this is code that can go in Brian's prototype):
URL url = module.getExportedResource("fibo.ear");
ModelNode contentItem = new ModelNode();
boolean explodedDeployment = true; // this is here just to keep the code around that deploys if we are unexploded
if (explodedDeployment) {
String urlString = new File(url.toURI()).getAbsolutePath();
contentItem.get(PATH).set(urlString);
contentItem.get(ARCHIVE).set(false);
} else {
String urlString = url.toExternalForm();
contentItem.get(URL).set(urlString);
}
op.get(CONTENT).add(contentItem);
So the idea is that you don't have to package fibo.ear as an unexploded deployment file in your module - you can actually package your module with fibo.ear exploded and this will enable it to be deployed properly
--------------------------------------------------
10 years, 3 months
[JBoss AS 7 Development] - Design of AS7 multi-JSF feature
by Stan Silvert
Stan Silvert [https://community.jboss.org/people/ssilvert] modified the document:
"Design of AS7 multi-JSF feature"
To view the document, visit: https://community.jboss.org/docs/DOC-47689
--------------------------------------------------------------
*About multi-JSF*
Currently, AS7 ships with two JSF implementations, a JSF 2.1 implementation and a JSF 1.2 implementation. A web application can select which implementation is used by including a context param in web.xml. By default, it uses the JSF 2.1 imlementation.
"multi-JSF" allows installation of multiple JSF implementations (and versions) on the same AS7 server. The goal is to allow use of any JSF implementation (MyFaces or Mojarra) and any version of those implementation from JSF 1.2 all the way up to the experimental JSF 2.2 versions. This is far superior to the old WAR_BUNDLES_JSF_IMPL method because JSF jars do not need to be bundled with the webapp. More importantly, "multi-JSF" provides an implementation that is fully integrated with the container. This means more efficient annotation processing, lifecycle handling, and other integration advantages.
*How it works*
The way multi-JSF will work is that for each JSF version, a new slot is created in the modules path under *com.sun.jsf-impl*, *javax.faces.api*, and *org.jboss.as.jsf-injection*. When the jsf-subsystem is started, it scans the module path to find all the installed JSF implementations. When the JSF subsystem deploys a web app containing the specified context param, it adds the slotted modules to the deployment.
Here is an example of the context param for the latest milestone of Mojarra 2.2:
<context-param>
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>mojarra-2.2.0-m05</param-value>
</context-param>
*How a JSF implementation is installed*
A single JSF implementation is installed using a https://community.jboss.org/docs/DOC-18945 CLI deployment archive. This archive includes the required jars and module.xml files. It also includes CLI scripts for installing/uninstalling the JSF impls using the https://issues.jboss.org/browse/AS7-4265 CLI module command. You execute the installation archive like this:
> [standalone@localhost:9999 /] deploy <local path to archive>/install-mojarra-2.2.0-m05.cli
The install script inside the archive looks like this:
> module add --name=javax.faces.api --slot=mojarra-2.2.0-m05 --resources=jsf-api-2.2.0-m05.jar --module-xml=mojarra-api-module.xml
> module add --name=com.sun.jsf-impl --slot=mojarra-2.2.0-m05 --resources=jsf-impl-2.2.0-m05.jar --module-xml=mojarra-impl-module.xml
> module add --name=org.jboss.as.jsf-injection --slot=mojarra-2.2.0-m05 --resources=jboss-as-jsf-injection-7.2.0.Alpha1-SNAPSHOT.jar --module-xml=injection-module.xml
*How the CLI deployment archives are created*
A CLI deployment archive for a JSF implementation/version is created using a standalone maven project you can https://github.com/ssilvert/jboss-jsf-installer download from GitHub and run. To create an archive with the project, you call it like this:
*mojarra example*
> mvn -Djsf-version=2.2.0-m05 -Pmojarra clean assembly:single
*myfaces example*
> mvn -Djsf-version=2.1.8 -Pmyfaces clean assembly:single
This pulls in the JSF resources and creates the install/uninstall scripts. It is all bundled together in an archive (zip) file that must be manually renamed with a .cli extension.
*How to change the default JSF implementation in AS7*
The multi-JSF feature adds a new attribute to the JSF subsystem. +default-jsf-impl-slot+ allows you to change the default JSF implementation. You just need to issue a write-attribute command and set the value to one of the active impls. Then restart AS7.
https://community.jboss.org/servlet/JiveServlet/showImage/102-47689-11-19... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-47689-1...
Alternatively, you can set this in your configuration file, such as standalone.xml:
<subsystem xmlns="urn:jboss:domain:jsf:1.0" default-jsf-impl-slot="mojarra-2.2.0-m05"/>
To see which JSF impls are installed, you can execute the +list-active-jsf-impls+ operation.
/subsystem=jsf/:list-active-jsf-impls
{
"outcome" => "success",
"result" => [
"myfaces-2.1.8",
"mojarra-2.2.0-m05",
"1.2",
"main"
]
}
*Demo*
I've attached a copy of install-mojarra-2.2.0-m05.cli and install-myfaces-2.1.8.cli. You can use these *.cli files with the latest nightly build of AS7 (jboss-as-7.2.0.Alpha1-SNAPSHOT).
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47689]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 3 months
[JBoss Web Development] - Add a global valve in AS7 (7.2.x)
by Jean-Frederic Clere
Jean-Frederic Clere [https://community.jboss.org/people/jfclere] modified the document:
"Add a global valve in AS7 (7.2.x)"
To view the document, visit: https://community.jboss.org/docs/DOC-47954
--------------------------------------------------------------
The global valve feature has been added by pull request #3326.
To use it you need to put the valve class(es) in a jar and the jar in a module, tell do that with an example:
Let's use the Tomcat RemoteAddrValve.
In tomcat you would have something like in server.xml
<Valve className="org.apache.catalina.valves.RemoteAddrValve" deny="127.*"/>
In AS7 in standalone.xml in the web subsystem:
|
| <valve name="myvalve" module="mymodule" class-name="org.apache.catalina.valves.RemoteAddrValve"> |
|
| <param param-name="deny" param-value="127.*"/> |
|
| </valve> |
Or via the jboss-cli:
./valve=myvalve:add(class-name=org.apache.catalina.valves.RemoteAddrValve,module=mymodule,enabled=false)
./valve=myvalve:add-param(param-name=deny,param-value=127.*)
./valve=myvalve:write-attribute(name=enabled, value=true)
/:reload
The class needs to be in a jar.
Compile the RemoteAddrValve.java from the jbossweb sources or extract it from jbossweb.jar.
then create the jar:
jar cvf myjar.jar org/apache/catalina/valves/RemoteAddrValve.class
then create the module:
mkdir modules/mymodule
mkdir modules/mymodule/main
mv myjar.jar modules/mymodule/main
add create the modules/mymodule/main/module.xml with the content:
<module xmlns="urn:jboss:module:1.1" name="mymodule">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="myjar.jar"/>
</resources>
<dependencies>
<module name="sun.jdk"/>
<module name="javax.servlet.api"/>
<module name="org.jboss.as.web"/>
</dependencies>
</module>
To test the valve start AS7 on 0.0.0.0 (bin/standalone.sh -b 0.0.0.0) and use curl:
curl -v http://localhost:8080/ http://localhost:8080/
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.5.0 zlib/1.2.5 libidn/1.24 libssh2/1.4.1
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Server: Apache-Coyote/1.1
< Transfer-Encoding: chunked
< Date: Mon, 26 Nov 2012 10:57:17 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0
using curl and the hostname should give the normal AS7 page, if not try from a another box:
[jfclere@neo6 ~]$ curl -v http://jfcpc:8080/ http://jfcpc:8080/
* About to connect() to jfcpc port 8080 (#0)
* Trying 10.33.144.3... connected
* Connected to jfcpc (10.33.144.3) port 8080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.6.2 zlib/1.2.3 libidn/1.9 libssh2/1.2.4
> Host: jfcpc:8080
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Accept-Ranges: bytes
< ETag: W/"2432-1353665779000"
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47954]
Create a new document in JBoss Web Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 3 months