4 Replies Latest reply on Apr 12, 2012 11:05 AM by kasali45

    New Embedded Prototype

    alrubinger

      I've committed new jboss-embedded projects:

      http://anonsvn.jboss.org/repos/jbossas/projects/embedded/trunk/

      This is defined by:

      https://jira.jboss.org/jira/browse/EMB-17

      Included in this initial setup is a prototype of JBoss Embedded AS distribution which packages up AS and a few Embedded-specific classes into a single JAR, and successfully starts the AS Bootstrap.

      Some points:

      * Tangential to this is refactoring of the bootstrap project as defined by JBBOOT-4, where the common server locations (JBOSS_HOME, deploy, lib, etc) must be represented by VFS instead of java.io.File. This is required to get a server contained within a JAR.

      * Embedded should really have no common server locations - it's got all of its binaries on the classpath and should be able to boot straight from there.

      * I had to introduce a NoOpClassLoadingFactory to ignore any roots defined by classloading elements within the AS bootstrap. Due to the repackaging, these roots are not (and shouldn't be) found in the form they're listed. This furthers the notion that Embedded runs within a host ClassLoader.

      S,
      ALR

        • 1. Re: New Embedded Prototype
          starksm64

          I downloaded it and ran the package target and the test is failing with an OutOfMemoryError on some vfs copy:

           <testcase classname="org.jboss.embedded.test.server.ServerUnitTestCase" time="1.562" name="testServerStart">
           <error type="java.lang.OutOfMemoryError" message="Java heap space">java.lang.OutOfMemoryError: Java heap space
           at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:95)
           at org.jboss.virtual.VFSUtils.copyStream(VFSUtils.java:773)
           at org.jboss.virtual.VFSUtils.copyStreamAndClose(VFSUtils.java:733)
           at org.jboss.virtual.plugins.context.zip.ZipEntryContext.findEntry(ZipEntryContext.java:308)
           at org.jboss.virtual.plugins.context.zip.ZipEntryContext.createZipSource(ZipEntryContext.java:287)
           at org.jboss.virtual.plugins.context.zip.ZipEntryContext.init(ZipEntryContext.java:217)
           at org.jboss.virtual.plugins.context.zip.ZipEntryContext.&lt;init&gt;(ZipEntryContext.java:148)
           at org.jboss.virtual.plugins.context.zip.ZipEntryContext.&lt;init&gt;(ZipEntryContext.java:133)
           at org.jboss.virtual.plugins.context.zip.ZipEntryContextFactory.getVFS(ZipEntryContextFactory.java:71)
           at org.jboss.virtual.VFS.getVFS(VFS.java:157)
           at org.jboss.virtual.VFS.getRoot(VFS.java:172)
           at org.jboss.virtual.spi.cache.helpers.NoopVFSCache.getFile(NoopVFSCache.java:48)
           at org.jboss.virtual.VFS.getCachedFile(VFS.java:191)
           at org.jboss.bootstrap.BaseServerConfig.getFile(BaseServerConfig.java:740)
           at org.jboss.bootstrap.BaseServerConfig.&lt;init&gt;(BaseServerConfig.java:111)
           at org.jboss.bootstrap.AbstractServerImpl.doInit(AbstractServerImpl.java:170)
           at org.jboss.bootstrap.AbstractServerImpl.init(AbstractServerImpl.java:153)
           at org.jboss.embedded.server.JBossEmbeddedAS.&lt;init&gt;(JBossEmbeddedAS.java:123)
           at org.jboss.embedded.test.server.ServerUnitTestCase.testServerStart(ServerUnitTestCase.java:39)
          ...
          </error>
          



          • 2. Re: New Embedded Prototype
            alesj

            Along with adding some more memory,
            it's probably useful to set these two vfs config options:
            -Djboss.vfs.cache=org.jboss.virtual.plugins.cache.TimedVFSCache
            -Djboss.vfs.forceCopy=true

            • 3. Re: New Embedded Prototype
              alrubinger

              Should be fixed now.

              http://jboss.hudson.alrubinger.com/job/jboss-embedded/5/

              Surefire plugin supports only 1 argLine, so values were getting overridden. Oddly enough my local machine doesn't need this configuration.

              S,
              ALR

              • 4. Re: New Embedded Prototype
                kasali45

                thanks for the info