[JBoss-dev] finder optimization round 2 checked in
This pass is significantly different than the last, which didn't really adhere to the component contract for CMP. In my tests (with 1000 entities), these finders take 40%-50% of the time they used to. This should also resolve the problems that the original implementation had with defined finders that needed to do joins. This feature is activated by placing 'true' in the element in jaws.xml. High points: This implementation preloads the data from the database and keeps it around. The Load operation refers to the preloaded data, if available. The preloaded data is mapped by transaction, so that what a transaction sees for data is what was in the database when the finder was called. JAWS now registers a Synchronization with the transaction to clear out the preloaded data when the transaction commits or rolls back. Finders that are invoked without a transaction active are basically lumped into one big pile right now - any access will get whatever was last preread outside of a transaction. I don't believe that we can guarentee serializable transaction isolation at this point: not without doing select for update at any rate. (Note that the select for update option won't effect the preloaded data right now). TODO: Shorten critical sections around the transaction->entity map. Use weak references of some sort for the read-ahead data (ease memory hit) clean up in CMPPersistenceManager.findEntities (I'll do this tomorrow). Get my tests into the jbosstest module. Lots of testing in intensely loaded environments! Add an upper limit setting for the number of rows to pre-load (per finder). More minor things that I'm too tired to think of at this point. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] CVS update: jboss/src/lib jboss-jaas.jar jbosssx.jar
Please can you take us off your mailing list. Thanks. > -Original Message- > From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, June 13, 2001 6:20 AM > To: [EMAIL PROTECTED] > Subject: [JBoss-dev] CVS update: jboss/src/lib jboss-jaas.jar > jbosssx.jar > > User: starksm > Date: 01/06/12 22:19:49 > > Modified:src/lib jboss-jaas.jar jbosssx.jar > Log: > Integrate JBossSX changes > > Revision ChangesPath > 1.10 +21 -20jboss/src/lib/jboss-jaas.jar > > <> > > > 1.10 +23 -16jboss/src/lib/jbosssx.jar > > <> > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc JDBCCommandFactory.java JDBCDefinedFinderCommand.java JDBCFindAllCommand.java JDBCFindByCommand.java JDBCFinderCommand.java JDBCLoadEntitiesCommand.java JDBCLoadEntityCommand.java
User: danch Date: 01/06/12 23:52:17 Modified:src/main/org/jboss/ejb/plugins/jaws/jdbc JDBCCommandFactory.java JDBCDefinedFinderCommand.java JDBCFindAllCommand.java JDBCFindByCommand.java JDBCFinderCommand.java JDBCLoadEntitiesCommand.java JDBCLoadEntityCommand.java Log: second pass at collection finder optimization - this fixes problem with defined finders doing joins Revision ChangesPath 1.9 +149 -1 jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCCommandFactory.java Index: JDBCCommandFactory.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCCommandFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JDBCCommandFactory.java 2001/05/27 17:59:00 1.8 +++ JDBCCommandFactory.java 2001/06/13 06:52:17 1.9 @@ -8,9 +8,16 @@ package org.jboss.ejb.plugins.jaws.jdbc; import java.lang.reflect.Method; +import java.util.Map; +import java.util.HashMap; +import java.util.List; +import java.util.LinkedList; +import java.util.Iterator; import javax.naming.Context; import javax.naming.InitialContext; +import javax.transaction.Transaction; +import javax.transaction.TransactionManager; import org.jboss.ejb.EntityContainer; import org.jboss.ejb.DeploymentException; @@ -38,13 +45,14 @@ import org.jboss.ejb.plugins.jaws.metadata.FinderMetaData; import org.jboss.logging.Log; +import org.jboss.util.FinderResults; /** * JAWSPersistenceManager JDBCCommandFactory * * @author mailto:[EMAIL PROTECTED]";>Justin Forder * @author danch (Dan Christopherson - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public class JDBCCommandFactory implements JPMCommandFactory { @@ -56,6 +64,20 @@ private Log log; private boolean debug = false; + /** a map of data preloaded within some transaction for some entity. This map +* is keyed by Transaction and the data are hashmaps with key = entityKey and +* data = Object[] containing the entity data. +* @todo use weak references to ease memory. */ + private Map preloadedData = new HashMap(); + /** A map of data preloaded without a transaction context. key=entityKey, +* data = Object[] containing entity data +* @todo use weak references to ease memory. +*/ + private Map nonTransactionalPreloadData = new HashMap(); + + /** a Transaction manager so that we can link preloaded data to a transaction */ + private TransactionManager tm; + // These support singletons (within the scope of this factory) private JDBCBeanExistsCommand beanExistsCommand; private JPMFindEntitiesCommand findEntitiesCommand; @@ -87,6 +109,8 @@ if (metadata == null) { throw new DeploymentException("No metadata found for bean " + ejbName); } + + tm = (TransactionManager) container.getTransactionManager(); } // Public @@ -231,5 +255,129 @@ } + /** Add preloaded data for an entity within the scope of a transaction */ + /*package*/ void addPreloadData(Object entityKey, Object[] entityData) + { + Transaction trans = null; + try { + trans = tm.getTransaction(); + } catch (javax.transaction.SystemException sysE) { + log.warning("System exception getting transaction for preload - can't get preloaded data for "+entityKey); + return; + } +//log.debug("PRELOAD: adding preload for "+entityKey+" in transaction "+(trans != null ? trans.toString() : "NONE")); + + if (trans != null) { + synchronized (preloadedData) { +Map entitiesInTransaction = (Map)preloadedData.get(trans); +if (entitiesInTransaction == null) { + try { + trans.registerSynchronization(new PreloadClearSynch(trans)); + } catch (javax.transaction.SystemException se) { + log.warning("System exception getting transaction for preload - can't get preloaded data for "+entityKey); + return; + } catch (javax.transaction.RollbackException re) { + log.warning("Rollback exception getting transaction for preload - can't get preloaded data for "+entityKey); + return; + } + entitiesInTransaction = new HashMap(); + preloadedData.put(trans, entitiesInTransaction); +} +entitiesInTransaction.put(entityKey, entityData); + } + } else { + synchroni
[JBoss-dev] CVS update: jboss/src/resources/org/jboss/metadata jaws.dtd
User: danch Date: 01/06/12 23:52:18 Modified:src/resources/org/jboss/metadata jaws.dtd Log: second pass at collection finder optimization - this fixes problem with defined finders doing joins Revision ChangesPath 1.5 +3 -1 jboss/src/resources/org/jboss/metadata/jaws.dtd Index: jaws.dtd === RCS file: /cvsroot/jboss/jboss/src/resources/org/jboss/metadata/jaws.dtd,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jaws.dtd 2001/05/29 22:02:58 1.4 +++ jaws.dtd 2001/06/13 06:52:18 1.5 @@ -53,7 +53,9 @@ a specific ordering. it must contain name and query elements and my contain 1 order element. After JBoss version 2.3, it may contain a read-ahead element indicating whether - or not all data for the entities selected should be loaded immediatly. --> + or not all data for the entities selected should be loaded immediatly. Note + that JAWS/JBoss cannot guarentee serializable transactions with the read-ahead + option!-->
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/jaws JPMLoadEntitiesCommand.java
User: danch Date: 01/06/12 23:52:17 Modified:src/main/org/jboss/ejb/plugins/jaws JPMLoadEntitiesCommand.java Log: second pass at collection finder optimization - this fixes problem with defined finders doing joins Revision ChangesPath 1.2 +6 -2 jboss/src/main/org/jboss/ejb/plugins/jaws/JPMLoadEntitiesCommand.java Index: JPMLoadEntitiesCommand.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jaws/JPMLoadEntitiesCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JPMLoadEntitiesCommand.java 2001/05/27 00:49:15 1.1 +++ JPMLoadEntitiesCommand.java 2001/06/13 06:52:17 1.2 @@ -13,10 +13,14 @@ import org.jboss.ejb.plugins.jaws.metadata.PkFieldMetaData; /** - * Interface for JAWSPersistenceManager LoadEntities + * Interface for JAWSPersistenceManager LoadEntities - pre load data for a + * batch of entities. 'LoadEntities' is a bit of a misnomer - it should actually + * preload the data into a the FinderResults so that the LoadEntity command + * can later get it. This somewhat circuitous route is needed so that we don't + * violate the container contract by loading data before ejbActivate is called. * * @author mailto:[EMAIL PROTECTED]";>danch (Dan Christopherson) - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public interface JPMLoadEntitiesCommand { ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/lib jboss-jaas.jar jbosssx.jar
User: starksm Date: 01/06/12 22:19:49 Modified:src/lib jboss-jaas.jar jbosssx.jar Log: Integrate JBossSX changes Revision ChangesPath 1.10 +21 -20jboss/src/lib/jboss-jaas.jar <> 1.10 +23 -16jboss/src/lib/jbosssx.jar <> ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] org.jboss.mgt.ContainerMgt now producing a InstanceAlreadyExistsException on redploy
As of today's latest cvs code, on redeploy of a ejb-jar I am seeing a new InstanceAlreadyExistsException exception when a org.jboss.mgt.ContainerMgt is created in the ContainerFactory registerContainer method. Here is the point at which the module is stopped and reployed and the exception that results: [J2EE Deployer Default] Stopping module security-proxy.jar [Container factory] Undeploying:file:/D:/usr/local/src/cvsroot/jBoss/jboss/dist/tmp/deploy/Default/security-proxy.jar [Container factory] Undeployed application: file:/D:/usr/local/src/cvsroot/jBoss/jboss/dist/tmp/deploy/Default/security-proxy.jar [J2EE Deployer Default] Destroying application security-proxy.jar [J2EE Deployer Default] Deploy J2EE application: file:/D:/usr/local/src/cvsroot/jBoss/jbosstest/build/deploy/security-proxy.jar [J2EE Deployer Default] Create application security-proxy.jar [J2EE Deployer Default] install module security-proxy.jar [Default] ejb-jar Manifest: java.util.jar.Manifest@6c14150a [Container factory] Deploying:file:/D:/usr/local/src/cvsroot/jBoss/jboss/dist/tmp/deploy/Default/security-proxy.jar/ [Verifier] Verifying file:/D:/usr/local/src/cvsroot/jBoss/jboss/dist/tmp/deploy/Default/security-proxy.jar/ejb1002.jar [Verifier] ProxiedEntityBean: Verified. [Verifier] ProxiedStatelessBean: Verified. [Verifier] ProxiedStatefulBean: Verified. [Container factory] Deploying ProxiedEntityBean [Default] lookup securityManager name: java:/jaas/proxy-test [Default] setSecurityProxy, org.jboss.test.security.proxy.EntitySecurityProxy@46e381 [Container factory] Container Invoker RMI Port='' [Container factory] Container Invoker Client SocketFactory='Default' [Container factory] Container Invoker Server SocketFactory='Default' [Container factory] Container Invoker Optimize='true' [Container Management Proxy] Registration is not done -> destroy [Container Management Proxy] Destroying [Container Management Proxy] Destroyed [Default] javax.management.InstanceAlreadyExistsException: Management:container=ProxiedEntityBean [Default] at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134) [Default] [Default] at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:2352) [Default] [Default] at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.java:388) [Default] [Default] at org.jboss.ejb.ContainerFactory.registerContainer(ContainerFactory.java:697) [Default] [Default] at org.jboss.ejb.ContainerFactory.createEntityContainer(ContainerFactory.java:681) [Default] [Default] at org.jboss.ejb.ContainerFactory.createContainer(ContainerFactory.java:580) [Default] [Default] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:452) [Default] [Default] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:347) [Default] [Default] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:286) [Default] [Default] at java.lang.reflect.Method.invoke(Native Method) [Default] [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) [Default] [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) [Default] [Default] at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:489) [Default] [Default] at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:467) [Default] [Default] at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:211) [Default] [Default] at java.lang.reflect.Method.invoke(Native Method) [Default] [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) [Default] [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) [Default] [Default] at org.jboss.jmx.server.JMXAdaptorImpl.invoke(JMXAdaptorImpl.java:69) [Default] [Default] at java.lang.reflect.Method.invoke(Native Method) [Default] [Default] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) [Default] [Default] at sun.rmi.transport.Transport$1.run(Transport.java:142) [Default] [Default] at java.security.AccessController.doPrivileged(Native Method) [Default] [Default] at sun.rmi.transport.Transport.serviceCall(Transport.java:139) [Default] [Default] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443) [Default] [Default] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643) [Default] [Default] at java.lang.Thread.run(Thread.java:484) [Default] ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/security/test TestSecurityProxy.java TestProjRepository.java
User: starksm Date: 01/06/12 21:55:50 Modified:src/main/org/jboss/test/security/test TestProjRepository.java Added: src/main/org/jboss/test/security/test TestSecurityProxy.java Log: Initial tests of the custom security proxy layer Revision ChangesPath 1.2 +1 -1 jbosstest/src/main/org/jboss/test/security/test/TestProjRepository.java Index: TestProjRepository.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/test/TestProjRepository.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestProjRepository.java 2001/03/05 10:11:08 1.1 +++ TestProjRepository.java 2001/06/13 04:55:50 1.2 @@ -26,13 +26,13 @@ or fail based on whether the user can do what they should be able to do and are stopped from not doing what they should not do. A failure of the test only occurs if a user sees a SecurityException when they -should not, or a user does not see a SecurityException when they do. +should not, or a user does not see a SecurityException when they should. This requires that this test module's accessTest ecpected values be kept in synch with the resources/security/sample_policy.xml that is deployed. @author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@version $Revision: 1.2 $ */ public class TestProjRepository extends junit.framework.TestCase { 1.1 jbosstest/src/main/org/jboss/test/security/test/TestSecurityProxy.java Index: TestSecurityProxy.java === package org.jboss.test.security.test; import java.io.IOException; import java.rmi.RemoteException; import javax.ejb.CreateException; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.rmi.PortableRemoteObject; import javax.security.auth.login.*; import org.jboss.test.security.interfaces.Entity; import org.jboss.test.security.interfaces.EntityHome; import org.jboss.test.security.interfaces.IOSession; import org.jboss.test.security.interfaces.IOSessionHome; /** Simple tests of security stateless, stateful and entity beans via custom security proxies. @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class TestSecurityProxy extends junit.framework.TestCase { static String username = "scott"; static char[] password = "echoman".toCharArray(); LoginContext lc; boolean loggedIn; public TestSecurityProxy(String name) { super(name); } protected void setUp() throws Exception { Deploy.deploy("security-proxy.jar"); } public void testProxiedStatelessBean() throws Exception { login(); InitialContext jndiContext = new InitialContext(); Object obj = jndiContext.lookup("ProxiedStatelessBean"); obj = PortableRemoteObject.narrow(obj, IOSessionHome.class); IOSessionHome home = (IOSessionHome) obj; System.out.println("Found ProxiedStatelessBean"); IOSession bean = home.create(); System.out.println("Created ProxiedStatelessBean"); System.out.println("ProxiedStatelessBean.read() -> "+bean.read("/user/scott/.password")); bean.write("/user/scott/.password"); System.out.println("ProxiedStatelessBean.write()"); bean.remove(); logout(); } public void testProxiedStatefulBean() throws Exception { login(); InitialContext jndiContext = new InitialContext(); Object obj = jndiContext.lookup("ProxiedStatefulBean"); obj = PortableRemoteObject.narrow(obj, IOSessionHome.class); IOSessionHome home = (IOSessionHome) obj; System.out.println("Found ProxiedStatefulBean"); IOSession bean = home.create(); System.out.println("Created ProxiedStatefulBean"); System.out.println("ProxiedStatefulBean.read() -> "+bean.read("/user/scott/.password")); bean.write("/user/scott/.password"); System.out.println("ProxiedStatefulBean.write()"); bean.remove(); logout(); } /** Login as user scott using the conf.name login config or 'spec-test' if conf.name is not defined. */ private void login() throws Exception { login(username, password); } private void login(String username, char[] password) throws Exception { if( loggedIn ) return; lc = null; String confName = System.getProperty("conf.name", "spec-test"); AppCallbackHandler handler = new AppCallbackHandler(username, password); System.out.println("Creating LoginContext("+confName+")"); lc = new Logi
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/security/interfaces IOSession.java IOSessionHome.java Entity.java
User: starksm Date: 01/06/12 21:55:50 Modified:src/main/org/jboss/test/security/interfaces Entity.java Added: src/main/org/jboss/test/security/interfaces IOSession.java IOSessionHome.java Log: Initial tests of the custom security proxy layer Revision ChangesPath 1.2 +2 -2 jbosstest/src/main/org/jboss/test/security/interfaces/Entity.java Index: Entity.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/interfaces/Entity.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Entity.java 2001/03/05 10:11:03 1.1 +++ Entity.java 2001/06/13 04:55:50 1.2 @@ -5,8 +5,8 @@ /** -@author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@author [EMAIL PROTECTED] +@version $Revision: 1.2 $ */ public interface Entity extends EJBObject { 1.1 jbosstest/src/main/org/jboss/test/security/interfaces/IOSession.java Index: IOSession.java === package org.jboss.test.security.interfaces; import java.io.IOException; import java.rmi.RemoteException; import javax.ejb.EJBObject; public interface IOSession extends EJBObject { /** A method that returns its arg */ public String read(String path) throws IOException, RemoteException; public void write(String path) throws IOException, RemoteException; } 1.1 jbosstest/src/main/org/jboss/test/security/interfaces/IOSessionHome.java Index: IOSessionHome.java === package org.jboss.test.security.interfaces; import javax.ejb.*; import java.rmi.*; public interface IOSessionHome extends EJBHome { public IOSession create() throws RemoteException, CreateException; } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/security/ejb IOStatefulSessionBean.java IOStatelessSessionBean.java EntityBeanImpl.java
User: starksm Date: 01/06/12 21:55:50 Modified:src/main/org/jboss/test/security/ejb EntityBeanImpl.java Added: src/main/org/jboss/test/security/ejb IOStatefulSessionBean.java IOStatelessSessionBean.java Log: Initial tests of the custom security proxy layer Revision ChangesPath 1.2 +2 -2 jbosstest/src/main/org/jboss/test/security/ejb/EntityBeanImpl.java Index: EntityBeanImpl.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/ejb/EntityBeanImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EntityBeanImpl.java 2001/03/05 10:10:59 1.1 +++ EntityBeanImpl.java 2001/06/13 04:55:50 1.2 @@ -9,8 +9,8 @@ not a real entity bean. It is used to test Principal propagation using the echo method. -@author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@author [EMAIL PROTECTED] +@version $Revision: 1.2 $ */ public class EntityBeanImpl implements EntityBean { 1.1 jbosstest/src/main/org/jboss/test/security/ejb/IOStatefulSessionBean.java Index: IOStatefulSessionBean.java === package org.jboss.test.security.ejb; import java.io.IOException; import java.security.Principal; import javax.ejb.CreateException; import javax.ejb.EJBException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; /** A simple session bean for testing custom security. @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class IOStatefulSessionBean implements SessionBean { private SessionContext sessionContext; public void ejbCreate() throws CreateException { System.out.println("IOStatefulSessionBean.ejbCreate() called"); } public void ejbActivate() { System.out.println("IOStatefulSessionBean.ejbActivate() called"); } public void ejbPassivate() { System.out.println("IOStatefulSessionBean.ejbPassivate() called"); } public void ejbRemove() { System.out.println("IOStatefulSessionBean.ejbRemove() called"); } public void setSessionContext(SessionContext context) { sessionContext = context; } public String read(String path) throws IOException { System.out.println("IOStatefulSessionBean.read, path="+path); Principal p = sessionContext.getCallerPrincipal(); System.out.println("IOStatefulSessionBean.read, callerPrincipal="+p); return path; } public void write(String path) throws IOException { System.out.println("IOStatefulSessionBean.write, path="+path); Principal p = sessionContext.getCallerPrincipal(); System.out.println("IOStatefulSessionBean.write, callerPrincipal="+p); } } 1.1 jbosstest/src/main/org/jboss/test/security/ejb/IOStatelessSessionBean.java Index: IOStatelessSessionBean.java === package org.jboss.test.security.ejb; import java.io.IOException; import java.security.Principal; import javax.ejb.CreateException; import javax.ejb.EJBException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; /** A simple session bean for testing custom security. @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class IOStatelessSessionBean implements SessionBean { private SessionContext sessionContext; public void ejbCreate() throws CreateException { System.out.println("IOStatelessSessionBean.ejbCreate() called"); } public void ejbActivate() { System.out.println("IOStatelessSessionBean.ejbActivate() called"); } public void ejbPassivate() { System.out.println("IOStatelessSessionBean.ejbPassivate() called"); } public void ejbRemove() { System.out.println("IOStatelessSessionBean.ejbRemove() called"); } public void setSessionContext(SessionContext context) { sessionContext = context; } public String read(String path) throws IOException { System.out.println("IOStatelessSessionBean.read, path="+path); Principal p = sessionContext.getCallerPrincipal(); System.out.println("IOStatelessSessionBean.read, callerPrincipal="+p); return path; } public void write(String path) throws IOException { System.out.println("IOStatelessSessionBean.write, path="+path); Principal p = sessionContext.getCallerPrincipal(); System.out.println("IOStatelessSessionBean.write, caller
[JBoss-dev] CVS update: jbosstest/src/resources/security/META-INF ejb-jar-proxy.xml jboss-proxy.xml ejb-jar.xml jboss-spec.xml jboss.xml
User: starksm Date: 01/06/12 21:54:06 Modified:src/resources/security/META-INF ejb-jar.xml jboss-spec.xml jboss.xml Added: src/resources/security/META-INF ejb-jar-proxy.xml jboss-proxy.xml Log: Update for custom security proxy tests Revision ChangesPath 1.5 +0 -4 jbosstest/src/resources/security/META-INF/ejb-jar.xml Index: ejb-jar.xml === RCS file: /cvsroot/jboss/jbosstest/src/resources/security/META-INF/ejb-jar.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ejb-jar.xml 2001/06/12 07:58:41 1.4 +++ ejb-jar.xml 2001/06/13 04:54:06 1.5 @@ -102,10 +102,6 @@ Bean java.lang.String False - -Echo -Echo - 1.4 +2 -1 jbosstest/src/resources/security/META-INF/jboss-spec.xml Index: jboss-spec.xml === RCS file: /cvsroot/jboss/jbosstest/src/resources/security/META-INF/jboss-spec.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jboss-spec.xml2001/05/22 03:20:24 1.3 +++ jboss-spec.xml2001/06/13 04:54:06 1.4 @@ -82,7 +82,8 @@ ejb/Session spec.StatelessSession - + + 1.2 +12 -10jbosstest/src/resources/security/META-INF/jboss.xml Index: jboss.xml === RCS file: /cvsroot/jboss/jbosstest/src/resources/security/META-INF/jboss.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jboss.xml 2001/03/05 10:11:45 1.1 +++ jboss.xml 2001/06/13 04:54:06 1.2 @@ -2,16 +2,18 @@ - test-domain +test-domain - - - Standard Stateless SessionBean - java:/jaas/simple - java:/jaas/simple - - + + + +Standard Stateless SessionBean +java:/jaas/simple + + Unsecure Stateless SessionBean false @@ -42,9 +44,9 @@ - + - + ProjRepository Standard Stateful SessionBean 1.1 jbosstest/src/resources/security/META-INF/ejb-jar-proxy.xml Index: ejb-jar-proxy.xml === http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd";> Custom Proxy Security Tests A secured session bean with read/write methods ProxiedStatelessBean org.jboss.test.security.interfaces.IOSessionHome org.jboss.test.security.interfaces.IOSession org.jboss.test.security.ejb.IOStatelessSessionBean Stateless Container A secured session bean with read/write methods ProxiedStatefulBean org.jboss.test.security.interfaces.IOSessionHome org.jboss.test.security.interfaces.IOSession org.jboss.test.security.ejb.IOStatefulSessionBean Stateful Container A trival echo entity bean ProxiedEntityBean org.jboss.test.security.interfaces.EntityHome org.jboss.test.security.interfaces.Entity org.jboss.test.security.ejb.EntityBeanImpl Bean java.lang.String False The role required to invoke the echo method Echo Echo ProxiedEntityBean * ProxiedStatelessBean * ProxiedStatefulBean * 1.1 jbosstest/src/resources/security/META-INF/jboss-proxy.xml Index: jboss-proxy.xml === java:/jaas/proxy-test ProxiedStatelessBean org.jboss.test.security.proxy.SessionSecurityProxy ProxiedStatefulBean org.jboss.test.security.proxy.SessionSecurityProxy ProxiedEntityBean
[JBoss-dev] CVS update: jbosstest/src/build/subprojects build-security.xml
User: starksm Date: 01/06/12 21:53:14 Modified:src/build/subprojects build-security.xml Log: Add security-proxy.jar for custom security tests Revision ChangesPath 1.2 +34 -10jbosstest/src/build/subprojects/build-security.xml Index: build-security.xml === RCS file: /cvsroot/jboss/jbosstest/src/build/subprojects/build-security.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build-security.xml2001/05/05 20:54:05 1.1 +++ build-security.xml2001/06/13 04:53:14 1.2 @@ -45,23 +45,47 @@ + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[JBoss-dev] CVS update: jboss/src/main/org/jboss/metadata ConfigurationMetaData.java
User: starksm Date: 01/06/12 21:52:33 Modified:src/main/org/jboss/metadata ConfigurationMetaData.java Log: Add a security-domain element and no longer allow independent setting of authentication-module and role-mapping-manager Revision ChangesPath 1.14 +70 -50jboss/src/main/org/jboss/metadata/ConfigurationMetaData.java Index: ConfigurationMetaData.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ConfigurationMetaData.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ConfigurationMetaData.java2001/06/01 07:50:22 1.13 +++ ConfigurationMetaData.java2001/06/13 04:52:33 1.14 @@ -10,12 +10,10 @@ import org.jboss.ejb.DeploymentException; -/** - * - * - * @see +/** The configuration information for an EJB container. * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini - * @version $Revision: 1.13 $ + * @author [EMAIL PROTECTED] + * @version $Revision: 1.14 $ */ public class ConfigurationMetaData extends MetaData { @@ -50,6 +48,7 @@ private boolean callLogging; private boolean readOnlyGetMethods; +private String securityDomain; private String authenticationModule; private String roleMappingManager; @@ -77,6 +76,7 @@ public String getPersistenceManager() { return persistenceManager; } + public String getSecurityDomain() { return securityDomain; } public String getAuthenticationModule() { return authenticationModule; } public String getRoleMappingManager() { return roleMappingManager; } @@ -98,67 +98,87 @@ public void importJbossXml(Element element) throws DeploymentException { - // everything is optional to allow jboss.xml to modify part of a configuration - // defined in standardjboss.xml +// everything is optional to allow jboss.xml to modify part of a configuration +// defined in standardjboss.xml - // set call logging - callLogging = Boolean.valueOf(getElementContent(getOptionalChild(element, "call-logging"), String.valueOf(callLogging))).booleanValue(); +// set call logging +callLogging = Boolean.valueOf(getElementContent(getOptionalChild(element, "call-logging"), String.valueOf(callLogging))).booleanValue(); - // set read-only get methods - readOnlyGetMethods = Boolean.valueOf(getElementContent(getOptionalChild(element, "read-only-get-methods"))).booleanValue(); +// set read-only get methods +readOnlyGetMethods = Boolean.valueOf(getElementContent(getOptionalChild(element, "read-only-get-methods"))).booleanValue(); - // set the container invoker - containerInvoker = getElementContent(getOptionalChild(element, "container-invoker"), containerInvoker); +// set the container invoker +containerInvoker = getElementContent(getOptionalChild(element, "container-invoker"), containerInvoker); + +// set the instance pool +instancePool = getElementContent(getOptionalChild(element, "instance-pool"), instancePool); + +// set the instance cache +instanceCache = getElementContent(getOptionalChild(element, "instance-cache"), instanceCache); + +// set the persistence manager +persistenceManager = getElementContent(getOptionalChild(element, "persistence-manager"), persistenceManager); + +// set the transaction manager +transactionManager = getElementContent(getOptionalChild(element, "transaction-manager"), transactionManager); + +// set the security domain +securityDomain = getElementContent(getOptionalChild(element, "security-domain"), securityDomain); +// set the authentication module +authenticationModule = getElementContent(getOptionalChild(element, "authentication-module"), authenticationModule); +// set the role mapping manager +roleMappingManager = getElementContent(getOptionalChild(element, "role-mapping-manager"), roleMappingManager); +/* If the authenticationModule == roleMappingManager just set the securityDomain +as this is the combination of the authentication-module and role-mapping-manager +behaviors +*/ +if( authenticationModule != null && roleMappingManager != null && +roleMappingManager.equals(authenticationModule) ) +{ +securityDomain = authenticationModule; +authenticationModule = null; +roleMappingManager = null; +} +// Don't allow only a authentication-module or role-mapping-manager +else if( (authenticationModule == null && roleMa
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerFactory.java ContainerInterceptors.java
User: starksm Date: 01/06/12 21:49:58 Modified:src/main/org/jboss/ejb ContainerFactory.java Removed: src/main/org/jboss/ejb ContainerInterceptors.java Log: Move the container interceptor code back into ContainerFactory and add the custom security proxy interceptor if a security proxy has been configured. Revision ChangesPath 1.75 +157 -63 jboss/src/main/org/jboss/ejb/ContainerFactory.java Index: ContainerFactory.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v retrieving revision 1.74 retrieving revision 1.75 diff -u -r1.74 -r1.75 --- ContainerFactory.java 2001/06/10 20:50:31 1.74 +++ ContainerFactory.java 2001/06/13 04:49:58 1.75 @@ -37,37 +37,36 @@ import javax.management.MBeanServer; import javax.management.MBeanRegistration; import javax.management.ObjectName; +import javax.management.RuntimeMBeanException; import javax.transaction.TransactionManager; -import org.jboss.logging.Log; -import org.jboss.logging.ConsoleLogging; -import org.jboss.logging.ConsoleLoggingMBean; - -import org.jboss.util.MBeanProxy; -import org.jboss.web.WebClassLoader; -import org.jboss.web.WebServiceMBean; - -import org.jboss.ejb.plugins.*; - -import org.jboss.verifier.BeanVerifier; -import org.jboss.verifier.event.VerificationEvent; -import org.jboss.verifier.event.VerificationListener; +import org.w3c.dom.Element; -import org.jboss.security.EJBSecurityManager; -import org.jboss.security.RealmMapping; - +import org.jboss.ejb.plugins.AbstractInstanceCache; +import org.jboss.ejb.plugins.SecurityProxyInterceptor; +import org.jboss.ejb.plugins.StatefulSessionInstancePool; +import org.jboss.logging.Log; +import org.jboss.logging.Logger; import org.jboss.metadata.ApplicationMetaData; import org.jboss.metadata.BeanMetaData; import org.jboss.metadata.SessionMetaData; import org.jboss.metadata.EntityMetaData; import org.jboss.metadata.MessageDrivenMetaData; +import org.jboss.metadata.MetaData; import org.jboss.metadata.ConfigurationMetaData; import org.jboss.metadata.XmlLoadable; import org.jboss.metadata.XmlFileLoader; -import org.jboss.logging.Logger; - import org.jboss.mgt.EJB; import org.jboss.mgt.Module; +import org.jboss.security.EJBSecurityManager; +import org.jboss.security.RealmMapping; +import org.jboss.util.MBeanProxy; +import org.jboss.verifier.BeanVerifier; +import org.jboss.verifier.event.VerificationEvent; +import org.jboss.verifier.event.VerificationListener; +import org.jboss.web.WebClassLoader; +import org.jboss.web.WebServiceMBean; + /** * A ContainerFactory is used to deploy EJB applications. It can be given a URL to @@ -81,9 +80,9 @@ * @author mailto:[EMAIL PROTECTED]";>Juha Lindfors * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini * @author Peter Antman ([EMAIL PROTECTED]) -* @author Scott Stark([EMAIL PROTECTED]) +* @author Scott Stark([EMAIL PROTECTED]) * -* @version $Revision: 1.74 $ +* @version $Revision: 1.75 $ */ public class ContainerFactory extends org.jboss.util.ServiceMBeanSupport @@ -95,6 +94,14 @@ public static String DEFAULT_ENTITY_BMP_CONFIGURATION = "Default BMP EntityBean"; public static String DEFAULT_ENTITY_CMP_CONFIGURATION = "Default CMP EntityBean"; public static String DEFAULT_MESSAGEDRIVEN_CONFIGURATION = "Default MesageDriven Bean"; + // Constants uses with container interceptor configurations +public static final int BMT = 1; +public static final int CMT = 2; +public static final int ANY = 3; +static final String BMT_VALUE = "Bean"; +static final String CMT_VALUE = "Container"; +static final String ANY_VALUE = "Both"; + // Attributes // Temp directory where deployed jars are stored File tmpDir; @@ -583,7 +590,7 @@ // Stolen from Stateless deploy // Create container MessageDrivenContainer container = new MessageDrivenContainer(); -int transType = ((MessageDrivenMetaData)bean).isContainerManagedTx() ? ContainerInterceptors.CMT : ContainerInterceptors.BMT; +int transType = ((MessageDrivenMetaData)bean).isContainerManagedTx() ? CMT : BMT; initializeContainer( container, conf, bean, transType, cl, localCl ); container.setContainerInvoker( createContainerInvoker( conf, cl ) ); @@ -603,7 +610,7 @@ ConfigurationMetaData conf = bean.getContainerConfiguration(); // Create container StatelessSessionContainer container = new StatelessSessionContainer(); -int transType = ((SessionMetaData)bean).isContainerManagedTx() ? ContainerInterceptors.CMT : ContainerInterceptors.BMT; +int transType = ((SessionMetaData)bean).isContainer
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins SecurityProxyInterceptor.java
User: starksm Date: 01/06/12 21:49:58 Modified:src/main/org/jboss/ejb/plugins SecurityProxyInterceptor.java Log: Move the container interceptor code back into ContainerFactory and add the custom security proxy interceptor if a security proxy has been configured. Revision ChangesPath 1.2 +6 -2 jboss/src/main/org/jboss/ejb/plugins/SecurityProxyInterceptor.java Index: SecurityProxyInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/SecurityProxyInterceptor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SecurityProxyInterceptor.java 2001/06/11 07:04:15 1.1 +++ SecurityProxyInterceptor.java 2001/06/13 04:49:58 1.2 @@ -14,6 +14,7 @@ import org.jboss.ejb.Container; import org.jboss.ejb.ContainerInvokerContainer; +import org.jboss.ejb.EnterpriseContext; import org.jboss.ejb.MethodInvocation; import org.jboss.security.EJBSecurityManager; @@ -27,7 +28,7 @@ interceptor has access to the EJB instance and context. @author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@version $Revision: 1.2 $ */ public class SecurityProxyInterceptor extends AbstractInterceptor { @@ -117,7 +118,10 @@ // Apply any custom security checks if( securityProxy != null ) { -EJBContext ctx = mi.getEnterpriseContext().getEJBContext(); +EJBContext ctx = null; +EnterpriseContext ectx = mi.getEnterpriseContext(); +if( ectx != null ) +ctx = ectx.getEJBContext(); Object[] args = mi.getArguments(); securityProxy.setEJBContext(ctx); try ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb Container.java
User: starksm Date: 01/06/12 21:42:42 Modified:src/main/org/jboss/ejb Container.java Log: Add a link from java:comp/env/security/security-domain to the configured security domain if one exists Revision ChangesPath 1.44 +14 -4 jboss/src/main/org/jboss/ejb/Container.java Index: Container.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Container.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- Container.java2001/06/10 20:50:31 1.43 +++ Container.java2001/06/13 04:42:42 1.44 @@ -73,7 +73,7 @@ * @author Rickard Öberg ([EMAIL PROTECTED]) * @author Marc Fleury * @author [EMAIL PROTECTED] - * @version $Revision: 1.43 $ + * @version $Revision: 1.44 $ */ public abstract class Container { @@ -418,7 +418,6 @@ // Since the BCL is already associated with this thread we can start using the java: namespace directly Context ctx = (Context) new InitialContext().lookup("java:comp"); Context envCtx = ctx.createSubcontext("env"); - Logger.debug("java:comp/env: "+envCtx); // Bind environment properties { @@ -589,6 +588,19 @@ } } + /* Create a java:comp/env/security/security-domain link to the container +or application security-domain if one exists so that access to the +security manager can be made without knowing the global jndi name. + */ + String securityDomain = metaData.getContainerConfiguration().getSecurityDomain(); + if( securityDomain == null ) + securityDomain = metaData.getApplicationMetaData().getSecurityDomain(); + if( securityDomain != null ) + { + Logger.debug("Binding securityDomain: "+securityDomain+ " to JDNI ENC as: security-domain"); + bind(envCtx, "security-domain", new LinkRef(securityDomain)); + } + Logger.debug("End java:comp/env for EJB: "+beanMetaData.getEjbName()); } catch (NamingException e) { @@ -597,9 +609,7 @@ throw new DeploymentException("Could not set up environment", e); } - } - /** ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] JMSContainerInvoker.java
On the topic of security, most *nix installations, including Linux, deny an application the ability to write to itself or its tree. This is to prevent a discovered exploit from modifying the applications code and causing it do do whatever the hacker wants (crash, access stuff it shouldent,...). We have denied jBoss write privilidge to itself and only allow it to write where it needs to. It may be a bad idea to allow jBoss to modify its own jcml file (we have disabled the auto jcml feature) or to replace executable modules that comprise it. OTOH, it may not be such a bad idea for a seperate process to have privilidge to do this, since it would need only be invoked when its time to upgrade jBoss. Just my 2 cents... Jim --On Tuesday, June 12, 2001 10:14 AM +0100 Mike Swainston-Rainford <[EMAIL PROTECTED]> wrote: > From my experiences at security aware sites (like financial > institutions) I'd say that a file of the node specific properties is a > must. Port numbers have been mentioned but what about the DB user and > password? > > Access to these leaves the database wide open so they would often not > even be held in a file on the file system but typed in during a > deployment or startup. If they are put in a file then it lives only on > the node to which it applies protected under a secure user id that's used > solely for deployment of the application server. > > The DB user id and password are currently stored in JBoss.jcml. They > would need to be pulled out, as suggested for the port numbers, into a > separate properties file before the more paranoid sites I've worked at > would consider deploying JBoss. > > Mike S-R > > At 00:05 12/06/2001 -0700, you wrote: >> We can argue the details, but I agree with Peter about the current >> configuration >> being very difficult to manage. If we are going to move to a web based >> deployment >> to multiple boxes we won't be able to simply rely on URLClassLoaders >> pulling down the current config files and expect them to work as many >> configuration parameters will be specific to box on which the server is >> being installed. >> >> - Original Message - >> From: "Peter Antman" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Monday, June 11, 2001 11:30 PM >> Subject: Re: [JBoss-dev] JMSContainerInvoker.java >> >> >> > On 11 Jun, marc fleury wrote: >> > > what I am hearing is that you want jbossmq/jboss/servlet >> > > configuration in xml snippets in jboss.jcml, otherwise I don't see >> > > what it brings >> except yet >> > > another layer of indirection... >> > >> > >> > I guess it depends on you requirements. Mine is that I must be able to >> > support a lot of installations of JBoss on machines I do not have >> > complete controll over, such as ports, multihomed and such things. >> > >> > My experience from working with JBoss for almost a year now is that the >> > configuration files changes a lot al the time, and it is quite hard to >> > diff all these files all the time when a new release arrives, or when I >> > have to go cutting cvs edge ;-). >> > >> > It is much easier to have one central property files wich controlles >> > all those environment stuff (much like a preprocessor), just try to >> > diff standardjboss.xml with all those hardcoded >> > ! >> > >> >> >> >> ___ >> Jboss-development mailing list >> [EMAIL PROTECTED] >> http://lists.sourceforge.net/lists/listinfo/jboss-development > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development I shall be telling this with a sigh Somewhere ages and ages hence: Two roads diverged in a wood, and I - I took the one less traveled by, And that has made all the difference. - Robert Frost, 1916 ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosssx/src/build build.xml
User: starksm Date: 01/06/12 18:53:22 Modified:src/build build.xml Log: Update the classpath for the latest source restructuring Revision ChangesPath 1.10 +23 -12jbosssx/src/build/build.xml Index: build.xml === RCS file: /cvsroot/jboss/jbosssx/src/build/build.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- build.xml 2001/05/30 12:26:09 1.9 +++ build.xml 2001/06/13 01:53:22 1.10 @@ -1,16 +1,18 @@ - - - - + + + + + + @@ -25,12 +27,13 @@ - + + - - + + @@ -59,11 +62,13 @@ - + - @@ -109,6 +114,8 @@ + + @@ -131,6 +138,8 @@ + + @@ -153,6 +162,8 @@ + + ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] jboss daily build failed - in cvs module: jbosssx
Fixed. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 12, 2001 6:35 PM Subject: [JBoss-dev] jboss daily build failed - in cvs module: jbosssx > > = > ==THIS IS AN AUTOMATED EMAIL - SEE http://www.lubega.com FOR DETAILS= > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] jboss daily test results
JBoss daily test results SUMMARY Number of tests run: 74 Successful tests: 71 Errors:1 Failures: 2 [time of test: 13 June 2001 2:50] See http://lubega.com for full details DETAILS OF ERRORS Suite: org.jboss.test.cts.test.AllJUnitTests Test:testProbeBeanContext Type:failure Exception: junit.framework.AssertionFailedError Message: Caught an unknown exception in testProbeBeanContex Stack Trace: junit.framework.AssertionFailedError: Caught an unknown exception in testProbeBeanContex at junit.framework.Assert.fail(Assert.java:143) at org.jboss.test.cts.test.StatefulSessionTest.testProbeBeanContext(StatefulSessionTest.java:467) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:155) at junit.framework.TestCase.runBare(TestCase.java:129) at junit.framework.TestResult$1.protect(TestResult.java:100) at junit.framework.TestResult.runProtected(TestResult.java:117) at junit.framework.TestResult.run(TestResult.java:103) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.run(TestSuite.java:144) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:209) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:342) - Suite: org.jboss.test.cts.test.AllJUnitTests Test:testEjbRemove Type:failure Exception: junit.framework.AssertionFailedError Message: Got Exception: expecting NoSuchObjectExceptionjava.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Instance 007 not found in database.; nested exception is: javax.ejb.NoSuchEntityException: Instance 007 not found in database. Stack Trace: junit.framework.AssertionFailedError: Got Exception: expecting NoSuchObjectExceptionjava.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Instance 007 not found in database.; nested exception is: javax.ejb.NoSuchEntityException: Instance 007 not found in database. at junit.framework.Assert.fail(Assert.java:143) at org.jboss.test.cts.test.BmpTest.testEjbRemove(BmpTest.java:224) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:155) at junit.framework.TestCase.runBare(TestCase.java:129) at junit.framework.TestResult$1.protect(TestResult.java:100) at junit.framework.TestResult.runProtected(TestResult.java:117) at junit.framework.TestResult.run(TestResult.java:103) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.run(TestSuite.java:144) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:209) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:342) - Suite: org.jboss.test.xa.test.Main Test:testXABean Type:error Exception: java.rmi.ServerException Message: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound; nested exception is: javax.ejb.EJBException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound Stack Trace: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound; nested exception is: javax.ejb.EJBException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound javax.transaction.TransactionRolledbackException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound; nested exception is: javax.ejb.EJBException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound javax.ejb.EJBException: Unable to find DB pool: javax.naming.NameNotFoundException: XADataSource1 not bound at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source) at org.jboss.ejb.plugins.jrmp.
[JBoss-dev] jboss daily build failed - in cvs module: jbosssx
= ==THIS IS AN AUTOMATED EMAIL - SEE http://www.lubega.com FOR DETAILS= = Buildfile: build.xml init: error: prepare: [mkdir] Created dir: /home/lubega/jbossro/jbosssx/build [mkdir] Created dir: /home/lubega/jbossro/jbosssx/build/classes [mkdir] Created dir: /home/lubega/jbossro/jbosssx/build/examples [mkdir] Created dir: /home/lubega/jbossro/jbosssx/build/lib [mkdir] Created dir: /home/lubega/jbossro/jbosssx/dist compile: [javac] Modern compiler is not available - using classic compiler [javac] Compiling 58 source files to /home/lubega/jbossro/jbosssx/build/classes [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/DatabaseServerLoginModule.java:28: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/UsernamePasswordLoginModule.java:25: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/IdentityLoginModule.java:20: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/LdapLoginModule.java:35: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/SimpleServerLoginModule.java:15: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/UsersRolesLoginModule.java:30: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/srp/SRPService.java:15: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/NestableGroup.java:23: Superclass org.jboss.security.SimplePrincipal of class org.jboss.security.NestableGroup not found. [javac] public class NestableGroup extends SimplePrincipal implements Group [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/NestablePrincipal.java:23: Superclass org.jboss.security.SimplePrincipal of class org.jboss.security.NestablePrincipal not found. [javac] public class NestablePrincipal extends SimplePrincipal implements Group [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/SecurityPolicy.java:27: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/SimpleGroup.java:24: Superclass org.jboss.security.SimplePrincipal of class org.jboss.security.SimpleGroup not found. [javac] public class SimpleGroup extends SimplePrincipal implements Group [javac] ^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/plugins/samples/RolesLoginModule.java:26: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManager.java:34: Class org.jboss.security.SecurityAssociation not found in import. [javac] import org.jboss.security.SecurityAssociation; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManager.java:36: Class org.jboss.security.SimplePrincipal not found in import. [javac] import org.jboss.security.SimplePrincipal; [javac]^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/AbstractServerLoginModule.java:134: class org.jboss.security.SimpleGroup is an abstract class. It can't be instantiated. [javac] SimpleGroup tmp = new SimpleGroup("Roles"); [javac] ^ [javac] /home/lubega/jbossro/jbosssx/src/main/org/jboss/security/auth/spi/AbstractServerLoginModule.java:214: class org.jboss.security.NestableGroup is an abstract class. It can't be instantiated. [javac] roles = new Nest
[JBoss-dev] CVS update: jboss/src/resources/org/jboss/metadata jboss.dtd
User: starksm Date: 01/06/12 18:17:32 Modified:src/resources/org/jboss/metadata jboss.dtd Log: Deprecate use of the authentication-module and role-mapping-manager at the container-configuration level in favor of security-domain as specifying these functions independently is of little use. Revision ChangesPath 1.11 +14 -9 jboss/src/resources/org/jboss/metadata/jboss.dtd Index: jboss.dtd === RCS file: /cvsroot/jboss/jboss/src/resources/org/jboss/metadata/jboss.dtd,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jboss.dtd 2001/06/10 20:54:48 1.10 +++ jboss.dtd 2001/06/13 01:17:31 1.11 @@ -61,8 +61,7 @@ - - + @@ -93,11 +92,15 @@ --> - @@ -368,7 +371,7 @@ Used in: container-configurations --> - + @@ -726,7 +730,8 @@ ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [ jboss-Patches-432611 ] Dynamic proxy activation (Bug #432610)
Patches item #432611, was updated on 2001-06-12 17:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376687&aid=432611&group_id=22866 Category: JBossServer Group: v2.2.2 (stable) Status: Open Resolution: None Priority: 5 Submitted By: Peter Löffler (pejolo) Assigned to: Nobody/Anonymous (nobody) Summary: Dynamic proxy activation (Bug #432610) Initial Comment: org.jboss.ejb.plugins.SessionInputStream overrides java.io.ObjectInputStream's resolveClass() but not its resolveProxyClass() which makes it impossible to reactivate passivated (stateful session) beans containing dynamic proxy instances (see bug #432610) The following patch solves this problem: @@ -17,6 +17,7 @@ import java.io.IOException; import java.lang.reflect.Method; import java.lang.reflect.Field; +import java.lang.reflect.Proxy; import java.lang.reflect.InvocationTargetException; import java.rmi.RemoteException; import java.rmi.ServerException; @@ -108,5 +109,19 @@ return super.resolveClass(v); } } - + + protected Class resolveProxyClass(String[] interfac es) throws IOException, ClassNotFoundException { + // see java.io.ObjectInputStream, + // the only changes concern the classloader used + Class[] classObjs = new Class[interfaces.length] ; + for (int i = 0; i < interfaces.length; i++) { + classObjs[i] = Class.forName(interfaces[i], f alse, appCl); + } + try { + return Proxy.getProxyClass(appCl, classObjs); + } catch (IllegalArgumentException e) { + throw new ClassNotFoundException(null, e); + } + } + } -- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376687&aid=432611&group_id=22866 ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [ jboss-Bugs-432610 ] Cannot activate dynamic proxy instances
Bugs item #432610, was updated on 2001-06-12 17:33 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=432610&group_id=22866 Category: JBossServer Group: v2.2.2 (stable) Status: Open Resolution: None Priority: 5 Submitted By: Peter Löffler (pejolo) Assigned to: Nobody/Anonymous (nobody) Summary: Cannot activate dynamic proxy instances Initial Comment: JBoss is unable to reactivate (stateful) session beans with fields containing dynamic proxy instances. Passivation works fine but on (re)activation I get the message "Could not activate; nested exception is: java.lang.ClassNotFoundException: ..." Everything works fine when putting all my classes into the classpath (instead of deploying them into JBoss' deploy directory). A simple test case to reproduce this behaviour: // Helper classes: public interface A { } import java.io.Serializable; public class AImpl implements A, Serializable { } import java.io.Serializable; import java.lang.reflect.Method; import java.lang.reflect.InvocationHandler; public class AInvocationHandler implements InvocationHandler, Serializable { private A delegate; public AInvocationHandler(A delegate) { this.delegate = delegate; } public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { return m.invoke(delegate, args); } } // EJB classes: import java.rmi.RemoteException; import javax.ejb.EJBObject; public interface Test extends EJBObject { public void simpleMethod(A a) throws RemoteException; } import java.rmi.RemoteException; import javax.ejb.EJBHome; import javax.ejb.CreateException; public interface TestHome extends EJBHome { public Test create() throws RemoteException, CreateException; } import java.util.ArrayList; import java.rmi.RemoteException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; import javax.ejb.CreateException; public class TestBean implements SessionBean { private ArrayList objects; public void ejbCreate() throws CreateException { objects = new ArrayList(); } public void simpleMethod(A a) { objects.add(a); } public void ejbRemove() { } public void ejbActivate() { } public void ejbPassivate() { } public void setSessionContext( SessionContext context) { } } // Test client: import java.lang.reflect.Proxy; import java.rmi.RemoteException; import java.util.Properties; import javax.ejb.CreateException; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.rmi.PortableRemoteObject; public class TestClient { public static void main(String[] args) throws NamingException, RemoteException, InterruptedException, CreateException { Properties props = new Properties(); props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(javax.naming.Context.PROVIDER_URL, "localhost:1099"); InitialContext jndiContext = new InitialContext(props); TestHome testHome = (TestHome) PortableRemoteObject.narrow( jndiContext.lookup("Test"), TestHome.class); Test test = testHome.create(); A a = (A) Proxy.newProxyInstance( A.class.getClassLoader(), new Class[] {A.class}, new AInvocationHandler(new AImpl())); test.simpleMethod(a); System.out.println("Waiting for passivation ..."); Thread.currentThread().sleep(150); /* REMARK: If you don't want to wait that long, * change this line into * Thread.currentThread().sleep(15000); * and choose the following settings for * "Standard Stateful SessionBean" * in standardjboss.xml: * 3 * 6 * 4 */ System.out.println("... finished"); test.simpleMethod(a); } } The interesting part of server.log (with call-logging= true for stateful session beans) looks like this: [Default] JBoss 2.2.2 Started in 0m:20s [Bean Cache] Resized cache for bean Test: old capacity = 1000, new capacity = 50 [Test] create() [Test] [992386455934] simpleMethod(AImpl@1cfec1) [Bean Cache] Scheduling for passivation overaged bean Test with id = 992386455934 - Cache size = 1 [Bean Cache] Aging out from cache bean Testwith id = 992386455934; cache size = 1 [Container factory] Scheduled passivation of bean Test with id = 992386455934 [Container factory] Passivated bean Test with id = 992386455934 [Test] [992386455934] simpleMethod(AImpl@6df389) [Test] Could not activate; nested exception is: java.lang.ClassNotFoundException: A [Test] java.rmi.NoSuchObjectException: Could not activate; nested exception is: [Test] java.lang.ClassNotFoundException: A [Test] at org.jboss.ejb.plugins.AbstractInstanceCache .get(AbstractInstanceCache.java:173) [Test] at org.jboss.ejb.plugins .StatefulSessionInstanceInterceptor.invoke( StatefulSessionInstanceInterceptor.java:157) [Test] at org.jboss.ejb.plugins.LogInterceptor .invoke(LogInterceptor.java:195) [Test] at o
Re: [JBoss-dev] Attn: Scott - your jboss.org mail broken:[Fwd: Undelivered Mail Returned to Sender]
I drilled down through the attachement to see the original mail. I'll create the new Jetty release bundle on sourceforge right now. - Original Message - From: "Julian Gosnell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 12, 2001 3:30 PM Subject: [JBoss-dev] Attn: Scott - your jboss.org mail broken:[Fwd: Undelivered Mail Returned to Sender] > I'm having trouble getting through to you about the latest JBoss-Jetty > rlease > > > Jules > > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RMI IIOP
Hey Guys, I was going through the "EJB 2.0 Proposed Final Draft 2" specs to get the requirements of JBOSS supporting RMI-IIOP. Are there any features that we would like to have in addition to the ones that are described in the EJB specs ? Ajay __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] Attn: Scott - your jboss.org mail broken:[Fwd: Undelivered Mail Returnedto Sender]
I'm having trouble getting through to you about the latest JBoss-Jetty rlease Jules This is the Postfix program at host guns.jboss.org. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please contact <[EMAIL PROTECTED]> If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program <[EMAIL PROTECTED]>: unknown user: "scott_stark" My mail doesn't seem to be getting through to you The bundles in incoming are no good - someone: SF, my ISP, ??? throttles my connection down to nothing and then drops it - so I have checked the file into jboss/binaries - as you noticed. I would be very grateful if you would do the necessary - I am just not equipped here at home. There is a README in the top-level dir if you want to announce it on jboss-users, or i can do it, if you let me know when the release is complete. Thanks again for all your help, Jules Scott M Stark wrote: > I see some uploads appearing in the incoming area but they are too small to be > complete. I have the bundle you placed in the cvs binaries directory so I > can create the updated release if your having trouble. > > Scott > > - Original Message - > From: "Julian Gosnell" <[EMAIL PROTECTED]> > To: "Scott M Stark" <[EMAIL PROTECTED]> > Sent: Monday, June 11, 2001 2:11 PM > Subject: Re: new JBoss-2.2.2_Jetty-3.1.RC5-2.tgz > > > It was, but I guess SF sweep their incoming dir every so often and it got > > trashed ! > > > > I shall put it up again this evening. > > > > Would you like to do the business, or shall I (Juha has given me instructions > > - but I only have a puny little modem...) > > > > Jules _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: [JBoss-dev] RabbitHole branch created
Agreed. Let's make it so. How about trying for a code freeze as of next Monday (June 18 2001). - Original Message - From: "Ole Husgaard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 12, 2001 1:31 PM Subject: Re: [JBoss-dev] RabbitHole branch created > Hi, > > I agree, and think that having _two_ unstable branches > is a pain in . > And when these branches differ more and more, merging > patches will become more and more painful. > > I would suggest: > > a) Calling out a code freeze on the current 2.3 series. > b) When the main branch is stable after a few days of >freeze, that becomes 2.4.0. Bugs still present there >can be fixed in 2.4.1, 2.4.2 > c) New, unstable (MAIN branbch) 2.5 series is used >instead of the RabbitHole branch, working towards >the 3.0 release. > > > Best Regards, > > Ole Husgaard. > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/web/test TestWebIntegration.java
User: starksm Date: 01/06/12 13:55:57 Modified:src/main/org/jboss/test/web/test TestWebIntegration.java Log: Probing the http port was not a reliable test for the existence of an integrated web container. Now a check is made for a registered WarDeployer using the rmi jmx connector. Revision ChangesPath 1.7 +38 -16 jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java Index: TestWebIntegration.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TestWebIntegration.java 2001/05/31 03:16:16 1.6 +++ TestWebIntegration.java 2001/06/12 20:55:57 1.7 @@ -2,11 +2,16 @@ import java.io.IOException; import java.net.HttpURLConnection; +import java.net.InetAddress; import java.net.URL; +import javax.management.ObjectName; +import javax.management.RuntimeMBeanException; +import javax.naming.InitialContext; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jboss.jmx.interfaces.RMIConnector; import org.jboss.test.util.Deploy; /** Tests of servlet container integration into the JBoss server. This test @@ -20,7 +25,7 @@ with a role of 'AuthorizedUser' in the servlet container. @author [EMAIL PROTECTED] -@version $Revision: 1.6 $ +@version $Revision: 1.7 $ */ public class TestWebIntegration extends TestCase { @@ -42,32 +47,49 @@ return; setUp = true; -// Test for the existence of a web server Integer port = Integer.getInteger("web.port", 8080); baseURL = "http://jduke:theduke@localhost:"; + port + '/'; -URL url = new URL(baseURL); try { -HttpClient httpConn = new HttpClient(url); -int responseCode = httpConn.getResponseCode(); -String responseMessage = httpConn.getResponseMessage(); -if( responseCode < 100 ) +String serverName = InetAddress.getLocalHost().getHostName(); +String connectorName = "jmx:" +serverName+ ":rmi"; +RMIConnector server = (RMIConnector) new InitialContext().lookup(connectorName); +ObjectName deployerName = new ObjectName("J2EE:service=J2eeDeployer"); +// Ask the deployer for the getWarDeployerName +Object[] params = {}; +String[] signature = {}; +String warDeployerName = (String) server.invoke(deployerName, +"getWarDeployerName", params, signature); +// See if the warDeployerName exists +deployerName = new ObjectName(warDeployerName); +webServerAvailable = server.isRegistered(deployerName); +if( webServerAvailable == true ) { -System.out.println(baseURL+" No valid HTTP response, code="+responseCode+", skipping tests"); +System.out.println("Found warDeployer named: "+warDeployerName); +try +{ +Deploy.deploy("jbosstest-web.ear"); +} +catch(Exception e) +{ +e.printStackTrace(); +fail("Failed to deploy jbosstest-web.ear"); +} } else { -webServerAvailable = true; -System.out.println("Found webserver at: "+baseURL+", code="+responseCode+", msg="+responseMessage); -Deploy.deploy("jbosstest-web.ear"); +System.out.println("No war deployer found, skipping tests"); } } -catch(Exception e) +catch(Exception x) { - if( webServerAvailable == false ) - System.out.println("No webserver found at: "+baseURL); - else - fail("Failed to deploy jbosstest-web.ear"); +webServerAvailable = false; +x.printStackTrace(); +if (x instanceof RuntimeMBeanException) +{ +((RuntimeMBeanException)x).getTargetException().printStackTrace(); +} +System.out.println("No war deployer found, skipping tests"); } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/lib connector.jar
User: starksm Date: 01/06/12 13:54:32 Added: src/lib connector.jar Log: Add the jmx connector jar to the build jars Revision ChangesPath 1.1 jbosstest/src/lib/connector.jar <> ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/build build.xml run_tests.xml
User: starksm Date: 01/06/12 13:53:56 Modified:src/build build.xml run_tests.xml Log: Add the jmx rmi connector jar to the classpath jars Revision ChangesPath 1.34 +1 -0 jbosstest/src/build/build.xml Index: build.xml === RCS file: /cvsroot/jboss/jbosstest/src/build/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- build.xml 2001/05/31 02:30:03 1.33 +++ build.xml 2001/06/12 20:53:56 1.34 @@ -36,6 +36,7 @@ + 1.13 +2 -1 jbosstest/src/build/run_tests.xml Index: run_tests.xml === RCS file: /cvsroot/jboss/jbosstest/src/build/run_tests.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- run_tests.xml 2001/05/30 14:31:34 1.12 +++ run_tests.xml 2001/06/12 20:53:56 1.13 @@ -2,7 +2,7 @@ @@ -67,6 +67,7 @@ + ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RabbitHole branch created
Hi, I agree, and think that having _two_ unstable branches is a pain in . And when these branches differ more and more, merging patches will become more and more painful. I would suggest: a) Calling out a code freeze on the current 2.3 series. b) When the main branch is stable after a few days of freeze, that becomes 2.4.0. Bugs still present there can be fixed in 2.4.1, 2.4.2 c) New, unstable (MAIN branbch) 2.5 series is used instead of the RabbitHole branch, working towards the 3.0 release. Best Regards, Ole Husgaard. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] CVS of confusion
We'll branch 2.4. 2.3 has been the development version on main leading to 2.4 - Original Message - From: "Jay Walters" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 12, 2001 12:54 PM Subject: [JBoss-dev] CVS of confusion > What is the current state of things with regards to branch vs main for 2.3/4 > vs rabbit hole? Seems like some emails I just saw said we'll branch 2.3/4 > and the mainline will be rabbit hole? (That way makes better sense than > branching new development I think.) > > Cheers > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EnterpriseContext.java
User: starksm Date: 01/06/12 13:09:01 Modified:src/main/org/jboss/ejb EnterpriseContext.java Log: Pass the security role as a SimplePrincipal Revision ChangesPath 1.31 +3 -2 jboss/src/main/org/jboss/ejb/EnterpriseContext.java Index: EnterpriseContext.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EnterpriseContext.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- EnterpriseContext.java2001/06/10 20:50:31 1.30 +++ EnterpriseContext.java2001/06/12 20:09:01 1.31 @@ -30,6 +30,7 @@ import org.jboss.logging.Logger; import org.jboss.metadata.SecurityRoleRefMetaData; +import org.jboss.security.SimplePrincipal; /** * The EnterpriseContext is used to associate EJB instances with metadata about it. @@ -41,7 +42,7 @@ * @author mailto:[EMAIL PROTECTED]";>Marc Fleury * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini * @author mailto:[EMAIL PROTECTED]";>Juha Lindfors - * @version $Revision: 1.30 $ + * @version $Revision: 1.31 $ */ public abstract class EnterpriseContext { @@ -323,7 +324,7 @@ Logger.warning("WARNING: no match found for security role " + id + " in the deployment descriptor."); HashSet set = new HashSet(); - set.add( id ); + set.add( new SimplePrincipal(id) ); return con.getRealmMapping().doesUserHaveRole( principal, set ); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: contrib/tomcat/src/main/org/jboss/tomcat/security JBossSecurityMgrRealm.java
User: starksm Date: 01/06/12 13:02:31 Modified:tomcat/src/main/org/jboss/tomcat/security JBossSecurityMgrRealm.java Log: Handle authentication callback when there is no JBoss security context Revision ChangesPath 1.3 +41 -10 contrib/tomcat/src/main/org/jboss/tomcat/security/JBossSecurityMgrRealm.java Index: JBossSecurityMgrRealm.java === RCS file: /cvsroot/jboss/contrib/tomcat/src/main/org/jboss/tomcat/security/JBossSecurityMgrRealm.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JBossSecurityMgrRealm.java2001/05/31 01:43:23 1.2 +++ JBossSecurityMgrRealm.java2001/06/12 20:02:31 1.3 @@ -5,6 +5,7 @@ import java.util.Hashtable; import java.util.HashSet; import java.util.Set; +import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.security.auth.Subject; @@ -12,7 +13,6 @@ import org.apache.log4j.Category; import org.apache.tomcat.core.BaseInterceptor; -import org.apache.tomcat.core.Context; import org.apache.tomcat.core.Request; import org.apache.tomcat.core.Response; import org.apache.tomcat.util.SecurityTools; @@ -37,7 +37,7 @@ @see org.jboss.security.SubjectSecurityManager @author [EMAIL PROTECTED] -@version $Revision: 1.2 $ +@version $Revision: 1.3 $ */ public class JBossSecurityMgrRealm extends BaseInterceptor { @@ -74,6 +74,11 @@ String username = (String) credentialMap.get("username"); String password = (String) credentialMap.get("password"); +// If we don't have a security context security is not required +Context securityCtx = getSecurityContext(); +if( securityCtx == null ) +return 0; + /* Make sure the thread context class loader it set ot the servlet class loader. The Jdk12Interceptor should be handling this but it does not do it for the authenticate/authorize phases of a @@ -92,14 +97,13 @@ if( scl != cl ) Thread.currentThread().setContextClassLoader(scl); // Get the JBoss security manager from the ENC context -InitialContext iniCtx = new InitialContext(); -EJBSecurityManager securityMgr = (EJBSecurityManager) iniCtx.lookup("java:comp/env/security/securityMgr"); +EJBSecurityManager securityMgr = (EJBSecurityManager) securityCtx.lookup("securityMgr"); SimplePrincipal principal = new SimplePrincipal(username); if( securityMgr.isValid(principal, password) ) { request.setRemoteUser(username); request.setUserPrincipal(principal); -Context ctx = request.getContext(); +org.apache.tomcat.core.Context ctx = request.getContext(); if (ctx != null) request.setAuthType(ctx.getAuthMethod()); category.debug("User: "+username+" is authenticated"); @@ -160,12 +164,23 @@ { if( scl != cl ) Thread.currentThread().setContextClassLoader(scl); -// Get the JBoss security manager from the ENC context -InitialContext iniCtx = new InitialContext(); -RealmMapping securityMgr = (RealmMapping) iniCtx.lookup("java:comp/env/security/realmMapping"); -SimplePrincipal principal = new SimplePrincipal(username); + +boolean userHasRole = false; Set requiredRoles = new HashSet(Arrays.asList(roles)); -if( securityMgr.doesUserHaveRole(principal, requiredRoles) ) +// Get the JBoss security manager from the ENC context +Context securityCtx = getSecurityContext(); +if( securityCtx != null ) +{ +RealmMapping securityMgr = (RealmMapping) securityCtx.lookup("realmMapping"); +SimplePrincipal principal = new SimplePrincipal(username); +userHasRole = securityMgr.doesUserHaveRole(principal, requiredRoles); +} +else +{ +category.warn("no security context available"); +} + +if( userHasRole ) { // Need to get roles from the security mgr. Needs updated interface... String userRoles[] = {}; @@ -190,6 +205,22 @@ } return code; +} + +private Context getSecurityContext() +{ +Context securityCtx = null; +// Get the JBoss security manager from the ENC context +try +{ +InitialContext iniCtx = new InitialContext(); +securityCtx = (
[JBoss-dev] CVS of confusion
What is the current state of things with regards to branch vs main for 2.3/4 vs rabbit hole? Seems like some emails I just saw said we'll branch 2.3/4 and the mainline will be rabbit hole? (That way makes better sense than branching new development I think.) Cheers ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] First small patch for jboss-j2ee
Applied to the mainline jboss-j2ee module ... Cheers Jay -Original Message- From: Jesper Pedersen To: [EMAIL PROTECTED] Sent: 6/12/01 6:49 AM Subject: [JBoss-dev] First small patch for jboss-j2ee Mhmm I'm resending this just in case ... --- Hi. Here is my first small patch for jboss-j2ee. It removes the abstract keyword from the interfaces in javax.ejb and javax.ejb.spi. It also updates the documentation. Note: There was an error in javax.ejb.MessageDrivenBean; the two method throws EJBException instead of RemoteException. Someone with write-access: please review the patch and commit. I'll start to work my way through the other packages in the module. Kind Regards, Jesper -- Jesper Pedersen, M.Sc. C.S.E Open Source Solution Manager Sun Certified Java 2 Developer IT+ A/S Phone: +45 86 78 21 00 Brendstrupgaardsvej 7 Fax: +45 86 78 21 02 DK-8200 Aarhus N Direct:+45 87 40 08 49 Denmark Email: [EMAIL PROTECTED] <> ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: contrib/tomcat/src/main/org/jboss/tomcat/security JBossSecurityMgrRealm.java
User: starksm Date: 01/06/12 12:50:16 Modified:tomcat/src/main/org/jboss/tomcat/security Tag: Branch_2_2 JBossSecurityMgrRealm.java Log: Handle getting called to authenticate a user when there is no JBoss security context Revision ChangesPath No revision No revision 1.1.2.4 +41 -10 contrib/tomcat/src/main/org/jboss/tomcat/security/JBossSecurityMgrRealm.java Index: JBossSecurityMgrRealm.java === RCS file: /cvsroot/jboss/contrib/tomcat/src/main/org/jboss/tomcat/security/JBossSecurityMgrRealm.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- JBossSecurityMgrRealm.java2001/05/31 01:45:31 1.1.2.3 +++ JBossSecurityMgrRealm.java2001/06/12 19:50:16 1.1.2.4 @@ -5,12 +5,13 @@ import java.util.Hashtable; import java.util.HashSet; import java.util.Set; +import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.security.auth.Subject; import org.apache.tomcat.core.BaseInterceptor; -import org.apache.tomcat.core.Context; +import org.apache.tomcat.core.TomcatException; import org.apache.tomcat.core.Request; import org.apache.tomcat.core.Response; import org.apache.tomcat.util.SecurityTools; @@ -35,7 +36,7 @@ @see org.jboss.security.SubjectSecurityManager @author [EMAIL PROTECTED] -@version $Revision: 1.1.2.3 $ +@version $Revision: 1.1.2.4 $ */ public class JBossSecurityMgrRealm extends BaseInterceptor { @@ -68,6 +69,22 @@ this.debug = debug; } +private Context getSecurityContext() +{ +Context securityCtx = null; +// Get the JBoss security manager from the ENC context +try +{ +InitialContext iniCtx = new InitialContext(); +securityCtx = (Context) iniCtx.lookup("java:comp/env/security"); +} +catch(NamingException e) +{ +// Apparently there is no security context? +} +return securityCtx; +} + public int authenticate(Request request, Response response) { /* Get the username credentials from the request. We dont check @@ -80,6 +97,11 @@ String username = (String) credentialMap.get("username"); String password = (String) credentialMap.get("password"); +// If we don't have a security context security is not required +Context securityCtx = getSecurityContext(); +if( securityCtx == null ) +return 0; + /* Make sure the thread context class loader it set ot the servlet class loader. The Jdk12Interceptor should be handling this but it does not do it for the authenticate/authorize phases of a @@ -98,14 +120,13 @@ if( scl != cl ) Thread.currentThread().setContextClassLoader(scl); // Get the JBoss security manager from the ENC context -InitialContext iniCtx = new InitialContext(); -EJBSecurityManager securityMgr = (EJBSecurityManager) iniCtx.lookup("java:comp/env/security/securityMgr"); +EJBSecurityManager securityMgr = (EJBSecurityManager) securityCtx.lookup("securityMgr"); SimplePrincipal principal = new SimplePrincipal(username); if( securityMgr.isValid(principal, password) ) { request.setRemoteUser(username); request.setUserPrincipal(principal); -Context ctx = request.getContext(); +org.apache.tomcat.core.Context ctx = request.getContext(); if (ctx != null) request.setAuthType(ctx.getAuthMethod()); System.out.println("User: "+username+" is authenticated"); @@ -167,12 +188,22 @@ { if( scl != cl ) Thread.currentThread().setContextClassLoader(scl); -// Get the JBoss security manager from the ENC context -InitialContext iniCtx = new InitialContext(); -RealmMapping securityMgr = (RealmMapping) iniCtx.lookup("java:comp/env/security/realmMapping"); -SimplePrincipal principal = new SimplePrincipal(username); +boolean userHasRole = false; Set requiredRoles = new HashSet(Arrays.asList(roles)); -if( securityMgr.doesUserHaveRole(principal, requiredRoles) ) +// Get the JBoss security manager from the ENC context +Context securityCtx = getSecurityContext(); +if( securityCtx != null ) +{ +RealmMapping securityMgr = (RealmMapping) securityCtx.lookup("realmMapping");
[JBoss-dev] CVS update: jboss-j2ee/src/main/javax/ejb/spi HandleDelegate.java
User: jwalters Date: 01/06/12 12:47:49 Modified:src/main/javax/ejb/spi HandleDelegate.java Log: EJB 2.0 patches to remove abstract from methods in interfaces and add some additional javadoc. Thanks to jesper pedersen. Revision ChangesPath 1.2 +23 -20jboss-j2ee/src/main/javax/ejb/spi/HandleDelegate.java Index: HandleDelegate.java === RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/spi/HandleDelegate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HandleDelegate.java 2001/06/04 15:57:18 1.1 +++ HandleDelegate.java 2001/06/12 19:47:49 1.2 @@ -10,41 +10,44 @@ import javax.ejb.EJBObject; /** - * The HandleDelegate interface is implemented by the EJB container. + * The HandleDelegate interface is implemented by the EJB container. * It is used by portable implementations of javax.ejb.Handle and * javax.ejb.HomeHandle. It is not used by EJB components or by client components. * It provides methods to serialize and deserialize EJBObject and EJBHome - * references to streams. + * references to streams. + * + * The HandleDelegate object is obtained by JNDI lookup at the reserved name + * "java:comp/HandleDelegate". */ public interface HandleDelegate { /** - * Serialize the EJBObject reference corresponding to a Handle. + * Serialize the EJBObject reference corresponding to a Handle. * - * This method is called from the writeObject method of portable + * This method is called from the writeObject method of portable * Handle implementation classes. The ostream object is the same - * object that was passed in to the Handle class's writeObject. + * object that was passed in to the Handle class's writeObject. * * @param ejbObject - The EJBObject reference to be serialized. * @param ostream - The output stream. * @exception java.io.IOException - The EJBObject could not be serialized * because of a system-level failure. */ - public abstract void writeEJBObject(EJBObject ejbObject, - java.io.ObjectOutputStream ostream) + public void writeEJBObject(EJBObject ejbObject, + java.io.ObjectOutputStream ostream) throws java.io.IOException; /** - * Deserialize the EJBObject reference corresponding to a Handle. + * Deserialize the EJBObject reference corresponding to a Handle. * - * readEJBObject is called from the readObject method of portable + * readEJBObject is called from the readObject method of portable * Handle implementation classes. The istream object is the same object * that was passed in to the Handle class's readObject. When readEJBObject * is called, istream must point to the location in the stream at which * the EJBObject reference can be read. The container must ensure that * the EJBObject reference is capable of performing invocations immediately - * after deserialization. + * after deserialization. * * @param istream - The input stream. * @return The deserialized EJBObject reference. @@ -54,34 +57,34 @@ * deserialized because some * class could not be found. */ - public abstract EJBObject readEJBObject(java.io.ObjectInputStream istream) + public EJBObject readEJBObject(java.io.ObjectInputStream istream) throws java.io.IOException, java.lang.ClassNotFoundException; /** - * Serialize the EJBHome reference corresponding to a HomeHandle. + * Serialize the EJBHome reference corresponding to a HomeHandle. * - * This method is called from the writeObject method of portable HomeHandle + * This method is called from the writeObject method of portable HomeHandle * implementation classes. The ostream object is the same object that was - * passed in to the Handle class's writeObject. + * passed in to the Handle class's writeObject. * * @param ejbHome - The EJBHome reference to be serialized. * @param ostream - The output stream. * @exception java.io.IOException - The EJBObject could not be serialized * because of a system-level failure. */ - public abstract void writeEJBHome(EJBHome ejbHome, -java.io.ObjectOutputStream ostream) + public void writeEJBHome(EJBHome ejbHome, + java.io.ObjectOutputStream ostream) throws java.io.IOException; /** - * Deserialize the EJBHome reference corresponding to a HomeHandle. + * Deserialize the EJBHome reference corresponding to a HomeHandle. * -
Re: [JBoss-dev] RabbitHole branch created
The cvs trunk or main branch is just the development branch. Any future development goes there. When we want to make a release we create a release branch to draw a line in the feature set that will appear in the release. Any releases will be made from that branch be they alpha, beta, or final. I'm writing up the cvs management procedure that has only appeared in mail form with some changes that clarify usage from my perspective. It will be on the web site tonight. > I am ok with this, but a bit unsure as to what I am supposed to be doing > with the branches then... > > Juha you say "main" will be the 3.0 stuff? > so we > 1- get rid of the new branch > 2- keep the current base as a new new branch > 3- let the main be the current branch > > I can see that it will minimize the number of back ports... please let me > know what I should be doing when I start commiting if anything... I also > understand that we all will be working on that branch... I am ok with it > > marcf > > > |-Original Message- > |From: [EMAIL PROTECTED] > |[mailto:[EMAIL PROTECTED]]On Behalf Of Scott > |M Stark > |Sent: Tuesday, June 12, 2001 1:10 PM > |To: [EMAIL PROTECTED] > |Subject: Re: [JBoss-dev] RabbitHole branch created > | > | > |Your right. Making a future branch will just mean a lot of > |merging. > | ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] RabbitHole branch created
I am ok with this, but a bit unsure as to what I am supposed to be doing with the branches then... Juha you say "main" will be the 3.0 stuff? so we 1- get rid of the new branch 2- keep the current base as a new new branch 3- let the main be the current branch I can see that it will minimize the number of back ports... please let me know what I should be doing when I start commiting if anything... I also understand that we all will be working on that branch... I am ok with it marcf |-Original Message- |From: [EMAIL PROTECTED] |[mailto:[EMAIL PROTECTED]]On Behalf Of Scott |M Stark |Sent: Tuesday, June 12, 2001 1:10 PM |To: [EMAIL PROTECTED] |Subject: Re: [JBoss-dev] RabbitHole branch created | | |Your right. Making a future branch will just mean a lot of |merging. | |- Original Message - |From: "Juha-P Lindfors" <[EMAIL PROTECTED]> |To: "JBoss Dev" <[EMAIL PROTECTED]> |Sent: Tuesday, June 12, 2001 9:43 AM |Subject: Re: [JBoss-dev] RabbitHole branch created | | |> |> hi, |> |> why a branch? It's easier to work on the main trunk and since most |> development effort is going into 3.0 let's just freeze 2.4, |branch the 2.4, |> release 2.4 BETA and fix 2.4 issues in the branch. Keep main |> development in the trunk. |> |> -- Juha |> |> |> On Mon, 11 Jun 2001, Scott M Stark wrote: |> |> > I created a RabbitHole branch off of the current main line for |prototyping |> > the 3.0 generation of JBoss. You can access the branch via the command |> > line version of cvs using: |> > |> > cvs -d |:ext:[EMAIL PROTECTED]:/cvsroot/jboss |co -r RabbitHole jboss |> > |> > |> > |> > |> > ___ |> > Jboss-development mailing list |> > [EMAIL PROTECTED] |> > http://lists.sourceforge.net/lists/listinfo/jboss-development |> > |> |> |> ___ |> Jboss-development mailing list |> [EMAIL PROTECTED] |> http://lists.sourceforge.net/lists/listinfo/jboss-development |> | | |___ |Jboss-development mailing list |[EMAIL PROTECTED] |http://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RabbitHole branch created
Your right. Making a future branch will just mean a lot of merging. - Original Message - From: "Juha-P Lindfors" <[EMAIL PROTECTED]> To: "JBoss Dev" <[EMAIL PROTECTED]> Sent: Tuesday, June 12, 2001 9:43 AM Subject: Re: [JBoss-dev] RabbitHole branch created > > hi, > > why a branch? It's easier to work on the main trunk and since most > development effort is going into 3.0 let's just freeze 2.4, branch the 2.4, > release 2.4 BETA and fix 2.4 issues in the branch. Keep main > development in the trunk. > > -- Juha > > > On Mon, 11 Jun 2001, Scott M Stark wrote: > > > I created a RabbitHole branch off of the current main line for prototyping > > the 3.0 generation of JBoss. You can access the branch via the command > > line version of cvs using: > > > > cvs -d :ext:[EMAIL PROTECTED]:/cvsroot/jboss co -r >RabbitHole jboss > > > > > > > > > > ___ > > Jboss-development mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RabbitHole branch created
hi, why a branch? It's easier to work on the main trunk and since most development effort is going into 3.0 let's just freeze 2.4, branch the 2.4, release 2.4 BETA and fix 2.4 issues in the branch. Keep main development in the trunk. -- Juha On Mon, 11 Jun 2001, Scott M Stark wrote: > I created a RabbitHole branch off of the current main line for prototyping > the 3.0 generation of JBoss. You can access the branch via the command > line version of cvs using: > > cvs -d :ext:[EMAIL PROTECTED]:/cvsroot/jboss co -r >RabbitHole jboss > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] ejb-jar.xml DTD checking during deployment
Its something on my todo list. I'm thinking of adding the DTD validation to the bean verifier step of deployment. - Original Message - From: "Darius Davidavicius" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 12, 2001 8:46 AM Subject: [JBoss-dev] ejb-jar.xml DTD checking during deployment > Hi all, > > Lest image situation: > > During implementation of EJB my collegues or myself do syntaxt error in the >ejb-jar.xml: > > ... > > All > > EMailContact > * > > > > now ejb is deployed but it works strange. I can fall into very interesting situation >just because some configuration is bad. > > What about syntaxt checking inside ApplicationMetaData.java or MetaData.java with >output like: >System.out.println( "WARNING during parsing ejb-jar.xml. Tag " >+ children.item(i).getNodeName() >+ " cannot be used inside " > + parent + " tag". > ); > > > XMLFileLoader.java has LocalResolver() class where DTDs are registered but I cannot >get any warning if deployment descriptor is bad. Maybe > configuration of Jboss allows to add checking? > If not what do you think about improving it? > I have already ligth version of it. Its done in the ApplicationMetaData.java where i >simple checking if tags is accorgins DTD of EJB 1.1 spec. and if it is not i > just print warnings. > > Regards, > > > Darius Davidavicius > www.jbees.com > J2EE consultations, development > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] ejb-jar.xml DTD checking during deployment
Hi all, Lest image situation: During implementation of EJB my collegues or myself do syntaxt error in the ejb-jar.xml: ... All EMailContact * now ejb is deployed but it works strange. I can fall into very interesting situation just because some configuration is bad. What about syntaxt checking inside ApplicationMetaData.java or MetaData.java with output like: System.out.println( "WARNING during parsing ejb-jar.xml. Tag " + children.item(i).getNodeName() + " cannot be used inside " + parent + " tag". ); XMLFileLoader.java has LocalResolver() class where DTDs are registered but I cannot get any warning if deployment descriptor is bad. Maybe configuration of Jboss allows to add checking? If not what do you think about improving it? I have already ligth version of it. Its done in the ApplicationMetaData.java where i simple checking if tags is accorgins DTD of EJB 1.1 spec. and if it is not i just print warnings. Regards, Darius Davidavicius www.jbees.com J2EE consultations, development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Fix proposal in ClientUserTransactionService.java
Hi Ole, no need to change anything. :) i wrote it in the next letter. Current version works fine just i need to change jboss.jcml and jndi.porperties I got in problems because in the previous JBoss versions it was enouth to change JNDI parameters port from 1099 to wanted one without any changes in jndi.porperties. Thanks , have a good day. Darius Davidavicius www.jbees.com J2EE consultations, development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Fix proposal in ClientUserTransactionService.java
Hi, Your change looks fine to me, although I am a bit confused as to why updating the system properties is needed here: That is also done in the org.jboss.naming.NamingService when its initService() method is run. Anyway, I cannot see how it could hurt to do it here. And by doing it here, this service would not depend on the NamingService having been initialized. Best Regards, Ole Husgaard. Darius Davidavicius wrote: > > Hi all, > > I do testing Jboss 2.3 compiled with JDK1.4beta > > Problem: > I need Jboss application naming service be not on default 1099 port because in my >system we use telephony system by Dialogic where port 1099 is > hardcoded. > When i was using JBoss 2.1, 2.2 i just was changing jboss.jcml where : > > > > > 1100 > > > > Now it does not work because of exceptions (connection refused) in the >ClientUserTransactionService.java :: startService() line: > ctx.bind(FACTORY_NAME, factory) . > > Fix proposal: > protected void startService() > throws Exception >{ > >System.getProperties().load(Thread.currentThread().getContextClassLoader().getResourceAsStream("jndi.properties")); > factory = new UserTransactionSessionFactoryImpl(); > > Context ctx = new InitialContext(); > ctx.bind(FACTORY_NAME, factory); > ctx.bind(JNDI_NAME, ClientUserTransaction.getSingleton()); >} > > In such case i change jboss.jcml like example above and in the jndi.porperties i can >do - java.naming.provider.url=localhost:1100 > > I dont know if such fix dont have side efect somewhere else but in my case it works >fine. > > Regards, > > Darius Davidavicius > www.jbees.com > J2EE consultations, development > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] First small patch for jboss-j2ee
Mhmm I'm resending this just in case ... --- Hi. Here is my first small patch for jboss-j2ee. It removes the abstract keyword from the interfaces in javax.ejb and javax.ejb.spi. It also updates the documentation. Note: There was an error in javax.ejb.MessageDrivenBean; the two method throws EJBException instead of RemoteException. Someone with write-access: please review the patch and commit. I'll start to work my way through the other packages in the module. Kind Regards, Jesper -- Jesper Pedersen, M.Sc. C.S.E Open Source Solution Manager Sun Certified Java 2 Developer IT+ A/S Phone: +45 86 78 21 00 Brendstrupgaardsvej 7 Fax: +45 86 78 21 02 DK-8200 Aarhus N Direct:+45 87 40 08 49 Denmark Email: [EMAIL PROTECTED] ejb.patch.gz
[JBoss-dev] Jikes patch
Hi. The following patch makes jikes more happy. There are still warnings; check the output.txt file. Cheers, Jesper Index: ejb/plugins/jms/JMSContainerInvoker.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java,v retrieving revision 1.12 diff -u -r1.12 JMSContainerInvoker.java --- ejb/plugins/jms/JMSContainerInvoker.java 2001/06/01 06:06:37 1.12 +++ ejb/plugins/jms/JMSContainerInvoker.java 2001/06/12 10:32:13 @@ -535,37 +535,30 @@ public void onException(JMSException ex) { currentThread = Thread.currentThread(); - try { - Logger.warning("MDB lost connection to provider"); - boolean tryIt = true; - while(tryIt && notStoped) { - Logger.log("MDB Trying to reconnect..."); - try { - try { - Thread.sleep(1); - }catch(InterruptedException ie) { tryIt=false; return;} - //try { - // Reboot container - invoker.innerStop(); - invoker.destroy(); - invoker.init(); - invoker.start(); - tryIt = false; - Logger.log("OK - reconnected"); - //return; - }catch(Exception e) { - Logger.log("MDB error reconnecting: " +e); - } - } + +Logger.warning("MDB lost connection to provider"); +boolean tryIt = true; +while(tryIt && notStoped) { + Logger.log("MDB Trying to reconnect..."); + try { +try { + Thread.sleep(1); +}catch(InterruptedException ie) { tryIt=false; return;} +//try { +// Reboot container +invoker.innerStop(); +invoker.destroy(); +invoker.init(); +invoker.start(); +tryIt = false; +Logger.log("OK - reconnected"); +//return; + }catch(Exception e) { +Logger.log("MDB error reconnecting: " +e); + } +} - - //topicConnection.close(); - }catch(Exception je) { - Logger.warning("Could not restart connection " + je); - je.printStackTrace(); - } finally { - currentThread = null; - } +currentThread = null; } } Index: jdbc/HypersonicDatabase.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jdbc/HypersonicDatabase.java,v retrieving revision 1.8 diff -u -r1.8 HypersonicDatabase.java --- jdbc/HypersonicDatabase.java 2001/05/21 20:30:52 1.8 +++ jdbc/HypersonicDatabase.java 2001/06/12 10:32:13 @@ -119,7 +119,7 @@ public void run() { // Get DB directory -URL dbLocator = getClass().getResource("/db.properties"); +URL dbLocator = this.getClass().getResource("/db.properties"); File dbDir = new File(dbLocator.getFile()).getParentFile(); File dbName = new File(dbDir, "hypersonic/"+name); Index: jmx/client/ConnectorFactoryService.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/client/ConnectorFactoryService.java,v retrieving revision 1.6 diff -u -r1.6 ConnectorFactoryService.java --- jmx/client/ConnectorFactoryService.java 2001/05/10 22:01:17 1.6 +++ jmx/client/ConnectorFactoryService.java 2001/06/12 10:32:13 @@ -84,12 +84,7 @@ // Protected - protected void initService() throws Exception { - try { mFactory = new ConnectorFactoryImpl( mServer ); - } - catch( Exception e ) { - e.printStackTrace(); - } } protected void startService() throws Exception { Index: web/ThreadPool.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/web/ThreadPool.java,v retrieving revision 1.4 diff -u -r1.4 ThreadPool.java --- web/ThreadPool.java 2000/12/07 15:45:25 1.4 +++ web/ThreadPool.java 2001/06/12 10:32:14 @@ -112,7 +112,7 @@ public synchronized void die() { running = false; - notify(); + this.notify(); } /** @@ -126,7 +126,7 @@ if (this.work != null) throw new IllegalStateException("Worker already has work to do."); this.work = work; - notify(); + this.notify(); } /** @@ -153,7 +153,7 @@ synchronized (this) { while (running && work == null) { try { - wait(); + this.wait(); } catch (InterruptedException e) { // Ignore } output.txt.gz
Re: [JBoss-dev] Fix proposal rollback
Ooos sorry for disturbing you :) but fix not needed because it is enouth to do the changes in the configuration files: IN jboss.jcml 1100 and jndi.porperties (previous Jboss versions does not needed it what is why i got confused) java.naming.provider.url=localhost:1100 Have a good day all, Darius Davidavicius www.jbees.com J2EE consultations, development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] JMSContainerInvoker.java
From my experiences at security aware sites (like financial institutions) I'd say that a file of the node specific properties is a must. Port numbers have been mentioned but what about the DB user and password? Access to these leaves the database wide open so they would often not even be held in a file on the file system but typed in during a deployment or startup. If they are put in a file then it lives only on the node to which it applies protected under a secure user id that's used solely for deployment of the application server. The DB user id and password are currently stored in JBoss.jcml. They would need to be pulled out, as suggested for the port numbers, into a separate properties file before the more paranoid sites I've worked at would consider deploying JBoss. Mike S-R At 00:05 12/06/2001 -0700, you wrote: >We can argue the details, but I agree with Peter about the current >configuration >being very difficult to manage. If we are going to move to a web based >deployment >to multiple boxes we won't be able to simply rely on URLClassLoaders pulling >down the current config files and expect them to work as many configuration >parameters will be specific to box on which the server is being installed. > >- Original Message - >From: "Peter Antman" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Monday, June 11, 2001 11:30 PM >Subject: Re: [JBoss-dev] JMSContainerInvoker.java > > > > On 11 Jun, marc fleury wrote: > > > what I am hearing is that you want jbossmq/jboss/servlet configuration in > > > xml snippets in jboss.jcml, otherwise I don't see what it brings > except yet > > > another layer of indirection... > > > > > > I guess it depends on you requirements. Mine is that I must be able to > > support a lot of installations of JBoss on machines I do not have > > complete controll over, such as ports, multihomed and such things. > > > > My experience from working with JBoss for almost a year now is that the > > configuration files changes a lot al the time, and it is quite hard to > > diff all these files all the time when a new release arrives, or when I > > have to go cutting cvs edge ;-). > > > > It is much easier to have one central property files wich controlles all > > those environment stuff (much like a preprocessor), just try to diff > > standardjboss.xml with all those hardcoded > > ! > > > > > >___ >Jboss-development mailing list >[EMAIL PROTECTED] >http://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] Fix proposal in ClientUserTransactionService.java
Hi all, I do testing Jboss 2.3 compiled with JDK1.4beta Problem: I need Jboss application naming service be not on default 1099 port because in my system we use telephony system by Dialogic where port 1099 is hardcoded. When i was using JBoss 2.1, 2.2 i just was changing jboss.jcml where : 1100 Now it does not work because of exceptions (connection refused) in the ClientUserTransactionService.java :: startService() line: ctx.bind(FACTORY_NAME, factory) . Fix proposal: protected void startService() throws Exception { System.getProperties().load(Thread.currentThread().getContextClassLoader().getResourceAsStream("jndi.properties")); factory = new UserTransactionSessionFactoryImpl(); Context ctx = new InitialContext(); ctx.bind(FACTORY_NAME, factory); ctx.bind(JNDI_NAME, ClientUserTransaction.getSingleton()); } In such case i change jboss.jcml like example above and in the jndi.porperties i can do - java.naming.provider.url=localhost:1100 I dont know if such fix dont have side efect somewhere else but in my case it works fine. Regards, Darius Davidavicius www.jbees.com J2EE consultations, development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/security/ejb StatelessSessionBean.java StatelessSessionBean2.java
User: starksm Date: 01/06/12 00:58:41 Modified:src/main/org/jboss/test/security/ejb StatelessSessionBean.java StatelessSessionBean2.java Log: Add tests of the EJB2.0 unchecked and exclude-list permission elements Revision ChangesPath 1.5 +15 -2 jbosstest/src/main/org/jboss/test/security/ejb/StatelessSessionBean.java Index: StatelessSessionBean.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/ejb/StatelessSessionBean.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- StatelessSessionBean.java 2001/05/22 04:03:27 1.4 +++ StatelessSessionBean.java 2001/06/12 07:58:40 1.5 @@ -3,13 +3,14 @@ import java.rmi.RemoteException; import java.security.Principal; import javax.ejb.CreateException; +import javax.ejb.EJBException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; /** A simple session bean for testing declarative security. -@author [EMAIL PROTECTED] -@version $Revision: 1.4 $ +@author [EMAIL PROTECTED] +@version $Revision: 1.5 $ */ public class StatelessSessionBean implements SessionBean { @@ -67,4 +68,16 @@ Object obj = null; obj.toString(); } + +public void unchecked() +{ +Principal p = sessionContext.getCallerPrincipal(); +System.out.println("StatelessSessionBean.unchecked, callerPrincipal="+p); +} + +public void excluded() +{ +throw new EJBException("StatelessSessionBean.excluded, no access should be allowed"); +} + } 1.3 +11 -2 jbosstest/src/main/org/jboss/test/security/ejb/StatelessSessionBean2.java Index: StatelessSessionBean2.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/ejb/StatelessSessionBean2.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- StatelessSessionBean2.java2001/05/22 03:21:00 1.2 +++ StatelessSessionBean2.java2001/06/12 07:58:40 1.3 @@ -16,8 +16,8 @@ /** A SessionBean that access the Entity bean to test Principal identity propagation. -@author [EMAIL PROTECTED] -@version $Revision: 1.2 $ +@author [EMAIL PROTECTED] +@version $Revision: 1.3 $ */ public class StatelessSessionBean2 implements SessionBean { @@ -102,5 +102,14 @@ Object obj = null; obj.toString(); } +public void unchecked() +{ +Principal p = sessionContext.getCallerPrincipal(); +System.out.println("StatelessSessionBean.unchecked, callerPrincipal="+p); +} +public void excluded() +{ +throw new EJBException("StatelessSessionBean.excluded, no access should be allowed"); +} } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] CVS update: jbosstest/src/resources/security/META-INF ejb-jar.xml
Please remove this address from your mailing list as we have been receiving upwards of 200 mails a day similar to the attached. Thank you in adavance. Kind Regards Richard Butler European Sales Resourcer MBA Intelligent Solutions Direct Line: +44 (0)20 8290 8639 Direct Fax: +44 (0)20 8290 8559 Email;[EMAIL PROTECTED] Website:www.intelligentsolutions.co.uk > -Original Message- > From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Sent: 12 June 2001 08:59 > To: [EMAIL PROTECTED] > Subject: [JBoss-dev] CVS update: > jbosstest/src/resources/security/META-INF ejb-jar.xml > > User: starksm > Date: 01/06/12 00:58:41 > > Modified:src/resources/security/META-INF ejb-jar.xml > Log: > Add tests of the EJB2.0 unchecked and exclude-list permission elements > > Revision ChangesPath > 1.4 +71 -45 > jbosstest/src/resources/security/META-INF/ejb-jar.xml > > Index: ejb-jar.xml > === > RCS file: > /cvsroot/jboss/jbosstest/src/resources/security/META-INF/ejb-jar.xml,v > retrieving revision 1.3 > retrieving revision 1.4 > diff -u -r1.3 -r1.4 > --- ejb-jar.xml 2001/05/22 03:20:24 1.3 > +++ ejb-jar.xml 2001/06/12 07:58:41 1.4 > @@ -109,49 +109,75 @@ > > > > - > - > -The role required to invoke the echo > method > -Echo > - > - > - > - Echo > - > - > -StatelessSession > -create > - > - > -StatelessSession > -remove > - > - > -StatelessSession > -echo > - > - > -StatelessSession > -npeError > - > - > - > -StatelessSession2 > -* > - > - > - > -Entity > -* > - > - > - > - > - ProjectUser > - > -ProjRepository > -* > - > - > - > + > + > +The role required to invoke the echo > method > +Echo > + > + > + > + > +Echo > + > + > +StatelessSession > +create > + > + > +StatelessSession > +remove > + > + > +StatelessSession > +echo > + > + > +StatelessSession > +npeError > + > + > + > +StatelessSession2 > +* > + > + > + > +Entity > +* > + > + > + > + > + > + > + > +StatelessSession > +unchecked > + > + > + > + > +ProjectUser > + > +ProjRepository > +* > + > + > + > + > + > +A method that no one can access in this > deployment > + > +StatelessSession > +excluded > + > + > +StatelessSession2 > +excluded > + > + > + > + > + > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/build build.xml
User: starksm Date: 01/06/12 01:07:37 Modified:src/build build.xml Log: Implement the EJB2.0 unchecked and exclude-list ejb-jar descriptor security elements Revision ChangesPath 1.76 +15 -3 jboss/src/build/build.xml Index: build.xml === RCS file: /cvsroot/jboss/jboss/src/build/build.xml,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- build.xml 2001/06/11 19:59:03 1.75 +++ build.xml 2001/06/12 08:07:37 1.76 @@ -70,6 +70,7 @@ + @@ -227,9 +228,20 @@ +> + + + + + + + + + + + + + ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/lib jboss-jaas.jar jbosssx.jar
User: starksm Date: 01/06/12 01:07:37 Modified:src/lib jboss-jaas.jar jbosssx.jar Log: Implement the EJB2.0 unchecked and exclude-list ejb-jar descriptor security elements Revision ChangesPath 1.9 +204 -175 jboss/src/lib/jboss-jaas.jar <> 1.9 +229 -237 jboss/src/lib/jbosssx.jar <> ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/client jbosssx-client.jar
User: starksm Date: 01/06/12 01:07:37 Modified:src/client jbosssx-client.jar Log: Implement the EJB2.0 unchecked and exclude-list ejb-jar descriptor security elements Revision ChangesPath 1.7 +96 -74jboss/src/client/jbosssx-client.jar <> ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/security/plugins NullSecurityManager.java
User: starksm Date: 01/06/12 01:00:43 Added: src/main/org/jboss/security/plugins NullSecurityManager.java Log: Move the security related files that make up the security plugin interface back to the jboss module as it should build without the JBossSX implementation Revision ChangesPath 1.1 jboss/src/main/org/jboss/security/plugins/NullSecurityManager.java Index: NullSecurityManager.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.security.plugins; import java.io.Serializable; import java.util.Set; import java.security.Principal; import javax.security.auth.Subject; import org.jboss.security.RealmMapping; import org.jboss.security.SubjectSecurityManager; /** An implementation of SubjectSecurityManager, RealmMapping that authenticates everyone and for which Principals have any role requested. It can be used as a pass-through security manager when you want noop security. @see #isValid(Principal, Object) @see #Principal getPrincipal(Principal) @see #doesUserHaveRole(Principal, Set) @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class NullSecurityManager implements SubjectSecurityManager, RealmMapping, Serializable { private String securityDomain; /** Creates a default JaasSecurityManager for with the given securityDomain name. */ public NullSecurityManager(String securityDomain) { this.securityDomain = securityDomain; } /** Get the name of the security domain associated with this security mgr. @return Name of the security manager security domain. */ public String getSecurityDomain() { return securityDomain; } /** Get the currently authenticated Subject. @return Always returns null. */ public Subject getActiveSubject() { return null; } /** Validate that the given credential is correct for principal. @return true if the principal was authenticated, false otherwise. */ public boolean isValid(Principal principal, Object credential) { return true; } /** Always returns the argument principal. @return The argument principal */ public Principal getPrincipal(Principal principal) { Principal result = principal; return result; } /** Does the current Subject have a role(a Principal) that equates to one of the role names. This method always returns true. @param principal, ignored. @param roleNames, ignored. @return Always returns true. */ public boolean doesUserHaveRole(Principal principal, Set roleNames) { boolean hasRole = true; return hasRole; } /** Authenticate principal against credential * @param principal, the user id to authenticate * @param credential, an opaque credential. * @return Always returns true. */ private boolean authenticate(Principal principal, Object credential) { boolean authenticated = true; return authenticated; } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosssx/src/main/org/jboss/security SimplePrincipal.java
User: starksm Date: 01/06/12 01:05:09 Removed: src/main/org/jboss/security SimplePrincipal.java Log: Move SimplePrincipal.java to the jboss cvs module ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosssx/src/main/org/jboss/test NestableGroupTest.java
User: starksm Date: 01/06/12 01:05:45 Modified:src/main/org/jboss/test NestableGroupTest.java Log: Update the NestableGroupTest of the AnybodyPrincipal and NobodyPrincipal classes Revision ChangesPath 1.4 +8 -7 jbosssx/src/main/org/jboss/test/NestableGroupTest.java Index: NestableGroupTest.java === RCS file: /cvsroot/jboss/jbosssx/src/main/org/jboss/test/NestableGroupTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- NestableGroupTest.java2001/06/11 06:22:22 1.3 +++ NestableGroupTest.java2001/06/12 08:05:45 1.4 @@ -18,7 +18,7 @@ @see org.jboss.security.NestableGroup @author [EMAIL PROTECTED] -@version $Revision: 1.3 $ +@version $Revision: 1.4 $ */ public class NestableGroupTest extends TestCase { @@ -50,8 +50,8 @@ suite.addTest(new NestableGroupTest("testEquals")); suite.addTest(new NestableGroupTest("testAddMember")); suite.addTest(new NestableGroupTest("testRemoveMember")); -suite.addTest(new NestablePrincipalTest("testAnybody")); -suite.addTest(new NestablePrincipalTest("testNobody")); +suite.addTest(new NestableGroupTest("testAnybody")); +suite.addTest(new NestableGroupTest("testNobody")); return suite; } @@ -84,7 +84,6 @@ public void testAddMember() { System.out.println("testAddMember"); - for(int g = 0; g < groups.length; g ++) { Group grp = groups[g]; @@ -106,7 +105,8 @@ { System.out.println("testAnybody"); group.addMember(groups[0]); -assert("AnybodyPrincipal.isMember", group.isMember(AnybodyPrincipal.ANYBODY_PRINCIPAL)); +boolean isMember = group.isMember(AnybodyPrincipal.ANYBODY_PRINCIPAL); +assert("AnybodyPrincipal.isMember", isMember); } public void testNobody() @@ -116,12 +116,13 @@ SimplePrincipal nobody = new SimplePrincipal(""); nobodyGroup.addMember(nobody); group.addMember(nobodyGroup); -assert("AnybodyPrincipal.isMember", group.isMember(NobodyPrincipal.NOBODY_PRINCIPAL) == false); +boolean isMember = group.isMember(NobodyPrincipal.NOBODY_PRINCIPAL); +assert("NobodyPrincipal.isMember == false", isMember == false); } /** Test of members method, of class org.jboss.security.NestableGroup. */ private void testMembers(int grpNo) -{ +{ String user = "user."+grpNo+'.'; HashSet memberSet = new HashSet(); for(int m = 0; m < 4; m ++) ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosssx/src/main/org/jboss/security SimpleGroup.java EJBSecurityManager.java RealmMapping.java SecurityAssociation.java SecurityProxy.java SecurityProxyFactory.java SubjectSecurityManager.java
User: starksm Date: 01/06/12 01:03:33 Modified:src/main/org/jboss/security SimpleGroup.java Removed: src/main/org/jboss/security EJBSecurityManager.java RealmMapping.java SecurityAssociation.java SecurityProxy.java SecurityProxyFactory.java SubjectSecurityManager.java Log: Add special check for membership of AnybodyPrincipal and NobodyPrincipal types to SimpleGroup.isMember Move the security related files that make up the JBoss security plugin interface back to the jboss module as it should build without the JBossSX implementation Revision ChangesPath 1.2 +18 -9 jbosssx/src/main/org/jboss/security/SimpleGroup.java Index: SimpleGroup.java === RCS file: /cvsroot/jboss/jbosssx/src/main/org/jboss/security/SimpleGroup.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SimpleGroup.java 2001/03/05 09:53:27 1.1 +++ SimpleGroup.java 2001/06/12 08:03:33 1.2 @@ -15,8 +15,8 @@ import java.util.Iterator; import java.util.HashMap; -/** An implementation of Group that manages a collection of -Principal objects based on their getName() values. This class +/** An implementation of Group that manages a collection of Principal +objects based on their hashCode() and equals() methods. This class is not thread safe. @author [EMAIL PROTECTED] @@ -38,16 +38,18 @@ */ public boolean addMember(Principal user) { -String key = user.getName(); -boolean isMember = members.containsKey(key); +boolean isMember = members.containsKey(user); if( isMember == false ) -members.put(key, user); +members.put(user, user); return isMember == false; } /** Returns true if the passed principal is a member of the group. This method does a recursive search, so if a principal belongs to a group which is a member of this group, true is returned. +A special check is made to see if the member is an instance of +org.jboss.security.AnybodyPrincipal or org.jboss.security.NobodyPrincipal +since these classes do not hash to meaningful values. @param member the principal whose membership is to be checked. @return true if the principal is a member of this group, false otherwise. @@ -55,9 +57,17 @@ public boolean isMember(Principal member) { // First see if there is a key with the member name -String key = member.getName(); -boolean isMember = members.containsKey(key); +boolean isMember = members.containsKey(member); if( isMember == false ) +{ // Check the AnybodyPrincipal & NobodyPrincipal special cases +isMember = (member instanceof org.jboss.security.AnybodyPrincipal); +if( isMember == false ) +{ +if( member instanceof org.jboss.security.NobodyPrincipal ) +return false; +} +} +if( isMember == false ) { // Check any Groups for membership Collection values = members.values(); Iterator iter = values.iterator(); @@ -91,8 +101,7 @@ */ public boolean removeMember(Principal user) { -String key = user.getName(); -Object prev = members.remove(key); +Object prev = members.remove(user); return prev != null; } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosssx/src/main/org/jboss/security/plugins NullSecurityManager.java
User: starksm Date: 01/06/12 01:03:33 Removed: src/main/org/jboss/security/plugins NullSecurityManager.java Log: Add special check for membership of AnybodyPrincipal and NobodyPrincipal types to SimpleGroup.isMember Move the security related files that make up the JBoss security plugin interface back to the jboss module as it should build without the JBossSX implementation ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/security/test TestEJBSpec.java
User: starksm Date: 01/06/12 00:58:41 Modified:src/main/org/jboss/test/security/test TestEJBSpec.java Log: Add tests of the EJB2.0 unchecked and exclude-list permission elements Revision ChangesPath 1.4 +60 -4 jbosstest/src/main/org/jboss/test/security/test/TestEJBSpec.java Index: TestEJBSpec.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/test/TestEJBSpec.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TestEJBSpec.java 2001/05/22 03:21:00 1.3 +++ TestEJBSpec.java 2001/06/12 07:58:41 1.4 @@ -14,8 +14,8 @@ /** Test of EJB spec conformace using the security-spec.jar deployment unit. -@author [EMAIL PROTECTED] -@version $Revision: 1.3 $ +@author [EMAIL PROTECTED] +@version $Revision: 1.4 $ */ public class TestEJBSpec extends junit.framework.TestCase { @@ -127,15 +127,71 @@ bean.remove(); } +/** Test that a user with a role that has not been assigned any +method permissions in the ejb-jar descriptor is able to access a +method that has been marked as unchecked. + */ +public void testUnchecked() throws Exception +{ +// Login as scott to create the bean +login(); +InitialContext jndiContext = new InitialContext(); +Object obj = jndiContext.lookup("spec.StatelessSession"); +obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class); +StatelessSessionHome home = (StatelessSessionHome) obj; +System.out.println("Found spec.StatelessSession Home"); +StatelessSession bean = home.create(); +System.out.println("Created spec.StatelessSession"); +// Logout and login back in as stark to test access to the unchecked method +logout(); +login("stark", "javaman".toCharArray()); +bean.unchecked(); +System.out.println("Called Bean.unchecked()"); +logout(); +} + +/** Test that user scott who has the Echo role is not able to +access the StatelessSession2.excluded method even though +the Echo role has been granted access to all methods of +StatelessSession2 to test that the excluded-list takes +precendence over the method-permissions. + */ +public void testExcluded() throws Exception +{ +System.out.println("+++ testExcluded"); +login(); +InitialContext jndiContext = new InitialContext(); +Object obj = jndiContext.lookup("spec.StatelessSession2"); +obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class); +StatelessSessionHome home = (StatelessSessionHome) obj; +System.out.println("Found spec.StatelessSession2 Home"); +StatelessSession bean = home.create(); +System.out.println("Created spec.StatelessSession2"); +try +{ +bean.excluded(); +fail("Was able to call Bean.excluded()"); +} +catch(Exception e) +{ +System.out.println("Bean.excluded() failed as expected"); +// This is what we expect +} +logout(); +} + /** Login as user scott using the conf.name login config or -'other' if conf.name is not defined. +'spec-test' if conf.name is not defined. */ private void login() throws Exception { +login(username, password); +} +private void login(String username, char[] password) throws Exception +{ if( loggedIn ) return; -loggedIn = false; lc = null; String confName = System.getProperty("conf.name", "spec-test"); AppCallbackHandler handler = new AppCallbackHandler(username, password); ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/resources/security/META-INF ejb-jar.xml
User: starksm Date: 01/06/12 00:58:41 Modified:src/resources/security/META-INF ejb-jar.xml Log: Add tests of the EJB2.0 unchecked and exclude-list permission elements Revision ChangesPath 1.4 +71 -45jbosstest/src/resources/security/META-INF/ejb-jar.xml Index: ejb-jar.xml === RCS file: /cvsroot/jboss/jbosstest/src/resources/security/META-INF/ejb-jar.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ejb-jar.xml 2001/05/22 03:20:24 1.3 +++ ejb-jar.xml 2001/06/12 07:58:41 1.4 @@ -109,49 +109,75 @@ - - -The role required to invoke the echo method -Echo - - - - Echo - - -StatelessSession -create - - -StatelessSession -remove - - -StatelessSession -echo - - -StatelessSession -npeError - - - -StatelessSession2 -* - - - -Entity -* - - - - - ProjectUser - -ProjRepository -* - - - + + +The role required to invoke the echo method +Echo + + + + +Echo + + +StatelessSession +create + + +StatelessSession +remove + + +StatelessSession +echo + + +StatelessSession +npeError + + + +StatelessSession2 +* + + + +Entity +* + + + + + + + +StatelessSession +unchecked + + + + +ProjectUser + +ProjRepository +* + + + + + +A method that no one can access in this deployment + +StatelessSession +excluded + + +StatelessSession2 +excluded + + + + + ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/security EJBSecurityManager.java RealmMapping.java SecurityAssociation.java SecurityProxy.java SecurityProxyFactory.java SimplePrincipal.java SubjectSecurityManager.java AnybodyPrincipal.java NobodyPrincipal.java
User: starksm Date: 01/06/12 01:00:43 Modified:src/main/org/jboss/security AnybodyPrincipal.java NobodyPrincipal.java Added: src/main/org/jboss/security EJBSecurityManager.java RealmMapping.java SecurityAssociation.java SecurityProxy.java SecurityProxyFactory.java SimplePrincipal.java SubjectSecurityManager.java Log: Move the security related files that make up the security plugin interface back to the jboss module as it should build without the JBossSX implementation Revision ChangesPath 1.2 +4 -1 jboss/src/main/org/jboss/security/AnybodyPrincipal.java Index: AnybodyPrincipal.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/security/AnybodyPrincipal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AnybodyPrincipal.java 2001/06/11 06:15:57 1.1 +++ AnybodyPrincipal.java 2001/06/12 08:00:43 1.2 @@ -13,8 +13,11 @@ using {@link #equals(Object) equals} or {@link #compareTo(Object) compareTo} will always be found equals to the AnybodyPrincipal. +Note that this class is not likely to operate correctly in a collection +since the hashCode() and equals() methods are not correlated. + @author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@version $Revision: 1.2 $ */ public class AnybodyPrincipal implements Comparable, Principal { 1.2 +4 -1 jboss/src/main/org/jboss/security/NobodyPrincipal.java Index: NobodyPrincipal.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/security/NobodyPrincipal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- NobodyPrincipal.java 2001/06/11 06:15:57 1.1 +++ NobodyPrincipal.java 2001/06/12 08:00:43 1.2 @@ -13,8 +13,11 @@ using {@link #equals(Object) equals} or {@link #compareTo(Object) compareTo} will always be found not equal to the NobodyPrincipal. +Note that this class is not likely to operate correctly in a collection +since the hashCode() and equals() methods are not correlated. + @author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@version $Revision: 1.2 $ */ public class NobodyPrincipal implements Comparable, Principal { 1.3 +0 -22 jboss/src/main/org/jboss/security/EJBSecurityManager.java 1.3 +26 -9 jboss/src/main/org/jboss/security/RealmMapping.java 1.3 +62 -9 jboss/src/main/org/jboss/security/SecurityAssociation.java 1.1 jboss/src/main/org/jboss/security/SecurityProxy.java Index: SecurityProxy.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.security; import java.lang.reflect.Method; import javax.ejb.EJBContext; /** An interface describing the requirements for a SecurityInterceptor proxy. A SecurityProxy allows for the externalization of custom security checks on a per-method basis for both the EJB home and remote interface methods. Custom security checks are those that cannot be described using the standard EJB deployment time declarative role based security. @author [EMAIL PROTECTED] @version $Revision: 1.1 $ * @stereotype plug-in point */ public interface SecurityProxy { public void init(Class beanHome, Class beanRemote, Object securityMgr) throws InstantiationException; /** Called prior to any method invocation to set the current EJB context. */ public void setEJBContext(EJBContext ctx); /** Called to allow the security proxy to perform any custom security checks required for the EJB home interface method. @param m, the EJB home interface method? Or is this the EJB bean impl method? */ public void invokeHome(Method m, Object[] args) throws SecurityException; /** Called to allow the security proxy to perform any custom security checks required for the EJB remote interface method. @param m, the EJB remote interface method? Or is this the EJB bean impl method? @param bean, the EJB implementation class instance */ public void invoke(Method m, Object[] args, Object bean) throws SecurityException; } 1.1 jboss/src/main/org/jboss/security/SecurityProxyFactory.java Index: SecurityProxyFactory.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.security;
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/security/interfaces StatelessSession.java
User: starksm Date: 01/06/12 00:58:41 Modified:src/main/org/jboss/test/security/interfaces StatelessSession.java Log: Add tests of the EJB2.0 unchecked and exclude-list permission elements Revision ChangesPath 1.3 +9 -0 jbosstest/src/main/org/jboss/test/security/interfaces/StatelessSession.java Index: StatelessSession.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/interfaces/StatelessSession.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- StatelessSession.java 2001/05/22 03:21:00 1.2 +++ StatelessSession.java 2001/06/12 07:58:41 1.3 @@ -18,4 +18,13 @@ public String forward(String echoArg) throws RemoteException; /** A method that throws a NullPointerException */ public void npeError() throws RemoteException; +/** A method that is assigned the method-permission/unchecked tag + to allow any authenticated user call the method. + */ +public void unchecked() throws RemoteException; + +/** A method that is assigned to the exclude-list tag + to indicate that no users should be allowed to call it. + */ +public void excluded() throws RemoteException; } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development