[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: tobyallsopp Date: 01/05/04 23:38:28 Modified:src/main/org/jboss/resource Tag: Branch_2_2 RARDeployer.java Log: Fixed the RAR redployment bug (#415516) thanks to a patch from Claudio Vesco. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +22 -9 jbosscx/src/main/org/jboss/resource/RARDeployer.java Index: RARDeployer.java === RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployer.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- RARDeployer.java 2001/02/06 06:54:40 1.1.1.1 +++ RARDeployer.java 2001/05/05 06:38:28 1.1.1.1.2.1 @@ -47,7 +47,7 @@ * codeConnectionFactoryLoader/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version $Revision: 1.1.1.1 $ + * @version $Revision: 1.1.1.1.2.1 $ * * @see org.jboss.resource.ConnectionFactoryLoader */ @@ -128,7 +128,8 @@ // included JARs for classloading (I don't think URLClassLoader // deals with JARs within JARs). - File unpackedDir = new File(rarTmpDir, generateUniqueDirName(url)); + String unpackedDirName = generateUniqueDirName(url); + File unpackedDir = new File(rarTmpDir, unpackedDirName); if (unpackedDir.exists()) { throw new DeploymentException(The application at URL ' + url + ' + @@ -150,8 +151,21 @@ } else { - // this is a .rar file somewhere - inflateJar(url, unpackedDir); + // this is a .rar file somewhere so we copy it to the temp + // dir because otherwise we run into problems when we try to + // open it again later + File copyFile = new File(rarTmpDir, copy + unpackedDirName); + InputStream input = url.openStream(); + try + { +OutputStream output = new FileOutputStream(copyFile); +try +{ + copy(input, output); +} finally { output.close(); } + } finally { input.close(); } + // then we can inflate the copy without fear of retribution + inflateJar(copyFile.toURL(), unpackedDir); } // Right, now we can forget about URLs and just use the file @@ -202,15 +216,14 @@ } }; Collection jarFiles = recursiveFind(unpackedDir, filter); + log.debug(Adding the following URLs to classpath:); for (Iterator i = jarFiles.iterator(); i.hasNext(); ) { File file = (File) i.next(); - jars.add(file.toURL()); + URL jarUrl = file.toURL(); + jars.add(jarUrl); + log.debug(jarUrl.toString()); } - - log.debug(Adding the following URLs to classpath:); - for (Iterator i = jars.iterator(); i.hasNext(); ) - log.debug(((URL) i.next()).toString()); // Ok, now we have the URLs of the JARs contained in the RAR we // can create a classloader that loads classes from them ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/lib jbosscx-0.2.jar
User: tobyallsopp Date: 01/05/04 23:39:34 Modified:src/lib Tag: Branch_2_2 jbosscx-0.2.jar Log: Fixed the RAR redployment bug (#415516) thanks to a patch from Claudio Vesco. Revision ChangesPath No revision No revision 1.3.2.2 +33 -32jboss/src/lib/jbosscx-0.2.jar Binary file ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [ jboss-Change Notes-421582 ] Fix RAR redeployment bug
Change Notes item #421582, was updated on 2001-05-04 23:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detailatid=381174aid=421582group_id=22866 Category: None Group: v2.2.2 Status: Open Priority: 5 Submitted By: Toby Allsopp (tobyallsopp) Assigned to: Nobody/Anonymous (nobody) Summary: Fix RAR redeployment bug Initial Comment: RAR files can now be redeployed, thanks to a patch from Vesco Claudio. -- You can respond by visiting: http://sourceforge.net/tracker/?func=detailatid=381174aid=421582group_id=22866 ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: tobyallsopp Date: 01/05/05 00:12:46 Modified:src/main/org/jboss/resource RARDeployer.java Log: Fixed the RAR redployment bug (#415516) thanks to a patch from Claudio Vesco. Revision ChangesPath 1.3 +22 -9 jbosscx/src/main/org/jboss/resource/RARDeployer.java Index: RARDeployer.java === RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RARDeployer.java 2001/04/15 04:31:39 1.2 +++ RARDeployer.java 2001/05/05 07:12:46 1.3 @@ -48,7 +48,7 @@ * codeConnectionFactoryLoader/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * * @see org.jboss.resource.ConnectionFactoryLoader */ @@ -140,7 +140,8 @@ // included JARs for classloading (I don't think URLClassLoader // deals with JARs within JARs). - File unpackedDir = new File(rarTmpDir, generateUniqueDirName(url)); + String unpackedDirName = generateUniqueDirName(url); + File unpackedDir = new File(rarTmpDir, unpackedDirName); if (unpackedDir.exists()) { throw new DeploymentException(The application at URL ' + url + ' + @@ -162,8 +163,21 @@ } else { - // this is a .rar file somewhere - inflateJar(url, unpackedDir); + // this is a .rar file somewhere so we copy it to the temp + // dir because otherwise we run into problems when we try to + // open it again later + File copyFile = new File(rarTmpDir, copy + unpackedDirName); + InputStream input = url.openStream(); + try + { +OutputStream output = new FileOutputStream(copyFile); +try +{ + copy(input, output); +} finally { output.close(); } + } finally { input.close(); } + // then we can inflate the copy without fear of retribution + inflateJar(copyFile.toURL(), unpackedDir); } // Right, now we can forget about URLs and just use the file @@ -214,15 +228,14 @@ } }; Collection jarFiles = recursiveFind(unpackedDir, filter); + log.debug(Adding the following URLs to classpath:); for (Iterator i = jarFiles.iterator(); i.hasNext(); ) { File file = (File) i.next(); - jars.add(file.toURL()); + URL jarUrl = file.toURL(); + jars.add(jarUrl); + log.debug(jarUrl.toString()); } - - log.debug(Adding the following URLs to classpath:); - for (Iterator i = jars.iterator(); i.hasNext(); ) - log.debug(((URL) i.next()).toString()); // Ok, now we have the URLs of the JARs contained in the RAR we // can create a classloader that loads classes from them ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/lib jbosscx-0.2.jar
User: tobyallsopp Date: 01/05/05 00:16:23 Modified:src/lib jbosscx-0.2.jar Log: Fixed the RAR redployment bug (#415516) thanks to a patch from Claudio Vesco. Revision ChangesPath 1.7 +63 -64jboss/src/lib/jbosscx-0.2.jar Binary file ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] RFC: Add isolation level attribute in jboss.xml or jaws.xml?
Does anyone have opinions on whether this would be a good feature or not? The 1.1 spec does not specify how isolation levels should be handled, except for BMT session beans, and by saying/implying that beans can call resource manager specific APIs to set it themselves (carefully). If this seems like a good idea, should this setting be in jboss.xml (and cover BMP and CMP entities as well as sessions), or in jaws.xml (covering _only_ CMP entities, since others are free to call the resource manager's APIs)? thanks, danch ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/build/subprojects - New directory
User: starksm Date: 01/05/05 13:43:43 jbosstest/src/build/subprojects - New directory ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/resources/web/WEB-INF - New directory
User: starksm Date: 01/05/05 13:55:23 jbosstest/src/resources/web/WEB-INF - New directory ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/resources/web index.html snoop.jsp
User: starksm Date: 01/05/05 13:56:55 Added: src/resources/web index.html snoop.jsp Log: Resources for the web container integration tests Revision ChangesPath 1.1 jbosstest/src/resources/web/index.html Index: index.html === !doctype html public -//w3c//dtd html 4.0 transitional//en html head titleJBoss Servlet Container Integration Tests/title /head h1JBoss Servlet Container Integration Tests/h1 h2Servlet Tests/h2 ul lia href=/jbosstest/ENCServletTry the ENCServlet/a A test of the servlet container integration into the JNDI namespace. This servlet accesses the java:comp/env namespace for JDBC javax.sql.DataSources, JMS QueueConnectionFactory, /li lia href=/jbosstest/EJBServletTry the EJBServlet/a A test of the ability to access EJBs from a servlet using the ejb-ref tag in web.xml and jboss-web.xml. /li /ul h2JSP Tests/h2 ul lia href=/jbosstest/snoop.jspTry snoop.jsp/a A basic test of a JSP page. /li /ul h2Security Tests/h2 ul lia href=/jbosstest/restricted/SecureServletTry SecureServlet/a A test of securing servlet content using the JBoss JAAS authentication layer. /li lia href=/jbosstest/restricted/SecureEJBAccessTry SecureEJBAccess/a A test of securing servlet content using the JBoss JAAS authentication layer as well as propagation of the servlet container identity to a secure EJB. /li /ul /body /html 1.1 jbosstest/src/resources/web/snoop.jsp Index: snoop.jsp === html !-- Copyright (c) 1999 The Apache Software Foundation. All rights reserved. -- body bgcolor=white h1 Request Information /h1 font size=4 JSP Request Method: %= request.getMethod() % br Request URI: %= request.getRequestURI() % br Request Protocol: %= request.getProtocol() % br Servlet path: %= request.getServletPath() % br Path info: %= request.getPathInfo() % br Path translated: %= request.getPathTranslated() % br Query string: %= request.getQueryString() % br Content length: %= request.getContentLength() % br Content type: %= request.getContentType() % br Server name: %= request.getServerName() % br Server port: %= request.getServerPort() % br Remote user: %= request.getRemoteUser() % br Remote address: %= request.getRemoteAddr() % br Remote host: %= request.getRemoteHost() % br Authorization scheme: %= request.getAuthType() % br Locale: %= request.getLocale() % hr The browser you are using is %= request.getHeader(User-Agent) % hr /font /body /html ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/resources/web/WEB-INF jboss-web.xml web.xml
User: starksm Date: 01/05/05 13:56:55 Added: src/resources/web/WEB-INF jboss-web.xml web.xml Log: Resources for the web container integration tests Revision ChangesPath 1.1 jbosstest/src/resources/web/WEB-INF/jboss-web.xml Index: jboss-web.xml === ?xml version=1.0 encoding=ISO-8859-1? jboss-web resource-ref res-ref-namejdbc/DefaultDS/res-ref-name res-typejavax.sql.DataSource/res-type jndi-namejava:/DefaultDS/jndi-name /resource-ref resource-ref res-ref-namemail/DefaultMail/res-ref-name res-typejavax.mail.Session/res-type jndi-namejava:/Mail/jndi-name /resource-ref resource-ref res-ref-namejms/QueFactory/res-ref-name res-typejavax.jms.QueueConnectionFactory/res-type jndi-nameQueueConnectionFactory/jndi-name /resource-ref ejb-ref ejb-ref-nameejb/bean0/ejb-ref-name jndi-nameENCBean0/jndi-name /ejb-ref ejb-ref ejb-ref-nameejb/bean1/ejb-ref-name jndi-nameENCBean1/jndi-name /ejb-ref ejb-ref ejb-ref-nameejb/SecuredEJB/ejb-ref-name jndi-namejbosstest/ejbs/SecuredEJB/jndi-name /ejb-ref ejb-ref ejb-ref-nameejb/OptimizedEJB/ejb-ref-name jndi-nameOptimizedEJB/jndi-name /ejb-ref /jboss-web 1.1 jbosstest/src/resources/web/WEB-INF/web.xml Index: web.xml === ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app !-- ### Servlets -- servlet servlet-nameENCServlet/servlet-name servlet-classorg.jboss.test.web.servlets.ENCServlet/servlet-class /servlet servlet servlet-nameEJBServlet/servlet-name servlet-classorg.jboss.test.web.servlets.EJBServlet/servlet-class /servlet servlet servlet-nameSecureServlet/servlet-name servlet-classorg.jboss.test.web.servlets.SecureServlet/servlet-class /servlet servlet servlet-nameSecureEJBServlet/servlet-name servlet-classorg.jboss.test.web.servlets.SecureEJBServlet/servlet-class /servlet servlet servlet-namesnoop/servlet-name jsp-file/snoop.jsp/jsp-file /servlet servlet-mapping servlet-nameENCServlet/servlet-name url-pattern/ENCServlet/url-pattern /servlet-mapping servlet-mapping servlet-nameEJBServlet/servlet-name url-pattern/EJBServlet/url-pattern /servlet-mapping servlet-mapping servlet-nameSecureServlet/servlet-name url-pattern/restricted/SecureServlet/url-pattern /servlet-mapping servlet-mapping servlet-nameSecureEJBServlet/servlet-name url-pattern/restricted/SecureEJBAccess/url-pattern /servlet-mapping servlet-mapping servlet-namesnoop/servlet-name url-pattern*.snp/url-pattern /servlet-mapping !-- The Welcome File List -- welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list !-- ### Resources -- !-- JDBC DataSources (java:comp/env/jdbc) -- resource-ref descriptionThe default DS/description res-ref-namejdbc/DefaultDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref !-- JavaMail Connection Factories (java:comp/env/mail) -- resource-ref descriptionDefault Mail/description res-ref-namemail/DefaultMail/res-ref-name res-typejavax.mail.Session/res-type res-authContainer/res-auth /resource-ref !-- JMS Connection Factories (java:comp/env/jms) -- resource-ref descriptionDefault QueueFactory/description res-ref-namejms/QueFactory/res-ref-name res-typejavax.jms.QueueConnectionFactory/res-type res-authContainer/res-auth /resource-ref !-- URL Connection Factories (java:comp/env/url) -- !-- ### Security -- security-constraint web-resource-collection web-resource-nameRestricted/web-resource-name descriptionDeclarative security tests/description url-pattern/restricted/*/url-pattern http-methodHEAD/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method http-methodDELETE/http-method /web-resource-collection auth-constraint descriptionOnly /description role-nameAuthorizedUser/role-name
[JBoss-dev] CVS update: jbosstest/src/resources/web/META-INF application.xml ejb-jar.xml jboss.xml
User: starksm Date: 01/05/05 13:56:55 Added: src/resources/web/META-INF application.xml ejb-jar.xml jboss.xml Log: Resources for the web container integration tests Revision ChangesPath 1.1 jbosstest/src/resources/web/META-INF/application.xml Index: application.xml === ?xml version=1.0 encoding=UTF-8? application display-nameJBossTest Web Container Testsuite/display-name module web web-urijbosstest-web.war/web-uri context-root/jbosstest/context-root /web /module module ejbjbosstest-web-ejbs.jar/ejb /module /application 1.1 jbosstest/src/resources/web/META-INF/ejb-jar.xml Index: ejb-jar.xml === ?xml version=1.0 encoding=UTF-8? ejb-jar enterprise-beans session descriptionReferenced Bean0/description ejb-nameENCBean0/ejb-name ejb-classorg.jboss.test.web.ejb.StatelessSessionBean/ejb-class homeorg.jboss.test.web.interfaces.StatelessSessionHome/home remoteorg.jboss.test.web.interfaces.StatelessSession/remote session-typeStateless/session-type transaction-typeContainer/transaction-type /session session descriptionReferenced Bean1/description ejb-nameENCBean1/ejb-name ejb-classorg.jboss.test.web.ejb.StatelessSessionBean/ejb-class homeorg.jboss.test.web.interfaces.StatelessSessionHome/home remoteorg.jboss.test.web.interfaces.StatelessSession/remote session-typeStateless/session-type transaction-typeContainer/transaction-type /session session descriptionA secured EJB/description ejb-nameSecuredEJB/ejb-name ejb-classorg.jboss.test.web.ejb.StatelessSessionBean/ejb-class homeorg.jboss.test.web.interfaces.StatelessSessionHome/home remoteorg.jboss.test.web.interfaces.StatelessSession/remote session-typeStateless/session-type transaction-typeContainer/transaction-type /session session descriptionAn EJB for testing in vm call optimization/description ejb-nameOptimizedEJB/ejb-name ejb-classorg.jboss.test.web.ejb.StatelessSessionBean2/ejb-class homeorg.jboss.test.web.interfaces.StatelessSessionHome/home remoteorg.jboss.test.web.interfaces.StatelessSession/remote session-typeStateless/session-type transaction-typeContainer/transaction-type /session /enterprise-beans /ejb-jar 1.1 jbosstest/src/resources/web/META-INF/jboss.xml Index: jboss.xml === ?xml version=1.0 encoding=UTF-8? jboss enterprise-beans session ejb-nameSecuredEJB/ejb-name jndi-namejbosstest/ejbs/SecuredEJB/jndi-name /session /enterprise-beans /jboss ___ 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 - New directory
User: starksm Date: 01/05/05 13:57:09 jbosstest/src/main/org/jboss/test/web - New directory ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/resources/web - New directory
User: starksm Date: 01/05/05 13:55:03 jbosstest/src/resources/web - New directory ___ 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/servlets - New directory
User: starksm Date: 01/05/05 13:57:55 jbosstest/src/main/org/jboss/test/web/servlets - New directory ___ 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/interfaces - New directory
User: starksm Date: 01/05/05 13:57:55 jbosstest/src/main/org/jboss/test/web/interfaces - New directory ___ 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/ejb - New directory
User: starksm Date: 01/05/05 13:57:55 jbosstest/src/main/org/jboss/test/web/ejb - New directory ___ 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 - New directory
User: starksm Date: 01/05/05 13:57:56 jbosstest/src/main/org/jboss/test/web/test - New directory ___ 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/ejb StatelessSessionBean.java StatelessSessionBean2.java
User: starksm Date: 01/05/05 13:59:35 Added: src/main/org/jboss/test/web/ejb StatelessSessionBean.java StatelessSessionBean2.java Log: Start of web container integration tests Revision ChangesPath 1.1 jbosstest/src/main/org/jboss/test/web/ejb/StatelessSessionBean.java Index: StatelessSessionBean.java === package org.jboss.test.web.ejb; import java.rmi.RemoteException; import java.security.Principal; import javax.ejb.CreateException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; import org.jboss.test.web.interfaces.ReferenceTest; /** A simple session bean for testing declarative security. @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class StatelessSessionBean implements SessionBean { private SessionContext sessionContext; public void ejbCreate() throws CreateException { System.out.println(StatelessSessionBean.ejbCreate() called); } public void ejbActivate() { System.out.println(StatelessSessionBean.ejbActivate() called); } public void ejbPassivate() { System.out.println(StatelessSessionBean.ejbPassivate() called); } public void ejbRemove() { System.out.println(StatelessSessionBean.ejbRemove() called); } public void setSessionContext(SessionContext context) { sessionContext = context; } public String echo(String arg) { System.out.println(StatelessSessionBean.echo, arg=+arg); Principal p = sessionContext.getCallerPrincipal(); System.out.println(StatelessSessionBean.echo, callerPrincipal=+p); boolean isCaller = sessionContext.isCallerInRole(EchoCaller); System.out.println(StatelessSessionBean.echo, isCallerInRole('EchoCaller')=+isCaller); if( isCaller == false ) throw new SecurityException(Caller does not have EchoCaller role); return arg; } public void noop(ReferenceTest test, boolean optimized) { System.out.println(StatelessSessionBean.noop); } } 1.1 jbosstest/src/main/org/jboss/test/web/ejb/StatelessSessionBean2.java Index: StatelessSessionBean2.java === package org.jboss.test.web.ejb; import java.rmi.RemoteException; import java.security.Principal; import javax.ejb.*; import javax.naming.InitialContext; import org.jboss.test.web.interfaces.ReferenceTest; /** A stateless SessionBean @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class StatelessSessionBean2 implements SessionBean { private SessionContext sessionContext; public void ejbCreate() throws RemoteException, CreateException { System.out.println(StatelessSessionBean2.ejbCreate() called); } public void ejbActivate() throws RemoteException { System.out.println(StatelessSessionBean2.ejbActivate() called); } public void ejbPassivate() throws RemoteException { System.out.println(StatelessSessionBean2.ejbPassivate() called); } public void ejbRemove() throws RemoteException { System.out.println(StatelessSessionBean2.ejbRemove() called); } public void setSessionContext(SessionContext context) throws RemoteException { sessionContext = context; } public String echo(String arg) { System.out.println(StatelessSessionBean2.echo, arg=+arg); return arg; } public void noop(ReferenceTest test, boolean optimized) { System.out.println(StatelessSessionBean2.noop); if( optimized test.getWasSerialized() == true ) throw new EJBException(Optimized call had serialized argument); } } ___ 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/05/05 13:59:35 Added: src/main/org/jboss/test/web/test TestWebIntegration.java Log: Start of web container integration tests Revision ChangesPath 1.1 jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java Index: TestWebIntegration.java === package org.jboss.test.web.test; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import junit.framework.TestCase; import junit.framework.TestSuite; import org.jboss.test.util.Deploy; /** Tests of servlet container integration into the JBoss server. This test requires than a web container be integrated into the JBoss server. The tests currently use the java.net.HttpURLConnection and associated http client and these do not return very good information on errors so if a failure occurs it is best to connect the webserver using a browser to look for additional error info. @author [EMAIL PROTECTED] @versioin $Revision: 1.1 $ */ public class TestWebIntegration extends TestCase { private static boolean setUp; private static boolean webServerAvailable; private static String baseURL; public TestWebIntegration(String name) { super(name); } /** Test for the availability of a local webserver and deploy the jbosstest-web.ear one time if a webserver is found. */ protected void setUp() throws Exception { if( setUp == true ) return; setUp = true; // Test for the existence of a web server Integer port = Integer.getInteger(web.port, 8080); baseURL = http://localhost:; + port; URL url = new URL(baseURL); try { HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); int responseCode = httpConn.getResponseCode(); if( responseCode != HttpURLConnection.HTTP_OK ) { System.out.println(baseURL+ did not result in HTTP OK, skipping tests); } else { System.out.println(Found webserver at: +baseURL); Deploy.deploy(jbosstest-web.ear); webServerAvailable = true; } } catch(Exception e) { System.out.println(No webserver found at: +baseURL); } } /** Access the http://localhost/jbosstest/ENCServlet */ public void testENCServlet() throws Exception { if( webServerAvailable == false ) return; URL url = new URL(baseURL+/jbosstest/ENCServlet); accessURL(url); } /** Access the http://localhost/jbosstest/EJBServlet */ public void testEJBServlet() throws Exception { if( webServerAvailable == false ) return; URL url = new URL(baseURL+/jbosstest/EJBServlet); accessURL(url); } /** Access the http://localhost/jbosstest/snoop.jsp */ public void testSnoopJSP() throws Exception { if( webServerAvailable == false ) return; URL url = new URL(baseURL+/jbosstest/snoop.jsp); accessURL(url); } private void accessURL(URL url) throws Exception { try { System.out.println(Connecting to: +url); HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); int responseCode = -1; String response = null; try { httpConn.connect(); responseCode = httpConn.getResponseCode(); response = httpConn.getResponseMessage(); } catch(Exception e) { System.out.println(Failed to connect to: +url); response = e.toString(); } System.out.println(responseCode=+responseCode+, response=+response); if( responseCode != HttpURLConnection.HTTP_OK ) { InputStream is = httpConn.getErrorStream(); if( is != null ) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); String line; while( (line = reader.readLine()) != null ) { System.out.println(line); } reader.close(); } fail(Access to: +url+ failed with responseCode=+responseCode); } } catch(IOException e)
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/web/servlets EJBServlet.java ENCServlet.java SecureEJBServlet.java SecureServlet.java
User: starksm Date: 01/05/05 13:59:35 Added: src/main/org/jboss/test/web/servlets EJBServlet.java ENCServlet.java SecureEJBServlet.java SecureServlet.java Log: Start of web container integration tests Revision ChangesPath 1.1 jbosstest/src/main/org/jboss/test/web/servlets/EJBServlet.java Index: EJBServlet.java === package org.jboss.test.web.servlets; import java.io.IOException; import java.io.PrintWriter; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import org.jboss.test.web.interfaces.ReferenceTest; import org.jboss.test.web.interfaces.StatelessSession; import org.jboss.test.web.interfaces.StatelessSessionHome; /** A servlet that accesses an EJB. @author [EMAIL PROTECTED] @version $Revision: 1.1 $ */ public class EJBServlet extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { InitialContext ctx = new InitialContext(); StatelessSessionHome home = (StatelessSessionHome) ctx.lookup(java:comp/env/ejb/OptimizedEJB); StatelessSession bean = home.create(); bean.noop(new ReferenceTest(), true); } catch(Exception e) { throw new ServletException(Failed to call OptimizedEJB, e); } response.setContentType(text/html); PrintWriter out = response.getWriter(); out.println(html); out.println(headtitleEJBServlet/title/head); out.println(bodyTests passed/body); out.println(/html); out.close(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } } 1.1 jbosstest/src/main/org/jboss/test/web/servlets/ENCServlet.java Index: ENCServlet.java === package org.jboss.test.web.servlets; import java.io.IOException; import java.io.PrintWriter; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; /** * * @author [EMAIL PROTECTED] * @version $Revision: 1.1 $ */ public class ENCServlet extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { testENC(); response.setContentType(text/html); PrintWriter out = response.getWriter(); out.println(html); out.println(headtitleENCServlet/title/head); out.println(bodyTests passed/body); out.println(/html); out.close(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } private void testENC() throws ServletException { try { // Obtain the enterprise beans environment naming context. Context initCtx = new InitialContext(); Context myEnv = (Context) initCtx.lookup(java:comp/env); testEjbRefs(initCtx, myEnv); testJdbcDataSource(initCtx, myEnv); testMail(initCtx, myEnv); testJMS(initCtx, myEnv); testEnvEntries(initCtx, myEnv); } catch(NamingException e) { e.printStackTrace(); throw new ServletException(ENC tests failed, e); } } private void testEnvEntries(Context initCtx, Context myEnv) throws NamingException { //
Re: [JBoss-dev] RFC: Add isolation level attribute in jboss.xml orjaws.xml?
Yes, please go ahead and implement this -- Juha On Sat, 5 May 2001, danch wrote: Does anyone have opinions on whether this would be a good feature or not? The 1.1 spec does not specify how isolation levels should be handled, except for BMT session beans, and by saying/implying that beans can call resource manager specific APIs to set it themselves (carefully). If this seems like a good idea, should this setting be in jboss.xml (and cover BMP and CMP entities as well as sessions), or in jaws.xml (covering _only_ CMP entities, since others are free to call the resource manager's APIs)? thanks, danch ___ 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] [ jboss-Feature Requests-421723 ] Add control of tx isolation levels
Feature Requests item #421723, was updated on 2001-05-05 14:55 You can respond by visiting: http://sourceforge.net/tracker/?func=detailatid=376688aid=421723group_id=22866 Category: None Group: Next Release (example) Status: Open Priority: 5 Submitted By: Dan Christopherson (danch) Assigned to: Dan Christopherson (danch) Summary: Add control of tx isolation levels Initial Comment: This will effect at least JAWS. Should this be an option for BMP and Session beans? These are allowed to call setIsolationLevel APIs on individual resource managers, as well. -- You can respond by visiting: http://sourceforge.net/tracker/?func=detailatid=376688aid=421723group_id=22866 ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/build build.xml
User: starksm Date: 01/05/05 18:11:45 Modified:src/build build.xml Log: Add the JMS ra tests Revision ChangesPath 1.27 +5 -0 jbosstest/src/build/build.xml Index: build.xml === RCS file: /cvsroot/jboss/jbosstest/src/build/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- build.xml 2001/05/05 20:54:05 1.26 +++ build.xml 2001/05/06 01:11:45 1.27 @@ -94,6 +94,7 @@ antcall target=naming-subproject / antcall target=security-subproject / antcall target=web-subproject / +antcall target=jmsra-subproject / /target target name=bank-subproject depends=prepare @@ -163,6 +164,10 @@ target name=web-subproject depends=prepare !-- Build the web integration testsuite -- ant antfile=src/build/subprojects/build-web.xml / +/target +target name=jmsra-subproject depends=prepare +!-- JMS ra tests -- +ant antfile=src/build/subprojects/build-jmsra.xml / /target !-- === -- ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] jboss daily test results
= ==THIS IS AN AUTOMATED EMAIL - SEE http://www.lubega.com FOR DETAILS= = ?xml version=1.0 encoding=UTF-8? JBoss daily test results SUMMARY Number of tests run: 61 Successful tests: 54 Errors:3 Failures: 4 DETAILS OF ERRORS Suite: org.jboss.test.cts.test.AllJUnitTests Test:testRemoveSessionObject Type:failure Exception: junit.framework.AssertionFailedError Message: [EJB 1.1, p42] Expected 'RemoveException', detail:java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Could not activate; nested exception is: java.io.FileNotFoundException: [EMAIL PROTECTED] (No such file or directory); nested exception is: java.rmi.NoSuchObjectException: Could not activate; nested exception is: java.io.FileNotFoundException: [EMAIL PROTECTED] (No such file or directory) Stack Trace: junit.framework.AssertionFailedError: [EJB 1.1, p42] Expected 'RemoveException', detail:java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Could not activate; nested exception is: java.io.FileNotFoundException: [EMAIL PROTECTED] (No such file or directory); nested exception is: java.rmi.NoSuchObjectException: Could not activate; nested exception is: java.io.FileNotFoundException: [EMAIL PROTECTED] (No such file or directory) at junit.framework.Assert.fail(Assert.java:143) at org.jboss.test.cts.test.StatefulSessionTest.testRemoveSessionObject(StatefulSessionTest.java:187) 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:202) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:326) - 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:466) 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:202) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:326) - 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
[JBoss-dev] CVS update: jbosstest/src/build build.xml
User: starksm Date: 01/05/05 19:36:46 Modified:src/build build.xml Log: Move the jar mkdir tasks to the prepare target Revision ChangesPath 1.28 +2 -2 jbosstest/src/build/build.xml Index: build.xml === RCS file: /cvsroot/jboss/jbosstest/src/build/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- build.xml 2001/05/06 01:11:45 1.27 +++ build.xml 2001/05/06 02:36:46 1.28 @@ -53,6 +53,8 @@ !-- === -- target name=prepare mkdir dir=${build.dir}/ +mkdir dir=${build.lib.dir}/ +mkdir dir=${build.deploy.dir}/ /target !-- === -- @@ -73,8 +75,6 @@ !-- Creates the jar archives-- !-- === -- target name=jar depends=compile -mkdir dir=${build.lib.dir}/ -mkdir dir=${build.deploy.dir}/ antcall target=bank-subproject / antcall target=hello-subproject / ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RFC: Add isolation level attribute in jboss.xml or jaws.xml?
danch wrote: Does anyone have opinions on whether this would be a good feature or not? The 1.1 spec does not specify how isolation levels should be handled, except for BMT session beans, and by saying/implying that beans can call resource manager specific APIs to set it themselves (carefully). If this seems like a good idea, should this setting be in jboss.xml (and cover BMP and CMP entities as well as sessions), or in jaws.xml (covering _only_ CMP entities, since others are free to call the resource manager's APIs)? What do mean by cover BMP and CMP entities as well as sessions? This can only apply to JDBC connections, right? Do you propose to set the isolation level when a connection handle is obtained by the bean? If so, this should probably be implemented using the same mechanism I have in mind to implement beans hanging onto connection handles across transactions. JBossCX defines the JBossConnectionListener interface for this purpose, although it is not currently used. The idea is that when a resource adapter gives out a connection handle, the app server is notified so that it can make sure it is participating in the correct transaction. It would be easy to extend that to any transaction-specific setup we wanted to do. Toby. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development