You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Benjamin Boksa <ma...@boksa.de> on 2007/09/16 22:08:31 UTC

[javaflow] AssertionViolatedException when deriving classes

Hi List,

during some work with javaflow (actually I am triying to adopt the  
[1] CocoonAndHibernateTutorial) I came across the following problem.  
To create an abstract class providing a hibernate session I wrote the  
following class:

    abstract class AbstractHibernateContinuable extends  
AbstractContinuable {
       protected Session hs = null;

       protected AbstractHibernateContinuable() throws  
ProcessingException {
          super();
          // initialize hs and do some other stuff
       }
    }

My actual flow method is doTest() in the following class:

    public class JavaflowTest extends AbstractHibernateContinuable {
       private Session hs = super.hs;
	
       public JavaflowTest() throws ProcessingException {
          super();
       }
	
       public void doTest() {
          List l = this.hs.createQuery("select f from Foo f").list();
         // process list and sendPage
       }	
    }

The code above works fine, however to me it seems that the line

    private Session hs = super.hs;

is "redundant" but if I try to _run_ the code (_compilation_ works  
fine) without it I get the following error:

    org.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL  
ERROR: Field 'hs' not found?!?

(I guess BCEL is not checking the inheritance hierachy for the  
variable). Is there a "cleaner" way to do this or should a take a  
completely different approach? I am looking forward for any input on  
this proplem - please also tell me if there is no way to do it  
without the redundancy.

Thanks in advance

Benjamin


[1] http://wiki.apache.org/cocoon/CocoonAndHibernateTutorial

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [javaflow] AssertionViolatedException when deriving classes

Posted by Torsten Curdt <tc...@apache.org>.
If you don't ming please create a testcase and file a bug for http:// 
commons.apache.org/sandbox/javaflow at

  https://issues.apache.org/jira/browse/SANDBOX/component/12311186

cheers
--
Torsten


On 16.09.2007, at 22:08, Benjamin Boksa wrote:

> Hi List,
>
> during some work with javaflow (actually I am triying to adopt the  
> [1] CocoonAndHibernateTutorial) I came across the following  
> problem. To create an abstract class providing a hibernate session  
> I wrote the following class:
>
>    abstract class AbstractHibernateContinuable extends  
> AbstractContinuable {
>       protected Session hs = null;
>
>       protected AbstractHibernateContinuable() throws  
> ProcessingException {
>          super();
>          // initialize hs and do some other stuff
>       }
>    }
>
> My actual flow method is doTest() in the following class:
>
>    public class JavaflowTest extends AbstractHibernateContinuable {
>       private Session hs = super.hs;
> 	
>       public JavaflowTest() throws ProcessingException {
>          super();
>       }
> 	
>       public void doTest() {
>          List l = this.hs.createQuery("select f from Foo f").list();
>         // process list and sendPage
>       }	
>    }
>
> The code above works fine, however to me it seems that the line
>
>    private Session hs = super.hs;
>
> is "redundant" but if I try to _run_ the code (_compilation_ works  
> fine) without it I get the following error:
>
>    org.apache.bcel.verifier.exc.AssertionViolatedException:  
> INTERNAL ERROR: Field 'hs' not found?!?
>
> (I guess BCEL is not checking the inheritance hierachy for the  
> variable). Is there a "cleaner" way to do this or should a take a  
> completely different approach? I am looking forward for any input  
> on this proplem - please also tell me if there is no way to do it  
> without the redundancy.
>
> Thanks in advance
>
> Benjamin
>
>
> [1] http://wiki.apache.org/cocoon/CocoonAndHibernateTutorial
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org