Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将beans.xml文件放入META-INF目录时的OutOfMemory_Java_Memory Management_Glassfish - Fatal编程技术网

Java 将beans.xml文件放入META-INF目录时的OutOfMemory

Java 将beans.xml文件放入META-INF目录时的OutOfMemory,java,memory-management,glassfish,Java,Memory Management,Glassfish,我有一个maven驱动的应用程序,它在glassfish中运行bean。现在我想注入bean,因此需要一个beans.xml。但是,当我将文件放入META-INF目录时,在部署时会出现错误: Information: WELD-000900 SNAPSHOT Apr 27, 2014 10:49:07 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry Warnung: Error while trying to load Be

我有一个maven驱动的应用程序,它在glassfish中运行bean。现在我想注入bean,因此需要一个beans.xml。但是,当我将文件放入META-INF目录时,在部署时会出现错误:

Information: WELD-000900 SNAPSHOT
Apr 27, 2014 10:49:07 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.parser.JAXPParser : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:07 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.parser.XSOMParser$1 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:08 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.parser.XSOMParser : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:08 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.ComponentNameFunction : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:15 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.ContextClassloaderLocal$1 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:25 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.ContextClassloaderLocal : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:26 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.DeferedCollection$1 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:26 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.DeferedCollection : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:27 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.DomAnnotationParserFactory$1 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:27 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.DomAnnotationParserFactory$AnnotationParserImpl : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:33 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.DomAnnotationParserFactory : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:43 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.NameGetter : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:49:54 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.SimpleTypeSet : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:50:06 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.TypeClosure : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:50:16 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.TypeSet$1 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:50:27 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.TypeSet$2 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:50:38 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.TypeSet : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:50:49 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.util.XSFunctionFilter : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:50:59 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.visitor.XSTermFunctionWithParam : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:51:10 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.visitor.XSWildcardVisitor : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:51:21 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
Warnung: Error while trying to load Bean Class com.sun.xml.internal.xsom.XmlString$1 : java.lang.OutOfMemoryError: PermGen space
Apr 27, 2014 10:51:33 AM org.glassfish.weld.BeanDeploymentArchiveImpl handleEntry
我已经尝试增加可用内存,但是这没有帮助:

export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=1G"
有什么想法吗

以下是POM,本项目中有几个模块:


应该有交叉注入,这会导致bean中无限的bean注入。如果使用另一个DI而不是weld,会发生什么。也许这是一个特定于焊接的bug?你确定烫发空间比堆大是个好主意吗?实际上,我认为perm空间是堆的一部分,但不确定这一点。我认为,512M堆对于现代应用服务器来说并不多。也许你可以在这里多放一点。@EREN可以删除所有注入注释,所以不应该有任何循环注入发生。我认为它们都是警告。你有什么特殊情况吗?