[Security] - JAAS Security and FLEX 3 problem
by fjaouen
Hi,
I am currently doing a migration of a Flex Web application from JBoss 4.0.5 to JBoss 5.0.1.
In short term, in my application the security is managed by Flex (using services-config.xml) and there is no security stuff in my web.xml, neither in my jboss-web.xml (no security-domain specified). In Flex my security is custom and do not use server configuration. It is Java code which is bound to Spring security (DAO).
In my JBoss 4.0.5 all is working correctly. When I access my Web Application, my Flex login let me enter my user/password and I see in my logs my custom class called:
2009-09-23 10:10:27,682 INFO [com.test.infra.security.SpringSecurityLoginCommand] doAuthentication for user admin
2009-09-23 10:10:28,713 INFO [com.test.infra.security.SpringSecurityLoginCommand] doAuthentication for user admin succeeded
2009-09-23 10:10:28,713 INFO [com.test.infra.security.SpringSecurityLoginCommand] found user preference locale : en_US
And then I can access my application.
In JBoss 5.0.1 I dot not see these log entries. It seems that JBoss is applying default policy. And I am not able to log in my application:
2009-11-09 17:11:29,016 DEBUG [org.jboss.security.integration.JNDIBasedSecurityManagement] (http-127.0.0.1-8080-1) Creating SDC for domain=jboss-web-policy
2009-11-09 17:11:29,016 DEBUG [org.jboss.security.plugins.auth.JaasSecurityManagerBase.jboss-web-policy] (http-127.0.0.1-8080-1) CallbackHandler: org.jboss.security.auth.callback.JBossCallbackHandler@92f645
2009-11-09 17:11:29,016 DEBUG [org.jboss.security.plugins.auth.JaasSecurityManagerBase.jboss-web-policy] (http-127.0.0.1-8080-1) CachePolicy set to: org.jboss.util.TimedCachePolicy@66389d
2009-11-09 17:11:29,016 DEBUG [org.jboss.security.integration.JNDIBasedSecurityManagement] (http-127.0.0.1-8080-1) setCachePolicy, c=org.jboss.util.TimedCachePolicy@66389d
I do not have any idea why JAAS is applying in that case ? Neither what have change in JBoss which could give this behavior ? Neither what I have to do avoid this ?
I spent a lot of time searching the Web but I do not find any response.
Thanks anybody could help me pass this step !
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264846#4264846
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264846
16 years, 5 months
[jBPM Users] - [BPM 4.2] About the user code classloading mechanism
by xalperte
Hi,
Reading the documentation there is a section that introduces the three different mechanisms used by jBPM 4 to look for user classes in the classpath. One of these mechanism is the "User Application Classpath (Ear/War) where the call is done".
I'm not really sure about what exactly that means, I understand that when we do a Command call to the jBPM API from our application, our application classes (ear/war) are fully available during the command execution phase, but, what happens when we want to execute some kind of logic inside a Job, and that logic needs access to our application classes? (for instance: seam components or ejbs), are they also available.
This is very important for me because I'm trying to integrate the jBPM into my own EAR file in order to avoid classpath complications. In the past (jBPM 3.2) I tried to use the jBPM as an independent service in order to share the service between the JBoss Portal Workflow feature and my own application workflow features, but I experienced a lot of problems trying to access my EJBs (the ear has an isolated classpath).
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264831#4264831
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264831
16 years, 5 months
[JBoss Remoting Users] - Can't load remote interface of ejb in my client from jboss-e
by vikram_khati
Hi,
I had written a client which is trying to call the ejb dynamically using reflection api. Instead of putting the home and remote interfaces in the classpath of the client application I am trying to load these interfaces from jboss server using RMI codebase. For this i had also added the security manager in my client so that it can load the interfaces from jboss server. This thing is working in jboss-4.0.3SP1 completly, but it is not working in jboss-eap-4.2 completely.
Client is loading the home interface but it is not loading the remote interface from jboss-eap-4.2 while Client is loading both home interface and remote interface from 4.0.3SP1. Those interfaces are present in RMI codebase URL(I am able to download those interfaces with the help of browser in that URL)
My Client code is as follow:
public class Client
{
public static void main(String args[])
{
System.setProperty("java.security.policy","D:\\VB\\policy.all");
SecurityManager sm=new SecurityManager();
System.setSecurityManager(sm);
String jndiName="CFFESBean",homeInterfaceName="nsdg.client.CFFESHome",remoteInterfaceName="nsdg.client.CFFESRemote";
String remoteMethodName="initialise";
Properties ps=new Properties();
ps.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
ps.put(InitialContext.PROVIDER_URL, "jnp://localhost:1099");
ps.put(InitialContext.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
try
{
Context ctx=new InitialContext(ps);
System.out.println("1");
Object homeObject=ctx.lookup(jndiName);
System.out.println("2");
EJBHome ejbHomeObject=(EJBHome)PortableRemoteObject.narrow(homeObject,EJBHome.class);
EJBMetaData ejbMetaData=ejbHomeObject.getEJBMetaData();
Class homeInterfaceClass=ejbMetaData.getHomeInterfaceClass();
System.out.println("ejbHomeObject= "+ejbHomeObject);
Class remoteInterfaceClass=ejbMetaData.getRemoteInterfaceClass();
System.out.println("Remote Interface Class= "+remoteInterfaceClass);
Method homeInterfaceMethod = homeInterfaceClass.getMethod("create",null);
homeInterfaceMethod.setAccessible(true);
System.out.println("3");
EJBObject remoteObject=(EJBObject)homeInterfaceMethod.invoke(homeObject, null);
System.out.println("4");
Method remoteInterfaceMethod = remoteInterfaceClass.getMethod(remoteMethodName,null);
remoteInterfaceMethod.setAccessible(true);
Object returnObject=remoteInterfaceMethod.invoke(remoteObject, null);
System.out.println("returning");
}catch (NamingException e)
{
System.out.println("Inside Naming Exception");
e.printStackTrace();
}catch (Exception e)
{
System.out.println("Inside Exception");
e.printStackTrace();
}
}
}
And the output is as follow:
1
2
ejbHomeObject= CFFESBeanHome
Remote Interface Class= interface nsdg.client.CFFESRemote
3
Inside Exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at cffes.client.Client.main(Client.java:45)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy0.create(Unknown Source)
... 5 more
Caused by: java.lang.ClassNotFoundException: nsdg.client.CFFESRemote
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.invocation.MarshalledValueInputStream.resolveProxyClass(MarshalledValueInputStream.java:159)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:195)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
... 6 more
What can be the solution of this problem so that it will work completly with
jboss-eap-4.2
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264821#4264821
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264821
16 years, 5 months
[EJB] - Can't load remote interface of ejb in my client from jboss-e
by vikram_khati
Hi,
I had written a client which is trying to call the ejb dynamically using reflection api. Instead of putting the home and remote interfaces in the classpath of the client application I am trying to load these interfaces from jboss server using RMI codebase. For this i had also added the security manager in my client so that it can load the interfaces from jboss server. This thing is working in jboss-4.0.3SP1 completly, but it is not working in jboss-eap-4.2 completely.
Client is loading the home interface but it is not loading the remote interface from jboss-eap-4.2 while Client is loading both home interface and remote interface from 4.0.3SP1. Those interfaces are present in RMI codebase URL(I am able to download those interfaces with the help of browser in that URL)
My Client code is as follow:
public class Client
{
public static void main(String args[])
{
System.setProperty("java.security.policy","D:\\VB\\policy.all");
SecurityManager sm=new SecurityManager();
System.setSecurityManager(sm);
String jndiName="CFFESBean",homeInterfaceName="nsdg.client.CFFESHome",remoteInterfaceName="nsdg.client.CFFESRemote";
String remoteMethodName="initialise";
Properties ps=new Properties();
ps.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
ps.put(InitialContext.PROVIDER_URL, "jnp://localhost:1099");
ps.put(InitialContext.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
try
{
Context ctx=new InitialContext(ps);
System.out.println("1");
Object homeObject=ctx.lookup(jndiName);
System.out.println("2");
EJBHome ejbHomeObject=(EJBHome)PortableRemoteObject.narrow(homeObject,EJBHome.class);
EJBMetaData ejbMetaData=ejbHomeObject.getEJBMetaData();
Class homeInterfaceClass=ejbMetaData.getHomeInterfaceClass();
System.out.println("ejbHomeObject= "+ejbHomeObject);
Class remoteInterfaceClass=ejbMetaData.getRemoteInterfaceClass();
System.out.println("Remote Interface Class= "+remoteInterfaceClass);
Method homeInterfaceMethod = homeInterfaceClass.getMethod("create",null);
homeInterfaceMethod.setAccessible(true);
System.out.println("3");
EJBObject remoteObject=(EJBObject)homeInterfaceMethod.invoke(homeObject, null);
System.out.println("4");
Method remoteInterfaceMethod = remoteInterfaceClass.getMethod(remoteMethodName,null);
remoteInterfaceMethod.setAccessible(true);
Object returnObject=remoteInterfaceMethod.invoke(remoteObject, null);
System.out.println("returning");
}catch (NamingException e)
{
System.out.println("Inside Naming Exception");
e.printStackTrace();
}catch (Exception e)
{
System.out.println("Inside Exception");
e.printStackTrace();
}
}
}
And the output is as follow:
1
2
ejbHomeObject= CFFESBeanHome
Remote Interface Class= interface nsdg.client.CFFESRemote
3
Inside Exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at cffes.client.Client.main(Client.java:45)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy0.create(Unknown Source)
... 5 more
Caused by: java.lang.ClassNotFoundException: nsdg.client.CFFESRemote
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.invocation.MarshalledValueInputStream.resolveProxyClass(MarshalledValueInputStream.java:159)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:195)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
... 6 more
What can be the solution of this problem so that it will work completly with
jboss-eap-4.2
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264817#4264817
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264817
16 years, 5 months
[Javassist Users] - ClassLoader and java.lang.ClassNotFoundException
by marcosroriz
Hi I'm using Javassist as a library for our library (InterCommunication on Ginga) that with PhoneME + Personal Basis Profile will be the platform for embedded devices (digital tv). The question is that we're using Javassist to create Stubs on the fly for Xlets, which is like Applets but for Digital TV. However since Javassist will be a core component of our library it will be in the XbootClassPath. Even through we add (appending or inserting) the AppClassCL, that views the ClassPath, we can sucesfully find the targeting class that we want however when we try to load we get this error described below.
One reason is that the CL of the makeClass method is using the CL that loaded javassist, how can we do a workaround on that situation?
Thanks in advance,
Marcos
Error Message:
CAN WE FIND?? file:/home/marcosroriz/workspace/UFG-InterAPPJava-SimpleApplication/dist/Server.class
| java.lang.ClassNotFoundException: Server
| at java.lang.ClassLoader.loadBootstrapClass(Unknown Source)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Unknown Source)
| at br.ufg.inf.core.interapp.ClassCreator.makeClass(Unknown Source)
| at br.ufg.inf.core.interapp.Registry.lookup(Native Method)
| at br.ufg.inf.core.interapp.IxcRegistry.lookup(Unknown Source)
| at Client.startXlet(Unknown Source)
| at com.sun.xlet.XletManager.handleRequest(Unknown Source)
| at com.sun.xlet.XletStateQueue.dispatchRequests(Unknown Source)
| at com.sun.xlet.XletStateQueue$1.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
| at java.lang.Thread.startup(Unknown Source)
| java.lang.ClassCastException: Server_Stub
| at Client.startXlet(Unknown Source)
| at com.sun.xlet.XletManager.handleRequest(Unknown Source)
| at com.sun.xlet.XletStateQueue.dispatchRequests(Unknown Source)
| at com.sun.xlet.XletStateQueue$1.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
| at java.lang.Thread.startup(Unknown Source)
|
Code:
private static CtClass cc;
|
| public static void makeClass(String iName) {
| try {
| ClassPool pool = ClassPool.getDefault();
|
| System.out.println("SYS CL: " + ClassLoader.getSystemClassLoader());
|
| pool.insertClassPath(new LoaderClassPath(pool.getClass().getClassLoader()));
| pool.insertClassPath(new LoaderClassPath(pool.getClassLoader()));
| pool.insertClassPath(new LoaderClassPath(ClassLoader.getSystemClassLoader()));
|
| System.out.println("CAN WE FIND?? " + pool.find("Server"));
| cc = pool.makeClass(iName + "_Stub");
| ....
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264806#4264806
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264806
16 years, 5 months