[JBoss Portal] - How to integrate NTLM authentication with JBoss portal
by prassana
hi all,
I have a portal application where i want to use ntlm authentication to authenticate and later authorize the user based on roles defined in jbp_role_membership table. The user details are available in jbp_users table and roles are defined in jbp_roles table.
I am using jcifs-1.2.6 .jar. and my web.xml is configured as
<filter-name>NTLM HTTP Authentication Filter</filter-name>
<filter-class>jcifs.http.NtlmHttpFilter</filter-class>
<init-param>
<param-name>jcifs.http.domainController</param-name>
<param-value>dchyd1.hyd.myorganisation.com</param-value>
</init-param>
<init-param>
<param-name>jcifs.util.loglevel</param-name>
<param-value>8</param-value>
</init-param>
<filter-mapping>
<filter-name>NTLM HTTP Authentication Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
i have commented out form based authentication (inorder to skip JAAS authentication)
also i have commented all security constraints. in web.xml
I have synchronized the jbp_users,jbp_role and jbp_role_membership table seperately.
The problem i have come across is that the user is able to login in automatically (without having to enter his login name and password) -i.e. remote user and principal is being set. but user role is not being read by the portal application.
Can any one tell me what might be the possible reason for this. what can be done so that the application can read the user role.
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072821#4072821
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072821
18Â years, 10Â months
[EJB 3.0] - Error with EJB3 application deployment
by snagar
Hi All
I have been trying to deploy one of my application that works perfect on JBOSS 4.0.5 while on JBOSS 4.2.0 GA version it is not deployed with the ROOT CAUSE being as shown below...
What I was keen to understand is what the error " Reason: java.lang.NoClassDefFoundError: org.hibernate.cfg.EJB3DTDEntityResolver" signifies.
2007-08-10 01:09:37,667 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@75ca39c6 { url=file:/data/jboss-4.2.0.GA/server/default/deploy/mail-service.xml }
deployer: org.jboss.deployment.SARDeployer@72897289
status: null
state: FAILED
watch: file:/data/jboss-4.2.0.GA/server/default/deploy/mail-service.xml
altDD: null
lastDeployed: 1186688239196
lastModified: 1186688239000
mbeans:
org.jboss.deployment.DeploymentInfo@229581fd { url=file:/data/jboss-4.2.0.GA/server/default/deploy/compliancetracker.ear }
deployer: org.jboss.deployment.EARDeployer@bef0bef
status: null
state: FAILED
watch: file:/data/jboss-4.2.0.GA/server/default/deploy/compliancetracker.ear
altDD: null
lastDeployed: 1186688243682
lastModified: 1186688243000
mbeans:
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:service=EJB3,module=compliancetrackerEjb.jar
State: FAILED
Reason: java.lang.NoClassDefFoundError: org.hibernate.cfg.EJB3DTDEntityResolver
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.j2ee:service=EJB3,module=compliancetrackerEjb.jar
State: FAILED
Reason: java.lang.NoClassDefFoundError: org.hibernate.cfg.EJB3DTDEntityResolver
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072815#4072815
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072815
18Â years, 10Â months
[JBoss jBPM] - Re: Where to route obsolete parent token in token multiplica
by karmen38
Hi J!
Here is the code for the custom fork. The code is a little bit too tailored to our specific needs and we are still thinking how to do it better. I hope it helps. You comments are appreciated.
Thank you,
Mark
| import java.util.LinkedList;
| import java.util.List;
|
| import org.jbpm.graph.def.ActionHandler;
| import org.jbpm.graph.def.Node;
| import org.jbpm.graph.def.Transition;
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.graph.exe.Token;
|
| public class MultiplexorAction implements ActionHandler {
|
| private static final long serialVersionUID = -5530634487359948748L;
|
| //
| // Name of the process variable that contains the list of items
| //
| private String listVariable;
|
| //
| // Name of the process variable that will contain the item -
| // output for each new token
| //
| protected String as;
|
| private List list;
| protected static final String FOREACH_PREFIX = "ea";
|
| /**
| * Create a new child token for each item in list.
| *
| * @param executionContext
| * @throws Exception
| */
| public void execute(final ExecutionContext executionContext)
| throws Exception {
| final Token rootToken = executionContext.getToken();
| final Node node = executionContext.getNode();
|
| initializeList(executionContext, rootToken);
|
| final List argSets = new LinkedList();
| Transition rootTransition = null;
| Transition defaultTransition = null;
|
| //
| // First, create a new token and execution context for each item in
| // list.
| //
| for (int i = 0; i < node.getLeavingTransitions().size(); i++) {
| final Transition transition = (Transition) node
| .getLeavingTransitions().get(i);
|
| //
| // A transition that starts from the words "root exit"
| // will be reserved for the original (root) token
| // that came to the multiplexor node
| //
| if (transition.getName() != null
| && transition.getName().toLowerCase().startsWith(
| "root exit")) {
| rootTransition = transition;
| continue;
| }
|
| //
| // A transition that starts from the words "default exit"
| // will be reserved for the new token
| // that will be the exact copy of the original (root token)
| //
| if (transition.getName() != null
| && transition.getName().toLowerCase().startsWith(
| "default exit")) {
| defaultTransition = transition;
| continue;
| }
|
| for (int j = 0; list != null && j < list.size(); j++) {
| final Object item = list.get(j);
|
| // generate a name for the new child token
| String tokenName = FOREACH_PREFIX + "." + node.getId() + "."
| + j;
|
| // generate and save new token
| final Token newToken = new Token(rootToken, tokenName);
| newToken.setTerminationImplicit(true);
| executionContext.getJbpmContext().getSession().save(newToken);
|
| // create token variable from the list item
| final ExecutionContext newExecutionContext = new ExecutionContext(
| newToken);
| newExecutionContext.getContextInstance().createVariable(as,
| item, newToken);
|
| // remember this new token with its context so we can
| // launch it later
| argSets.add(new Object[] { newExecutionContext, transition });
| }
| }
|
| // Delete the original list variable.
| // This step could be done in the process itself
| // since someone may still want reuse this list
| executionContext.getContextInstance().deleteVariable(listVariable);
|
| //
| // Now, let each new tokens leave the node.
| //
| for (int i = 0; i < argSets.size(); i++) {
| final Object[] args = (Object[]) argSets.get(i);
| node.leave((ExecutionContext) args[0], (Transition) args[1]);
| }
|
| //
| // Generate the token for the default node and launch it
| //
| if (defaultTransition != null) {
| String tokenName = "df." + node.getId();
|
| final Token newToken = new Token(rootToken, tokenName);
| newToken.setTerminationImplicit(true);
| executionContext.getJbpmContext().getSession().save(newToken);
| final ExecutionContext newExecutionContext = new ExecutionContext(
| newToken);
| node.leave(newExecutionContext, defaultTransition);
| }
|
| //
| // Send the original root token that came to this node with the list
| // to the root exit transition. The assumed case is that this
| // original token would come to the join node to wait for all its
| // children generated above.
| //
| // If the original root token is routed to some business nodes
| // then after all its children would come
| // to the join node, it will effectively terminate this original
| // token. This behavior would leave the only option for this
| // root token: to be routed to the join node to wait for all
| // its children to complete.
| //
| if (rootTransition != null) {
| node.leave(executionContext, rootTransition);
| }
| }
|
| public List getList() {
| return list;
| }
|
| public void setList(final List list) {
| this.list = list;
| }
|
| public String getAs() {
| return as;
| }
|
| public void setAs(final String as) {
| this.as = as;
| }
|
| public String getListVariable() {
| return listVariable;
| }
|
| public void setListVariable(final String listVariable) {
| this.listVariable = listVariable;
| }
|
| protected void initializeList(final ExecutionContext executionContext,
| Token token) {
| if (listVariable != null) {
| list = (List) executionContext.getContextInstance().getVariable(
| listVariable, token);
| if (list == null)
| list = (List) executionContext.getContextInstance()
| .getVariable(listVariable);
| }
| }
| }
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072812#4072812
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072812
18Â years, 10Â months
[JBoss Portal] - java.lang.NullPointerException @ InternalContentProvider.jav
by rharari
Hi,
I´ve synchronized the source with trunk branch and i´m getting this exception when running the portal:
java.lang.NullPointerException
org.jboss.portal.core.impl.model.content.InternalContentProvider.renderWindow(InternalContentProvider.java:258)
org.jboss.portal.core.impl.model.content.generic.InternalGenericContentProvider.renderWindow(InternalGenericContentProvider.java:210)
org.jboss.portal.core.cms.content.InternalCMSContentProvider.renderWindow(InternalCMSContentProvider.java:105)
org.jboss.portal.core.model.portal.command.render.RenderWindowCommand.execute(RenderWindowCommand.java:88)
org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:123)
org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:57)
org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:118)
org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:77)
org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
I´ve solved this adding the following declaration in /core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml file:
| .....
| <!-- Content renderer integration -->
| <mbean
| code="org.jboss.portal.core.cms.content.InternalCMSContentProvider"
| name="portal:service=ContentRenderer,type=cms"
| xmbean-dd=""
| xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
| <xmbean/>
| <attribute name="ContentType">cms</attribute>
| <attribute name="DecorateContent">false</attribute>
| <attribute name="PortletInstanceName">CMSPortletInstance</attribute>
| <depends
| optional-attribute-name="Registry"
| proxy-type="attribute">portal:service=ContentProviderRegistry</depends>
| <depends
| optional-attribute-name="CommandFactory"
| proxy-type="attribute">portal:commandFactory=CMSObject</depends>
|
|
| <!-- include this -->
| <depends
| optional-attribute-name="PortalAuthorizationManagerFactory"
| proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
|
|
|
| </mbean>
|
Environment: jdk 6.0 - jboss 4.0.5ga - mysql - windows
Hope this help someone else ;)
rgds,
r.harari
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072811#4072811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072811
18Â years, 10Â months
[EJB 3.0] - EJB3 Interceptor never called - how to debug?
by tynor
I am trying to add an ejb3 interceptor, but can't even get a simple one to run. From my reading of the docs, I should be able to just add the Interceptor annotations and be off and running, but my interceptor functions never run. Here's the interceptor class:
public class MyInterceptor {
|
| @PostConstruct
| public void postConstruct(InvocationContext invocation) {
| try {
| Object target = invocation.getTarget();
|
| System.err.println("In PostConstruct MyInterceptor for " + target);
| invocation.proceed();
| } catch (Exception ex) {
| log.error("Error in PostConstruct MyInterceptor", ex);
| }
| }
|
| @AroundInvoke
| public void aroundInvoke(InvocationContext invocation) {
| try {
| Object target = invocation.getTarget();
|
| System.err.println("In AroundInvoke MyInterceptor for " + target);
| invocation.proceed();
| } catch (Exception ex) {
| log.error("Error in AroundInvoke MyInterceptor", ex);
| }
| }
| }
I've tried annotating both the class and a method thusly:
@Interceptors(MyInterceptor.class)
| @Entity
| @Table(name = "client")
| public class Client implements java.io.Serializable {
| ...
| @Interceptors(MyInterceptor.class)
| public void setName(String name) {
| System.err.println("In setName");
| this.name = name;
| }
and specifically call the setName() method, but neither of my interceptor functions ever fire. No errors in the log. Can anyone spot what I've done wrong? Better yet, how can I debug this?
Seam 1.2.1-GA
JBoss AS 4.2.1
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072810#4072810
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072810
18Â years, 10Â months