No, this sounds like a bug to me. Orion shouldnt care much for static
methods at all and just ignore them ("other" static methods should also be
fine per the spec as long as they dont contain/keep state, ie static
fields). This will be fixed for the RC2 release (thanks for the report).

/Magnus Stenman, the Orion team


----- Original Message -----
From: "Jens Stutte" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 09, 2000 12:40 PM
Subject: Static initializers in home interface -> won't compile


> Hi, it's not serious, but could be a bug:
>
> I build an entity bean, everything ok. Now i added a static field to the
> home interface, like this (the purpose of the field does not matter here):
>
>  /** Static array of field templates */
>  public static final NMejbFieldDescription[] m_MyFields =
>  {
>   new NMejbFieldDescription("Child",  NMejbFieldDescription.BEAN),
>   new NMejbFieldDescription("Name",  NMejbFieldDescription.STRING),
>   new NMejbFieldDescription("Data",  NMejbFieldDescription.BYTES),
>   new NMejbFieldDescription("Created", NMejbFieldDescription.DATETIME),
>   new NMejbFieldDescription("Number",  NMejbFieldDescription.NUMBER)
>  };
>
> This leads to the following error on deployment:
> Auto-deploying Beans... Error compiling
> file:/opt/java/orion/applications/BaseModule/Beans/: Illegal method
> signature in de.netmedia.ejb.base.binarybean.NMejbBinaryHome, the method
> must either be a create(...) or findXXX(...) method: static void
> de.netmedia.ejb.base.binarybean.NMejbBinaryHome.<clinit>()
>
> Orion/1.0rc2 (Internal Build 9) initialized
>
> Looks as if the server checks the methods in the home interface on
> conformity with the ejb spec and complains about a static initializer as
> about any other method. Or is anywhere stated, that static initializers
are
> not allowed in home interfaces ?
> Ah, and if i move the same static initializer into the remote interface
> instead of the home, i get:
> Auto-deploying Beans... Error compiling
> file:/opt/java/orion/applications/BaseModule/Beans/: Method public void
> <clinit>() not found in de.netmedia.ejb.base.binarybean.NMejbBinaryBean
>
> Strange. To confuse me and you just a bit more, there is also another
static
> field in the home interface:
>
>  /** The home of this bean is <code>NMejbBinary</code>. */
>  public static final String JNDINAME="NMejbBinary";
>
> This one is acceppted by orion (maybe static strings are subject of javac
> optimizations so that no clinit is generated at all ?).
>
> It's easy to work around all this, but i'd like to know, if this is a bug
or
> if it's intended to be this way (i did not study the spec again to find
> something on this, in my memory however never saw something concerning
> static initializers).
>
> Best regards,
>
> Jens Stutte
>
> ____________________________________________
> [EMAIL PROTECTED], http://www.netmedia.de <http://www.netmedia.de/>
>
> NetMedia GmbH
> Neugrabenweg 5-7
> 66123 Saarbruecken
> Germany
>
> fon: +49 (0) 681 - 3 79 88 - 0
> fax: +49 (0) 681 - 3 79 88 - 99
>
>
>


Reply via email to