Kevan Miller wrote:

On Sep 11, 2007, at 4:13 PM, David Blevins wrote:


The exception you should have gotten was:

 - - - - - - - -
Jar Failed validaton: pprsrv-ejb-1.2.jar
FAIL - YourBeanName - Invalid PostConstruct arguments: construct(InvocationContext)
 - - - - - - - -

Just added this page for you: http://cwiki.apache.org/OPENEJB/callbacks.html

David, thanks. Now I see that I've mix up ejb annotation with interceptor annotation. Now my application deploy without errors :)



Caused by: org.apache.geronimo.common.DeploymentException: Jar failed validation: pprsrv-ejb-1.2.jarERROR ... null: Cannot validate jar: Java heap space at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.getEjbJarInfo(EjbModuleBuilder.java:528) at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.initContext(EjbModuleBuilder.java:437) at org.apache.geronimo.openejb.deployment.EjbModuleBuilder$$FastClassByCGLIB$$cd80af20.invoke(<generated>)
    at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830)

This should not happen. Kevan, any suggestions on better memory settings?

Strange. Marcin, how big is your app?

Have you tried increasing your max heap space (e.g. -Xmx128m )?

Although possible, I find it a bit hard to believe that 1) your app is large enough to have you at the very limit of your heap space and 2) that adding @PostConstruct is putting you over the heap space limit. I wonder if there isn't a bug in the validation code...

Marcin, can you share your app with us?

--kevan


Kevan, my app is rather small (source is only 500 kB). Unfortunately I cannot share my app :(

I have tried to reporoduce this error on the source code for http://cwiki.apache.org/GMOxDOC20/jms-and-mdb-sample-application.html example. Patch is in attachment. I supposed to receive error, any error, because, as David said, @PostConstruct arguments are invalid. But modified jms-mdb-sample has been deployed without any errors. Strange, but maybe the same bad things happened, but jms-mdb-sample is not big enought to create "org.apache.geronimo.common.DeploymentException: Jar failed validation: pprsrv-ejb-1.2.jarERROR ... null: Cannot validate jar: Java heap space"

HTH,
Marcin

Index: jms-mdb-sample-ejb/pom.xml
===================================================================
--- jms-mdb-sample-ejb/pom.xml  (revision 1)
+++ jms-mdb-sample-ejb/pom.xml  (working copy)
@@ -52,6 +52,19 @@
                        <type>jar</type>
             <scope>provided</scope>
                </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.0_spec</artifactId>
+            <version>1.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_3.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        
 
        </dependencies>
 
Index: 
jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
===================================================================
--- 
jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
        (revision 1)
+++ 
jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
        (working copy)
@@ -33,6 +33,9 @@
 import javax.jms.MessageListener;
 import javax.jms.TextMessage;
 
+import javax.annotation.PostConstruct;
+import javax.interceptor.InvocationContext;
+
 //
 // MessageDrivenBean that listens to items on the
 // 'OrderQueue' queue and processes them accordingly.
@@ -49,6 +52,9 @@
     public OrderRecvMDB() {
 
     }
+    
+    @PostConstruct
+    public void construct(InvocationContext ctx) {}
 
     /*
      * Process a message. <br>

Reply via email to