Geronimo
  1. Geronimo
  2. GERONIMO-4275

PCEnhancer java.lang.OutOfMemoryError: Java heap space

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.0.3, 2.1.3, 2.1.4, 2.2
    • Component/s: persistence
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      Sun jdk 1.5
      jtds driver 1.2.2 (MSSQL)
      Windows XP
      -Xms1024m -Xmx1024m
      -XX:MaxPermSize=256m

      Description

      I got this error when I am deploying application:

      02 Sep 2008 10:11:38,046 INFO [RMI TCP Connection(14)-192.168.1.122] (OpenEJB.startup.java:70) - Assembling app: C:\Documents and Settings\xxx\Local Settings\Temp\geronimo-deploymentUtil27842.jar
      257594 xxx WARN [RMI TCP Connection(14)-192.168.1.122] openjpa.Enhance - An exception was thrown while attempting to perform class file transformation on "net/.../yyy":
      java.lang.OutOfMemoryError: Java heap space
      at java.util.ArrayList.ensureCapacity(ArrayList.java:169)
      at java.util.ArrayList.add(ArrayList.java:351)
      at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:676)
      at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:575)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:500)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:302)
      at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:241)
      at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:212)
      at org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransformer.java:127)
      at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.transform(PersistenceProviderImpl.java:176)
      at org.apache.geronimo.persistence.TransformerWrapper.transform(TransformerWrapper.java:43)
      at org.apache.geronimo.transformer.TransformerCollection.transform(TransformerCollection.java:43)
      at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at org.apache.geronimo.kernel.classloader.JarFileClassLoader.access$200(JarFileClassLoader.java:52)
      at org.apache.geronimo.kernel.classloader.JarFileClassLoader$6.run(JarFileClassLoader.java:308)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.geronimo.kernel.classloader.JarFileClassLoader.findClass(JarFileClassLoader.java:260)
      at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimizedClass(MultiParentClassLoader.java:430)
      at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:278)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
      at java.lang.Class.privateGetPublicMethods(Class.java:2519)
      at java.lang.Class.getMethods(Class.java:1406)
      at org.apache.openejb.assembler.classic.InterceptorBindingBuilder.build(InterceptorBindingBuilder.java:185)
      at org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:54)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:489)

      There is nothing special in relation @OneToMany @ManyToOne (Hibernate tool generated mappings for two tables - In database there is relation on this two tables):

      First class has this property:

      private Set<yyy> yyy= new HashSet<yyy>(0);

      private Set<CustomerAccount> customerAccounts = new HashSet<CustomerAccount>(0);
      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "xxx")
      public Set<yyy> getYyys()

      { return this.yyy; }

      public void setYys(Set<yyy> yyys)

      { this.yyys = yyy; }

      Second class has this propertie:

      private Xxx xxx;

      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumns(

      { @JoinColumn(name = "aaa", referencedColumnName = "aaa"), @JoinColumn(name = "bbb", referencedColumnName = "bbb") }

      )
      public Customer getXxx()

      { return this.xxx; }

      public void setXxx(XXX xxx)

      { this.xxx= xxx; }

        Activity

        Hide
        Ljuba added a comment -

        workaround to this issue:

        change first letter of one of this two classes to change their alphabetical order in package.

        Show
        Ljuba added a comment - workaround to this issue: change first letter of one of this two classes to change their alphabetical order in package.
        Hide
        Ljuba added a comment -

        Problem doesn't exist when we replace ...\geronimo-tomcat6-javaee5-2.1.2\repository\org\apache\openjpa\openjpa\1.0.2\openjpa-1.0.2.jar with:

        openjpa-1.1.0.jar (renamed to openjpa-1.0.2.jar)
        openjpa-1.2.0.jar (renamed to openjpa-1.0.2.jar)

        but still exist with:

        openjpa-1.0.3.jar (renamed to openjpa-1.0.2.jar)

        Show
        Ljuba added a comment - Problem doesn't exist when we replace ...\geronimo-tomcat6-javaee5-2.1.2\repository\org\apache\openjpa\openjpa\1.0.2\openjpa-1.0.2.jar with: openjpa-1.1.0.jar (renamed to openjpa-1.0.2.jar) openjpa-1.2.0.jar (renamed to openjpa-1.0.2.jar) but still exist with: openjpa-1.0.3.jar (renamed to openjpa-1.0.2.jar)
        Hide
        Kevan Miller added a comment -

        David,
        Heh. Nice work! How'd you figure out the naming work-around? Great stuff testing with newer versions of OpenJPA!

        We're ramping up a 2.1.3 release. Will need to check with Donald if he thinks we can include this fix. There's of course possibility that we'll run into some TCK problems...

        FYI, our preferred mechanism for updating the version of OpenJPA would be:

        add the new openjpa version to the servers repository. e.g.

        repository\org\apache\openjpa\openjpa\1.2.0\openjpa-1.2.0.jar

        Then configure geronimo to use this new version. i.e. add the following to var/config/artifact_aliases.properties

        org.apache.openjpa/openjpa/1.0.2/jar=org.apache.openjpa/openjpa/1.2.0/jar

        Show
        Kevan Miller added a comment - David, Heh. Nice work! How'd you figure out the naming work-around? Great stuff testing with newer versions of OpenJPA! We're ramping up a 2.1.3 release. Will need to check with Donald if he thinks we can include this fix. There's of course possibility that we'll run into some TCK problems... FYI, our preferred mechanism for updating the version of OpenJPA would be: add the new openjpa version to the servers repository. e.g. repository\org\apache\openjpa\openjpa\1.2.0\openjpa-1.2.0.jar Then configure geronimo to use this new version. i.e. add the following to var/config/artifact_aliases.properties org.apache.openjpa/openjpa/1.0.2/jar=org.apache.openjpa/openjpa/1.2.0/jar
        Hide
        Donald Woods added a comment -

        Upgraded to OpenJPA 1.2.0 using GERONIMO-4278 -
        https://issues.apache.org/jira/browse/GERONIMO-4278
        which should be in this afternoon's or tomorrows (20080904) automated builds for 2.1.4-SNAPSHOT -
        http://people.apache.org/builds/geronimo/server/binaries/2.1/

        Thanks for debugging and reporting this problem.

        Show
        Donald Woods added a comment - Upgraded to OpenJPA 1.2.0 using GERONIMO-4278 - https://issues.apache.org/jira/browse/GERONIMO-4278 which should be in this afternoon's or tomorrows (20080904) automated builds for 2.1.4-SNAPSHOT - http://people.apache.org/builds/geronimo/server/binaries/2.1/ Thanks for debugging and reporting this problem.
        Hide
        Ljuba added a comment -

        We have few mapped relations with one class in our application which work fine, but for some reason we had problems with one class linked with. This exception occurs when is ...Home.java of problematic class (generated by Eclipse Hibernate Tool) is deployed with other code.

        All classes in that package has similar names started with same prefix.

        Problematic class has same type of relations and almost everything has same.

        Naming work-around was last solution.

        Thanks for explanation how to update the version of OpenJPA, and fast upgrade,
        David

        Show
        Ljuba added a comment - We have few mapped relations with one class in our application which work fine, but for some reason we had problems with one class linked with. This exception occurs when is ...Home.java of problematic class (generated by Eclipse Hibernate Tool) is deployed with other code. All classes in that package has similar names started with same prefix. Problematic class has same type of relations and almost everything has same. Naming work-around was last solution. Thanks for explanation how to update the version of OpenJPA, and fast upgrade, David

          People

          • Assignee:
            Unassigned
            Reporter:
            Ljuba
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development