[Security & JAAS/JBoss] - SecurityAssociation: javax.security.auth.Subject dissapears
by wgiersche
I'm working in large, international banking project in Switzerland. In an Eclipse RCP 3.4 client, some of the remote method calls fail with "Caller unauthorized". We're using ClientLoginModule and JAAS Logon. Everything used to work with JBoss AS 4.2.2.GA. Now, with the client libraries of Jboss AS 5.1, some method calls will not be accepted by the server, for the SecurityContext of the RMI seems to be incomplete.
We could trace the problem down to the SecurityAssociation class. In a debug session we could show that immediately before a successful method call, SecurityAssociation.getSubject() would return the expected Subject. Magically, before other calls to remote methods it would return null. Interestingly, getPrincipal() and getCredential() both return the expected values, still. Method calls fail if and only if getSubject() returns null. We believe that there is a flaw in the way the SubjectThreadLocal is used. The problem is only reproducible in the full RCP application, thus we assume that the problem is that not all Threads are correctly equipped with a consistent SubjectStack. Can anybody help us out? You must have heard this before, don't you?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249230#4249230
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249230
16 years, 9 months
[JBoss Portal] - Re: Portlet Edit mode
by jberdat@hotmail.com
Ok,
just to reply if it help others.
in portlet.xml
| <portlet>
| <description>portfolioEdit</description>
| <portlet-name>portfolioEdit</portlet-name>
| <display-name>portfolioEdit</display-name>
| <portlet-class>home.prototype.portal.portfolio.portlet.PortfolioEditPortlet</portlet-class>
| <init-param>
| <name>javax.portlet.faces.defaultViewId.view</name>
| <value>/portfolioEdit.xhtml</value>
| </init-param>
| <init-param>
| <name>javax.portlet.faces.defaultViewId.edit</name>
| <value>/portfolioEdit.PortletEditMode.xhtml</value>
| </init-param>
| <init-param>
| <name>javax.portlet.faces.defaultViewId.help</name>
| <value>/portfolioEdit.PortletHelpMode.xhtml</value>
| </init-param>
| <init-param>
| <name>javax.portlet.faces.preserveActionParams</name>
| <value>true</value>
| </init-param>
| <init-param>
| <name>javax.portlet.faces.autoDispatchEvents</name>
| <value>true</value>
| </init-param>
| <init-param>
| <name>javax.portlet.faces.bridgeEventHandler</name>
| <value>home.prototype.portal.common.event.SelectionChangedPortfolioEventHandler</value>
| </init-param>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| <portlet-mode>EDIT</portlet-mode>
| <portlet-mode>HELP</portlet-mode>
| <portlet-mode>admin</portlet-mode>
| </supports>
| <supported-locale>en</supported-locale>
| <supported-locale>it</supported-locale>
| <supported-locale>de</supported-locale>
| <portlet-info>
| <title>Portfolio Edition</title>
| <keywords>management,admin</keywords>
| </portlet-info>
| <supported-processing-event>
| <qname xmlns:home="urn:home:prototype:portal:common:event">home:SelectionChangedPortfolioEvent</qname>
| </supported-processing-event>
| </portlet>
|
|
and in portlet-instances.xml
| <deployment>
| <if-exists>overwrite</if-exists>
| <instance>
| <instance-id>portfolioEdit</instance-id>
| <portlet-ref>portfolioEdit</portlet-ref>
| <security-constraint>
| <policy-permission>
| <action-name>EDIT</action-name>
| <role-name>Admin</role-name>
| </policy-permission>
| <policy-permission>
| <action-name>view</action-name>
| <unchecked/>
| </policy-permission>
| </security-constraint>
| </instance>
| </deployment>
| anonymous wrote :
| |
| | After that, there is no need to do anything in the implementation class PortfolioEditPortlet
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249226#4249226
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249226
16 years, 9 months
[JBoss jBPM] - Re: How to Generate ad-hoc Task, activities & process ??
by rogerofyan
Sure, this is definitely ok for jBPM4.
faisalgeek, I suppose you means generating task, activities & process at run time, not only at the process definition(jpdl), don't u?
I use to have similar requirement, and I found few documents about the internal jBPM api. So I had to read the source code of jBPM4.
I can share my code of generating task & activity at runtime.
| import java.util.List;
|
| import org.jbpm.api.Execution;
| import org.jbpm.api.ExecutionService;
| import org.jbpm.api.TaskService;
| import org.jbpm.api.listener.EventListener;
| import org.jbpm.api.listener.EventListenerExecution;
| import org.jbpm.jpdl.internal.activity.TaskActivity;
| import org.jbpm.pvm.internal.env.Environment;
| import org.jbpm.pvm.internal.env.SpringContext;
| import org.jbpm.pvm.internal.history.HistoryEvent;
| import org.jbpm.pvm.internal.history.events.TaskActivityStart;
| import org.jbpm.pvm.internal.model.Activity;
| import org.jbpm.pvm.internal.model.ActivityImpl;
| import org.jbpm.pvm.internal.model.ExecutionImpl;
| import org.jbpm.pvm.internal.model.Transition;
| import org.jbpm.pvm.internal.model.TransitionImpl;
| import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
| import org.jbpm.pvm.internal.session.DbSession;
| import org.jbpm.pvm.internal.task.TaskImpl;
| import org.jbpm.pvm.internal.util.Clock;
|
| /**
| * èªå¨为åÂÂÃ¥ÂÂå¦å¦é¢åÂÂ建ä¸Â个任å¡ï¼Â为å¦习ä¸Âå¿ÂÃ¥ÂÂ建两个任å¡ãÂÂ
| *
| * @author <a href="mailto:rogerofyan@gmail.com">Roger Yan</a>
| *
| */
| public class ApplicationListener implements EventListener {
| // private GroupManager groupManager;
| @Override
| public void notify(EventListenerExecution execution) throws Exception {
| ExecutionImpl exe = (ExecutionImpl) execution;
| ActivityImpl fork = exe.getActivity();
| //creating two tasks and associated activities
| placeViceMentorTask(exe, "center1");
| placeViceMentorTask(exe, "center2");
| }
|
| private void placeViceMentorTask(ExecutionImpl execution, String assignee) {
| Environment env = Environment.getCurrent();
| TaskService taskService = env.get(TaskService.class);
| DbSession dbSession = env.get(DbSession.class);
|
| // è·åÂÂå½ÂÃ¥ÂÂæÂ§è¡ÂçÂÂç»Âç¹ç¸åÂ
³ä¿¡æÂ¯
| ActivityImpl fork = execution.getActivity();
| List<Transition> trans = fork.getOutgoingTransitions();
| TransitionImpl transition = (TransitionImpl) trans.get(0);
| ActivityImpl join = (ActivityImpl) transition.getDestination().getOutgoingTransitions().get(0)
| .getDestination();
|
| // 1. creating an activity
| ActivityImpl newActivity = fork.getProcessDefinition().createActivity("æÂÂ交å¯导å¸Âä¿¡æÂ¯1");
| TaskActivity ta = new TaskActivity();
| newActivity.setBehaviour(ta);
|
| // 2.creating an outgoing transition
| TransitionImpl outgoing = newActivity.createOutgoingTransition();
| // outgoing.setDestination((ActivityImpl) join);
| outgoing.setName("è³æÂÂ妿ÂÂå¡ä¸Âå¿Â审核");
| join.addIncomingTransition(outgoing);
|
| // 3.creating an execution
| ExecutionImpl newExec = execution.createExecution();
| newExec.setActivity(newActivity);
| newExec.setState(Execution.STATE_ACTIVE_CONCURRENT);
| newExec.setName("viceMentorExecution");
| newExec.setTransition(outgoing);
| newExec.setPropagation(Propagation.UNSPECIFIED);
| newExec.setHistoryActivityStart(Clock.getCurrentTime());
| dbSession.save(newExec);
|
| TaskImpl task = (TaskImpl) taskService.newTask();
| task.setAssignee(assignee);
| task.setName("æÂÂ交å¯导å¸ÂèµÂæÂÂ1");
| task.setExecution(newExec);
| task.setSignalling(true);
| taskService.saveTask(task);
|
| HistoryEvent.fire(new TaskActivityStart(task), newExec);
| newExec.waitForSignal();
| }
| }
|
The code looks ugly, but it just works for me.
Take it as a reference.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249222#4249222
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249222
16 years, 9 months
[JBoss Cache: Core Edition] - "org.jboss.cache.lock.TimeoutException": how to find out whi
by yanfengzhang816
I'm using JBoss Cache 1.4.1 SP12.
Recently I got a lock timed-out exception(see below) very frequently. And it is not reproducible. Several monthes ago I could find this exception occasionally and I moved to 1.4.1 SP12, then the problem disappered. But now it comes back...:(
My question is :
1. How can I find out which cache node is locked? (any specific log category)
2. Is this exception dangerous? (It is logged as a WARNING)
12:48:30,921 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@f5bcc9
java.lang.RuntimeException:
at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1196)
at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:76)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1406)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:94)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:70)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.remoting.ReplicantsManagerInterceptor.invoke(ReplicantsManagerInterceptor.java:51)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:280)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:280)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:866)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:608)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:406)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
Caused by: org.jboss.cache.ReplicationException: rsp=sender=172.18.15.23:34579, retval=null, received=false, suspected=false
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:4464)
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:4386)
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:4504)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:110)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:88)
at org.jboss.cache.interceptors.ReplicationInterceptor.runPreparePhase(ReplicationInterceptor.java:152)
at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:69)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:887)
at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1170)
... 32 more
Caused by: org.jboss.cache.lock.TimeoutException: Response timed out: sender=172.18.15.23:34579, retval=null, received=false, suspected=false
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:4462)
... 41 more
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249220#4249220
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249220
16 years, 9 months
[JBossWS] - Problem deploy WS (ClassFormatError)
by konstt2000
Hi,
I have a project java and compile it with ANT. When deploy the war (with his web.xml, etc) gives me a error.
| 14:23:19,852 ERROR [MainDeployer] Could not create deployment: file:/D:/jboss-soa-p.4.3.0/jboss-as_SOA/server/default/deploy/WebServiceGde.war
| java.lang.ClassFormatError: Method "getDescripcion" in class es/ree/gde/webservice/logica/WebServiceGde has illegal signature "ourceFile"
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
| at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
| at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
| at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
| at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
| at java.security.AccessController.doPrivileged(Native Method)
| at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
| at org.jboss.wsf.container.jboss42.JAXWSDeployerHookPreJSE.getEndpointBeans(JAXWSDeployerHookPreJSE.java:145)
| at org.jboss.wsf.container.jboss42.JAXWSDeployerHookPreJSE.isWebServiceDeployment(JAXWSDeployerHookPreJSE.java:104)
| at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:87)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:79)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy46.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy9.deploy(Unknown Source)
|
If I believe a project web in eclipse and deploy the webservice works fine.
I believe
I believe that the classes are not compiled well. In addition they occupy differently the .class that I compile that those that eclipse generates. ¿?¿?¿??
I work with JDK1.5 and JBOSS.4.3
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249211#4249211
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249211
16 years, 9 months