PDA

View Full Version : factory-method annoyance


Lou Rayman
Nov 22nd, 2004, 03:35 PM
Hi,

I'm using Spring to connect to an old CORBA server, and I want to use the ORB.init method (the static factory method for obtaining the ORB) from XML.
The following XML snippet works fine:

<bean id="theORB" class="org.omg.CORBA.ORB" factory-method="init">
<constructor-arg>
<list>
<!--value>this is junk</value-->
</list>
</constructor-arg>
<constructor-arg>
<props>
<prop key="org.omg.CORBA.ORBClass">etc</prop>
<prop key="org.omg.CORBA.ORBSingletonClass">etc</prop>
</props>
</constructor-arg>
</bean>

<bean id="dealServerRef" class="CorbaClientFactory">
<property name="orb">
<ref bean="theORB"/>
</property>
<property name="targetClass">
<value>CorbalServer</value>
</property>
<property name="corbaName">
<value>CorbaServerName</value>
</property>
</bean>


this works fine :) but, the xml line with the factrory-method is always tagged with this error:
Attribute "factory-method" must be declared for element type "bean"
which prevents the "bean graph" panel from coming up :cry:

I've tried different DOCTYPE headers, all to no avail.

--
Lou Rayman

lrayman ---at--- lehman ---dot--- com

Alef Arendsen
Nov 22nd, 2004, 03:46 PM
From http://www.springframework.org/dtd/spring-beans.dtd:


<!ATTLIST bean factory-method CDATA #IMPLIED>


Maybe your IDEs cache is out-of-date, the DTD does declare the attribute.

Lou Rayman
Nov 22nd, 2004, 04:06 PM
i see - the copy of spring-core.dtd buried in the plugins directory is out of date. is there a safe way to upgrade it?

Torsten Juergeleit
Nov 23rd, 2004, 11:12 AM
Lou,

if you are using XmlBuddy then please refer to Assaf's workaround described in thread http://forum.springframework.org/showthread.php?t=10957 .

Cheers,
Torsten