Re: Returning complex types from a service

2007-07-16 Thread Simon Laws

On 7/15/07, Mike Edwards [EMAIL PROTECTED] wrote:


Rob,

I'm having a bit of trouble understanding exactly what you are trying to
do.  Could you post some of your code so that we get a better idea of
what is going on, please?


Yours,  Mike.

Robert Young wrote:
 Hi,

 I am running Tuscany within a Tomcat web project and I am getting the
 following exception
 Caused by: java.lang.NullPointerException
at
 commonj.sdo.impl.HelperProvider.getDefaultContext(HelperProvider.java
:379)
...
 I am guessing this is to do with trying to return a complex type from
 one of my services which is being exposed over JSONRPC. In this
 situation do I have to use SDO or are there other, simpler options?

 Cheers
 Rob

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Hi Rob


I came across a problem when returning SDOs from services exposed with the
JSONRPC binding ( http://issues.apache.org/jira/browse/TUSCANY-1337) that is
not fixed yet. In my case it was to do with returning types represented by
generated SDO classes. The JSONRPC binding was struggling trying to
serialize the underlying EMF classes. I wasn't getting a NPE though. As Mike
says if you could provide a bit more detail of your scenario we can work out
if this is the same problem or a new one.

As a work round I created a class to represent the complex type manually and
returned that.

Regards

Simon


Re: Returning complex types from a service

2007-07-16 Thread Robert Young

I don't think the problem is with the jsonrpc now actually. I have
been playing around with removing services from the .composite file
and the error occurs even when the jsonrpc binding is not mentioned.

While making changes I started receiving a memory exception so I
restarted Tomcat and now I'm getting an IO exception stating that it
cannot create a directory target (trace below). I can change the
permissions on the filesystem but it doesn't tell me where, do you
know where I can find out?

org.osoa.sca.ServiceRuntimeException:
org.osoa.sca.ServiceRuntimeException:
org.apache.tuscany.sca.core.runtime.ActivationException:
java.io.IOException: Unable to create directory target
   at 
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:263)
   at 
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:81)
   at 
org.apache.tuscany.sca.webapp.SCADomainHelper.initSCADomain(SCADomainHelper.java:63)
   at 
com.ipcmedia.nutch.webapp.context.NutchWebappContextListener.contextInitialized(NutchWebappContextListener.java:83)
   at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1206)
   at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at 
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.osoa.sca.ServiceRuntimeException:
org.apache.tuscany.sca.core.runtime.ActivationException:
java.io.IOException: Unable to create directory target
   at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:89)
   at 
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:229)
   ... 19 more
Caused by: org.apache.tuscany.sca.core.runtime.ActivationException:
java.io.IOException: Unable to create directory target
   at 
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntimeBuilder.createContributionService(ReallySmallRuntimeBuilder.java:186)
   at 
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime.start(ReallySmallRuntime.java:93)
   at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:86)
   ... 20 more
Caused by: java.io.IOException: Unable to create directory target
   at 
org.apache.tuscany.sca.contribution.service.util.FileHelper.forceMkdir(FileHelper.java:178)
   at 
org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl.init(ContributionRepositoryImpl.java:84)
   at 
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntimeBuilder.createContributionService(ReallySmallRuntimeBuilder.java:184)
   ... 22 more

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Returning complex types from a service

2007-07-16 Thread ant elder

You can see the target directory is getting created within the Tomcat bin
directory even just with the Tuscany samples like calculator-webapp. What is
this for and the storeInRepository stuff about?

  ...ant

On 7/16/07, Luciano Resende [EMAIL PROTECTED] wrote:


Are you calling ContributionService.contribute yourself ? if so,
please make the storeInRepository to false and let me know if this
helps.


On 7/16/07, Robert Young [EMAIL PROTECTED] wrote:
 I don't think the problem is with the jsonrpc now actually. I have
 been playing around with removing services from the .composite file
 and the error occurs even when the jsonrpc binding is not mentioned.

 While making changes I started receiving a memory exception so I
 restarted Tomcat and now I'm getting an IO exception stating that it
 cannot create a directory target (trace below). I can change the
 permissions on the filesystem but it doesn't tell me where, do you
 know where I can find out?

 org.osoa.sca.ServiceRuntimeException:
 org.osoa.sca.ServiceRuntimeException:
 org.apache.tuscany.sca.core.runtime.ActivationException:
 java.io.IOException: Unable to create directory target
 at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
SCADomain.java:263)
 at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(
SCADomain.java:81)
 at org.apache.tuscany.sca.webapp.SCADomainHelper.initSCADomain(
SCADomainHelper.java:63)
 at
com.ipcmedia.nutch.webapp.context.NutchWebappContextListener.contextInitialized
(NutchWebappContextListener.java:83)
 at org.apache.catalina.core.StandardContext.listenerStart(
StandardContext.java:3764)
 at org.apache.catalina.core.StandardContext.start(
StandardContext.java:4216)
 at org.apache.catalina.core.ContainerBase.addChildInternal(
ContainerBase.java:760)
 at org.apache.catalina.core.ContainerBase.addChild(
ContainerBase.java:740)
 at org.apache.catalina.core.StandardHost.addChild(
StandardHost.java:544)
 at org.apache.catalina.startup.HostConfig.deployWAR(
HostConfig.java:825)
 at org.apache.catalina.startup.HostConfig.deployWARs(
HostConfig.java:714)
 at org.apache.catalina.startup.HostConfig.deployApps(
HostConfig.java:490)
 at org.apache.catalina.startup.HostConfig.check(HostConfig.java
:1206)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(
HostConfig.java:293)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
LifecycleSupport.java:120)
 at org.apache.catalina.core.ContainerBase.backgroundProcess(
ContainerBase.java:1306)
 at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1570)
 at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1579)
 at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1559)
 at java.lang.Thread.run(Thread.java:595)
 Caused by: org.osoa.sca.ServiceRuntimeException:
 org.apache.tuscany.sca.core.runtime.ActivationException:
 java.io.IOException: Unable to create directory target
 at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
.init(DefaultSCADomain.java:89)
 at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
SCADomain.java:229)
 ... 19 more
 Caused by: org.apache.tuscany.sca.core.runtime.ActivationException:
 java.io.IOException: Unable to create directory target
 at
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntimeBuilder.createContributionService
(ReallySmallRuntimeBuilder.java:186)
 at
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime.start(
ReallySmallRuntime.java:93)
 at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
.init(DefaultSCADomain.java:86)
 ... 20 more
 Caused by: java.io.IOException: Unable to create directory target
 at
org.apache.tuscany.sca.contribution.service.util.FileHelper.forceMkdir(
FileHelper.java:178)
 at
org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl
.init(ContributionRepositoryImpl.java:84)
 at
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntimeBuilder.createContributionService
(ReallySmallRuntimeBuilder.java:184)
 ... 22 more

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Returning complex types from a service

2007-07-16 Thread Luciano Resende

We have partial support for a contribution repository, and that is a
flag to tell contributionService to store the contribution in the
repository or not.

On 7/16/07, ant elder [EMAIL PROTECTED] wrote:

You can see the target directory is getting created within the Tomcat bin
directory even just with the Tuscany samples like calculator-webapp. What is
this for and the storeInRepository stuff about?

   ...ant

On 7/16/07, Luciano Resende [EMAIL PROTECTED] wrote:

 Are you calling ContributionService.contribute yourself ? if so,
 please make the storeInRepository to false and let me know if this
 helps.


 On 7/16/07, Robert Young [EMAIL PROTECTED] wrote:
  I don't think the problem is with the jsonrpc now actually. I have
  been playing around with removing services from the .composite file
  and the error occurs even when the jsonrpc binding is not mentioned.
 
  While making changes I started receiving a memory exception so I
  restarted Tomcat and now I'm getting an IO exception stating that it
  cannot create a directory target (trace below). I can change the
  permissions on the filesystem but it doesn't tell me where, do you
  know where I can find out?
 
  org.osoa.sca.ServiceRuntimeException:
  org.osoa.sca.ServiceRuntimeException:
  org.apache.tuscany.sca.core.runtime.ActivationException:
  java.io.IOException: Unable to create directory target
  at
 org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
 SCADomain.java:263)
  at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(
 SCADomain.java:81)
  at org.apache.tuscany.sca.webapp.SCADomainHelper.initSCADomain(
 SCADomainHelper.java:63)
  at
 
com.ipcmedia.nutch.webapp.context.NutchWebappContextListener.contextInitialized
 (NutchWebappContextListener.java:83)
  at org.apache.catalina.core.StandardContext.listenerStart(
 StandardContext.java:3764)
  at org.apache.catalina.core.StandardContext.start(
 StandardContext.java:4216)
  at org.apache.catalina.core.ContainerBase.addChildInternal(
 ContainerBase.java:760)
  at org.apache.catalina.core.ContainerBase.addChild(
 ContainerBase.java:740)
  at org.apache.catalina.core.StandardHost.addChild(
 StandardHost.java:544)
  at org.apache.catalina.startup.HostConfig.deployWAR(
 HostConfig.java:825)
  at org.apache.catalina.startup.HostConfig.deployWARs(
 HostConfig.java:714)
  at org.apache.catalina.startup.HostConfig.deployApps(
 HostConfig.java:490)
  at org.apache.catalina.startup.HostConfig.check(HostConfig.java
 :1206)
  at org.apache.catalina.startup.HostConfig.lifecycleEvent(
 HostConfig.java:293)
  at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
 LifecycleSupport.java:120)
  at org.apache.catalina.core.ContainerBase.backgroundProcess(
 ContainerBase.java:1306)
  at
 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
 (ContainerBase.java:1570)
  at
 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
 (ContainerBase.java:1579)
  at
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
 ContainerBase.java:1559)
  at java.lang.Thread.run(Thread.java:595)
  Caused by: org.osoa.sca.ServiceRuntimeException:
  org.apache.tuscany.sca.core.runtime.ActivationException:
  java.io.IOException: Unable to create directory target
  at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
 .init(DefaultSCADomain.java:89)
  at
 org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
 SCADomain.java:229)
  ... 19 more
  Caused by: org.apache.tuscany.sca.core.runtime.ActivationException:
  java.io.IOException: Unable to create directory target
  at
 
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntimeBuilder.createContributionService
 (ReallySmallRuntimeBuilder.java:186)
  at
 org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime.start(
 ReallySmallRuntime.java:93)
  at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
 .init(DefaultSCADomain.java:86)
  ... 20 more
  Caused by: java.io.IOException: Unable to create directory target
  at
 org.apache.tuscany.sca.contribution.service.util.FileHelper.forceMkdir(
 FileHelper.java:178)
  at
 org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl
 .init(ContributionRepositoryImpl.java:84)
  at
 
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntimeBuilder.createContributionService
 (ReallySmallRuntimeBuilder.java:184)
  ... 22 more
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Luciano Resende
 Apache Tuscany Committer
 http://people.apache.org/~lresende
 http://lresende.blogspot.com/

 

Re: Returning complex types from a service

2007-07-15 Thread Mike Edwards

Rob,

I'm having a bit of trouble understanding exactly what you are trying to 
do.  Could you post some of your code so that we get a better idea of 
what is going on, please?



Yours,  Mike.

Robert Young wrote:

Hi,

I am running Tuscany within a Tomcat web project and I am getting the
following exception
Caused by: java.lang.NullPointerException
   at 
commonj.sdo.impl.HelperProvider.getDefaultContext(HelperProvider.java:379)

   ...
I am guessing this is to do with trying to return a complex type from
one of my services which is being exposed over JSONRPC. In this
situation do I have to use SDO or are there other, simpler options?

Cheers
Rob

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Returning complex types from a service

2007-07-13 Thread Robert Young

Hi,

I am running Tuscany within a Tomcat web project and I am getting the
following exception
Caused by: java.lang.NullPointerException
   at 
commonj.sdo.impl.HelperProvider.getDefaultContext(HelperProvider.java:379)
   ...
I am guessing this is to do with trying to return a complex type from
one of my services which is being exposed over JSONRPC. In this
situation do I have to use SDO or are there other, simpler options?

Cheers
Rob

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]