Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » How to use Attachment?
How to use Attachment? [message #20471] Mon, 02 February 2009 05:32 Go to next message
Velganesh Subramanian is currently offline Velganesh SubramanianFriend
Messages: 69
Registered: July 2009
Member
I am not able to successfully pass a file attachment to server. This is
what I did:

1. I derived my class from Attachment.
2. My attachment is file-based.

The method on the interface is: log(Usage usage)

I get this exception after server is invoked from client.

javax.servlet.ServletException: org.blackt.udc.Usage:null
at
org.eclipse.riena.communication.publisher.hessian.RienaHessi anDispatcherServlet.service(RienaHessianDispatcherServlet.ja va:155)
at
org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
at
org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:90)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:111)

I also want to know if it is acceptable to pass null for properties when
registering a service.

regAttachmentService =
context.registerService(IAttachmentService.class.getName(), new
AttachmentService(),
null);
Publish.service(IAttachmentService.class.getName()).usingPat h( "/AttachmentService").withProtocol("hessian")
//$NON-NLS-1$ //$NON-NLS-2$
.andStart(context);

What is the impact if I pass one protocol through properties and another
value using "withProtocol" method? Is the latter overridden?
Re: How to use Attachment? [message #20495 is a reply to message #20471] Tue, 03 February 2009 12:04 Go to previous message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
The Attachment is not meant to be subclassed. So the intention is that you instantiate an Attachment object in your
code, fill it with the data from the source you choose and pass it as parameter or return value.

There is an Integration JUnit Test that shows you how to use that. Its called AttachmentClientITest and it runs against
AttachmentService. Can be found in org.eclipse.riena.tests.

christian

Velganesh Subramanian schrieb:
> I am not able to successfully pass a file attachment to server. This is
> what I did:
>
> 1. I derived my class from Attachment.
> 2. My attachment is file-based.
>
> The method on the interface is: log(Usage usage)
>
> I get this exception after server is invoked from client.
>
> javax.servlet.ServletException: org.blackt.udc.Usage:null
> at
> org.eclipse.riena.communication.publisher.hessian.RienaHessi anDispatcherServlet.service(RienaHessianDispatcherServlet.ja va:155)
>
> at
> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
>
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:90)
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:111)
>
>
> I also want to know if it is acceptable to pass null for properties when
> registering a service.
>
> regAttachmentService =
> context.registerService(IAttachmentService.class.getName(), new
> AttachmentService(),
> null);
> Publish.service(IAttachmentService.class.getName()).usingPat h( "/AttachmentService").withProtocol("hessian")
> //$NON-NLS-1$ //$NON-NLS-2$
> .andStart(context);
>
> What is the impact if I pass one protocol through properties and another
> value using "withProtocol" method? Is the latter overridden?
>
Re: How to use Attachment? [message #578513 is a reply to message #20471] Tue, 03 February 2009 12:04 Go to previous message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
The Attachment is not meant to be subclassed. So the intention is that you instantiate an Attachment object in your
code, fill it with the data from the source you choose and pass it as parameter or return value.

There is an Integration JUnit Test that shows you how to use that. Its called AttachmentClientITest and it runs against
AttachmentService. Can be found in org.eclipse.riena.tests.

christian

Velganesh Subramanian schrieb:
> I am not able to successfully pass a file attachment to server. This is
> what I did:
>
> 1. I derived my class from Attachment.
> 2. My attachment is file-based.
>
> The method on the interface is: log(Usage usage)
>
> I get this exception after server is invoked from client.
>
> javax.servlet.ServletException: org.blackt.udc.Usage:null
> at
> org.eclipse.riena.communication.publisher.hessian.RienaHessi anDispatcherServlet.service(RienaHessianDispatcherServlet.ja va:155)
>
> at
> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
>
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:90)
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:111)
>
>
> I also want to know if it is acceptable to pass null for properties when
> registering a service.
>
> regAttachmentService =
> context.registerService(IAttachmentService.class.getName(), new
> AttachmentService(),
> null);
> Publish.service(IAttachmentService.class.getName()).usingPat h( "/AttachmentService").withProtocol("hessian")
> //$NON-NLS-1$ //$NON-NLS-2$
> .andStart(context);
>
> What is the impact if I pass one protocol through properties and another
> value using "withProtocol" method? Is the latter overridden?
>
Previous Topic:Software caused connection abort: socket write error
Next Topic:Software caused connection abort: socket write error
Goto Forum:
  


Current Time: Fri Mar 29 08:38:57 GMT 2024

Powered by FUDForum. Page generated in 0.05032 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top