[ome-devel] OMERO Spring
Simon Kainz
simon.kainz at tugraz.at
Thu Jun 12 12:42:42 BST 2008
Simon Kainz wrote:
> I'm trying to integrate the client library into an existing java
> project, also, among others, based on spring.
>
> I'm trying the following:
>
> OmeroContext ctx=OmeroContext.getClientContext();
>
> IAdmin ia=(IAdmin)ctx.getBean("managed:ome.api.IAdmin");
>
> String fn=iadmin.lookupExperimenter("skainz").getFirstName();
>
> This fails with a NullPointerException in java.util.Hashtable.put()
>
> I set up the credentials in a local.properties file, but also see no
> "acivity" on the omero server log when executing the code above.
>
> What/how is the correct usage of the ClientContext? Is there some
> docs/examples?
>
> TIA,
Hi!
I tracked down the issue: There seems to be a version conflict regarding
spring: Omero uses 2.0.6, whereas I'm trying to use the omero client lib
inside our application which uses spring 2.0.8. I also tested this by
writing an example prog which works using spring 2.0.6 but doesn't when
use 2.0.8.
I get the following error using Spring 2.0.8.
xception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at
org.springframework.util.CollectionUtils.mergePropertiesIntoMap(CollectionUtils.java:100)
at
org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:112)
at
org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)
at
org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:130)
at
org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:155)
at
org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)
at
org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at
org.springframework.jndi.JndiObjectTargetSource.getTarget(JndiObjectTargetSource.java:131)
at ome.client.JBossTargetSource.getTarget(JBossTargetSource.java:73)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184)
at $Proxy8.saveAndReturnObject(Unknown Source)
at Importer.main(Importer.java:45)
Any ideas as how to solve this ? Maybe recompile using Spring 2.0.8 ?
TIA, Simon
More information about the ome-devel
mailing list