6 Replies Latest reply on Mar 25, 2002 11:13 AM by adrian.brock

    JBoss 3.0 beta doesn't deploy more than 64 entity beans

    vrud

      Hi all. On your site appeared the link to JBoss beta with Tomcat. It it's very temptating to use, but at the same time JBoss engine has changed. I tried to deploy our application we had bean successfully developing many monthes with JBoss alpha version. I found out that betta's entity beans limit is 64. It is probably of some xml parser or something else. Anyway, I put the code that generates beans, use the constant there to set the beans number.
      Thanks in advance.

      Code:
      import java.io.*;
      public class M {
      public static void main(String[] arg) throws IOException {
      String pattern = "BEAN_NAME",
      ejbHead = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'><ejb-jar><enterprise-beans>",
      ejbEnd = "</enterprise-beans><assembly-descriptor/></ejb-jar>",
      ejbContent = "<ejb-name>BEAN_NAME</ejb-name><local-home>BEAN_NAMELocalHome</local-home>BEAN_NAMELocal<ejb-class>BEAN_NAMEBean</ejb-class><persistence-type>Bean</persistence-type><prim-key-class>java.lang.String</prim-key-class>False",
      jbossHead = "<?xml version=\"1.0\" encoding=\"Cp1251\"?>false<container-configurations/><resource-managers/><enterprise-beans>",
      jbossEnd = "</enterprise-beans>",
      jbossContent = "<ejb-name>BEAN_NAME</ejb-name><local-jndi-name>java/comp/env/ejb/BEAN_NAME</local-jndi-name><configuration-name></configuration-name>",
      home = "import javax.ejb.EJBLocalHome;import javax.ejb.EJBHome;import java.util.*;public interface BEAN_NAMELocalHome extends EJBLocalHome { public BEAN_NAMELocal create(java.lang.String key); public BEAN_NAMELocal findByPrimaryKey(java.lang.String key); }",
      remote = "import javax.ejb.EJBLocalObject; public interface BEAN_NAMELocal extends EJBLocalObject {}",
      bean = "import javax.ejb.EntityContext; import javax.ejb.EntityBean; public class BEAN_NAMEBean implements EntityBean { public java.lang.String ejbCreate(java.lang.String key) { return key; } public void ejbPostCreate(java.lang.String key) {} public void ejbRemove() {} public void ejbLoad() {} public void ejbStore() {} public java.lang.String ejbFindByPrimaryKey(java.lang.String key) { return key; } public void ejbActivate() {} public void ejbPassivate() {} public void ejbPostCreate() {} public void setEntityContext(EntityContext ec) {} public void unsetEntityContext() {} }";

      int MAX_BEANS = 70;
      java.util.regex.Pattern p = java.util.regex.Pattern.compile(pattern);
      java.util.regex.Matcher m;
      File dir = new File("src/"); dir.mkdirs();
      FileWriter ejb = new FileWriter("src/" + "ejb-jar.xml"),
      jboss = new FileWriter("src/" + "jboss.xml");


      ejb.write(ejbHead); jboss.write(jbossHead);
      for(int i=0; i<MAX_BEANS; i++) {
      String beanName = "Bean" + i;
      m = p.matcher(ejbContent); ejb.write(m.replaceAll(beanName));
      m = p.matcher(jbossContent); jboss.write(m.replaceAll(beanName));
      FileWriter homeFW = new FileWriter("src/" + beanName + "LocalHome.java");
      FileWriter remoteFW = new FileWriter("src/" + beanName + "Local.java");
      FileWriter beanFW = new FileWriter("src/" + beanName + "Bean.java");
      m = p.matcher(home); homeFW.write(m.replaceAll(beanName)); homeFW.close();
      m = p.matcher(remote); remoteFW.write(m.replaceAll(beanName)); remoteFW.close();
      m = p.matcher(bean); beanFW.write(m.replaceAll(beanName)); beanFW.close();
      }

      ejb.write(ejbEnd); jboss.write(jbossEnd);
      ejb.close(); jboss.close();
      }
      }

        • 1. Re: JBoss 3.0 beta doesn't deploy more than 64 entity beans

          Hi,

          I've not had time to test this myself.
          What error are you getting in log/server.log

          This will be a useful addtion to the testsuite,
          say about 1000 beans :-)

          64 is a suspicous number 2^6?

          Regards,
          Adrian

          • 2. Re: JBoss 3.0 beta doesn't deploy more than 64 entity beans
            vrud

            2002-03-23 22:09:57,881 INFO [org.jboss.system.Server] JBoss (MX MicroKernel) [3.0.0beta Date:200202210220] Started in 0m:52s:626ms
            2002-03-23 22:10:53,891 INFO [org.jboss.deployment.MainDeployer] Deploying: file:/C:/jboss-3.0.0beta/deploy/ME.jar
            2002-03-23 22:10:54,422 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean0
            2002-03-23 22:10:55,373 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean1
            2002-03-23 22:10:55,384 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean2
            2002-03-23 22:10:55,384 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean3
            .....
            2002-03-23 22:10:55,614 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean66
            2002-03-23 22:10:55,614 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean67
            2002-03-23 22:10:55,614 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean68
            2002-03-23 22:10:55,624 INFO [org.jboss.ejb.EJBDeployer] Deploying Bean69
            2002-03-23 22:10:55,844 ERROR [org.jboss.deployment.MainDeployer] could not deploy :file:/C:/jboss-3.0.0beta/deploy/ME.jar
            java.lang.NoClassDefFoundError: $Proxy2
            at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
            at org.jboss.system.ServiceController.getServiceProxy(ServiceController.java:613)
            at org.jboss.system.ServiceController.create(ServiceController.java:244)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.InflatableMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
            at $Proxy1.create(Unknown Source)
            at org.jboss.ejb.Application.create(Application.java:230)
            at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:433)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:413)
            at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:272)
            at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
            at java.lang.Thread.run(Unknown Source)
            2002-03-23 22:10:55,854 ERROR [org.jboss.deployment.MainDeployer] Couldn't deploy URL file:/C:/jboss-3.0.0beta/deploy/ME.jar
            org.jboss.deployment.DeploymentException: Could not deploy: file:/C:/jboss-3.0.0beta/deploy/ME.jar; - nested throwable is: java.lang.NoClassDefFoundError: $Proxy2
            java.lang.NoClassDefFoundError: $Proxy2
            at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
            at org.jboss.system.ServiceController.getServiceProxy(ServiceController.java:613)
            at org.jboss.system.ServiceController.create(ServiceController.java:244)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.InflatableMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
            at $Proxy1.create(Unknown Source)
            at org.jboss.ejb.Application.create(Application.java:230)
            at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:433)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:413)
            at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:272)
            at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
            at java.lang.Thread.run(Unknown Source)
            org.jboss.deployment.DeploymentException: Could not deploy: file:/C:/jboss-3.0.0beta/deploy/ME.jar; - nested throwable is: java.lang.NoClassDefFoundError: $Proxy2
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:413)
            at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:272)
            at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
            at java.lang.Thread.run(Unknown Source)
            Caused by: java.lang.NoClassDefFoundError: $Proxy2
            at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
            at org.jboss.system.ServiceController.getServiceProxy(ServiceController.java:613)
            at org.jboss.system.ServiceController.create(ServiceController.java:244)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.InflatableMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
            at $Proxy1.create(Unknown Source)
            at org.jboss.ejb.Application.create(Application.java:230)
            at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:433)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
            ... 4 more

            • 3. Re: JBoss 3.0 beta doesn't deploy more than 64 entity beans
              vrud

              This is the jar with 70 entity beans, generated by prev. code. It doesn't deploy on my comp, Win2K, 0.5Gb, JBoss beta with Tomcat,
              Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
              Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

              • 4. Re: JBoss 3.0 beta doesn't deploy more than 64 entity beans

                That's very weird.

                I'll have to try this with beta2. The error is in
                the jsr77 processing of org.jboss.ejb.Application.

                Application doesn't exist anymore in beta2 it is
                replaced with EjbModule.
                The jsr77 has also been reworked
                But that doesn't really explain the error I can here?

                Regards,
                Adrian

                • 5. Re: JBoss 3.0 beta doesn't deploy more than 64 entity beans

                  I think your problem is java1.4

                  There is a bug in jmxri.jar that causes problems with
                  java 1.4

                  I've tried your jar with latest CVS and it works fine.
                  Latest CVS uses JBossMX instead of jmxri.jar which
                  doesn't have this bug.

                  15:59:06,841 INFO [Server] JBoss (MX MicroKernel) [3.0.0beta2 Date:200203241203] Started in 0m:34s:
                  240ms
                  15:59:46,958 INFO [MainDeployer] Starting deployment of package: file:/D:/cygwin/home/ejort/jboss/j
                  boss-all/build/output/jboss-3.0.0beta2/server/default/deploy/ME.jar
                  15:59:47,519 INFO [EjbModule] Creating
                  15:59:47,549 INFO [EjbModule] Deploying Bean0
                  15:59:47,920 INFO [EjbModule] Deploying Bean1
                  15:59:47,940 INFO [EjbModule] Deploying Bean2
                  15:59:47,950 INFO [EjbModule] Deploying Bean3
                  15:59:47,960 INFO [EjbModule] Deploying Bean4
                  15:59:47,970 INFO [EjbModule] Deploying Bean5
                  15:59:47,980 INFO [EjbModule] Deploying Bean6
                  15:59:47,990 INFO [EjbModule] Deploying Bean7
                  15:59:48,000 INFO [EjbModule] Deploying Bean8
                  15:59:48,010 INFO [EjbModule] Deploying Bean9
                  15:59:48,030 INFO [EjbModule] Deploying Bean10
                  15:59:48,040 INFO [EjbModule] Deploying Bean11
                  15:59:48,060 INFO [EjbModule] Deploying Bean12
                  15:59:48,070 INFO [EjbModule] Deploying Bean13
                  15:59:48,080 INFO [EjbModule] Deploying Bean14
                  15:59:48,100 INFO [EjbModule] Deploying Bean15
                  15:59:48,110 INFO [EjbModule] Deploying Bean16
                  15:59:48,120 INFO [EjbModule] Deploying Bean17
                  15:59:48,130 INFO [EjbModule] Deploying Bean18
                  15:59:48,140 INFO [EjbModule] Deploying Bean19
                  15:59:48,150 INFO [EjbModule] Deploying Bean20
                  15:59:48,160 INFO [EjbModule] Deploying Bean21
                  15:59:48,170 INFO [EjbModule] Deploying Bean22
                  15:59:48,190 INFO [EjbModule] Deploying Bean23
                  15:59:48,200 INFO [EjbModule] Deploying Bean24
                  15:59:48,210 INFO [EjbModule] Deploying Bean25
                  15:59:48,220 INFO [EjbModule] Deploying Bean26
                  15:59:48,230 INFO [EjbModule] Deploying Bean27
                  15:59:48,240 INFO [EjbModule] Deploying Bean28
                  15:59:48,250 INFO [EjbModule] Deploying Bean29
                  15:59:48,270 INFO [EjbModule] Deploying Bean30
                  15:59:48,280 INFO [EjbModule] Deploying Bean31
                  15:59:48,290 INFO [EjbModule] Deploying Bean32
                  15:59:48,300 INFO [EjbModule] Deploying Bean33
                  15:59:48,320 INFO [EjbModule] Deploying Bean34
                  15:59:48,330 INFO [EjbModule] Deploying Bean35
                  15:59:48,340 INFO [EjbModule] Deploying Bean36
                  15:59:48,350 INFO [EjbModule] Deploying Bean37
                  15:59:48,360 INFO [EjbModule] Deploying Bean38
                  15:59:48,370 INFO [EjbModule] Deploying Bean39
                  15:59:48,410 INFO [EjbModule] Deploying Bean40
                  15:59:48,420 INFO [EjbModule] Deploying Bean41
                  15:59:48,430 INFO [EjbModule] Deploying Bean42
                  15:59:48,440 INFO [EjbModule] Deploying Bean43
                  15:59:48,460 INFO [EjbModule] Deploying Bean44
                  15:59:48,470 INFO [EjbModule] Deploying Bean45
                  15:59:48,480 INFO [EjbModule] Deploying Bean46
                  15:59:48,490 INFO [EjbModule] Deploying Bean47
                  15:59:48,500 INFO [EjbModule] Deploying Bean48
                  15:59:48,510 INFO [EjbModule] Deploying Bean49
                  15:59:48,510 INFO [EjbModule] Deploying Bean50
                  15:59:48,521 INFO [EjbModule] Deploying Bean51
                  15:59:48,531 INFO [EjbModule] Deploying Bean52
                  15:59:48,531 INFO [EjbModule] Deploying Bean53
                  15:59:48,541 INFO [EjbModule] Deploying Bean54
                  15:59:48,551 INFO [EjbModule] Deploying Bean55
                  15:59:48,551 INFO [EjbModule] Deploying Bean56
                  15:59:48,561 INFO [EjbModule] Deploying Bean57
                  15:59:48,571 INFO [EjbModule] Deploying Bean58
                  15:59:48,571 INFO [EjbModule] Deploying Bean59
                  15:59:48,581 INFO [EjbModule] Deploying Bean60
                  15:59:48,591 INFO [EjbModule] Deploying Bean61
                  15:59:48,591 INFO [EjbModule] Deploying Bean62
                  15:59:48,601 INFO [EjbModule] Deploying Bean63
                  15:59:48,611 INFO [EjbModule] Deploying Bean64
                  15:59:48,611 INFO [EjbModule] Deploying Bean65
                  15:59:48,621 INFO [EjbModule] Deploying Bean66
                  15:59:48,631 INFO [EjbModule] Deploying Bean67
                  15:59:48,631 INFO [EjbModule] Deploying Bean68
                  15:59:48,641 INFO [EjbModule] Deploying Bean69
                  15:59:50,413 INFO [EjbModule] Created
                  15:59:50,423 INFO [EjbModule] Starting
                  15:59:50,453 INFO [EnterpriseContextCachePolicy] Cache policy scheduler started
                  15:59:50,994 INFO [EjbModule] Started
                  15:59:51,064 INFO [MainDeployer] Successfully completed deployment of package: file:/D:/cygwin/home
                  /ejort/jboss/jboss-all/build/output/jboss-3.0.0beta2/server/default/deploy/ME.jar

                  Regards,
                  Adrian

                  • 6. Re: JBoss 3.0 beta doesn't deploy more than 64 entity beans

                    I'll add that test for 1000 beans to the testsuite :-)

                    Regards,
                    Adrian