You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by am am <ak...@yahoo.com> on 2011/01/26 22:18:57 UTC
Axis2 deployment mechanism for POJOs
Hi,
I am Axis2 starter and I have the following question.
Most of the tutorials mention that to deploy a pojo, the pojo should be placed
under the pojo directory (and if it does not exist, create it).
Additionally, pojos under a package, should be placed in a .jar and modify the
deployer in axis2.xml to point to pojo directory for jars.
But in official guide of axis2
http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is no mention
of a need for pojo directory.
Additionally, I noticed that if I drop the jar containing the pojo class to be
deployed as a web service, in the WEB-INF/lib directory the pojo deployment
still works!
So, can someone please tell me if the pojo directory is needed or not? Or is the
pojo directory required only, if you have no services.xml file descriptor for
the pojo?
Because for the case of
http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is indeed a
services.xml for the pojo. (This is not mentioned in most tutorials)
I am trying to understand how axis2 engine works in deploying.
Thank you
Re: Axis2 deployment mechanism for POJOs
Posted by am am <ak...@yahoo.com>.
Hi Pradeep, thanks for replying.
I have read about pojo deployment, and I understand what you are saying. My
problem is, that I find the literature on this matter, inconsistent.
For example, articles describing the deployment of pojo, mention to place it in
the pojo directory and if the pojo is under a package modify axis2.xml to have
<deployer extension=".jar" directory="pojo"
class="org.apache.axis2.deployment.POJODeployer"/>
None of the articles though, mentions the need for a services.xml
Indeed the pojo in this way is deployed, but when I tried to see the WSDL I get
in the browser:
<description>Unable to generate WSDL 1.1 for this service</description>
<reason>
If you wish Axis2 to automatically generate the WSDL 1.1, then please set
useOriginalwsdl as false in your services.xml
</reason>
So it seems to me, that although, not mentioned, a services.xml is needed in the
pojo deployment as well and not only if you deploy the WS as .aar. Otherwise the
error message is misleading and also how can I see the WSDL in this case????
This behavior is consistent though with
http://axis.apache.org/axis2/java/core/docs/pojoguide.html which for some reason
Deepal, says it is outdated.
Additionally, if I want to have custom deployers or group my pojos under a
single directory, I can do it like it is mentioned in the article you reffed me
to.
But if I simply dropped the jar in WEB-INF/lib, is this not a valid method? The
pojo would be in axis2 classpath right? So it would be deployed, right??
If you could help me understand the internals on this (than simply mechanically
do it) would be great!
Thank you!
________________________________
From: Pradeep Fernando <pr...@gmail.com>
To: java-dev@axis.apache.org
Sent: Fri, January 28, 2011 12:14:58 PM
Subject: Re: Axis2 deployment mechanism for POJOs
hi
comments inline,
On Thu, Jan 27, 2011 at 1:17 PM, am am <ak...@yahoo.com> wrote:
> Hi Deepal thanks for reply:
>>Only at the starting time or does it work runtime as well?
> What do you mean? If the clients can use the service? I can see the wsdl and
> I tried a service call and it works.
> Also is a services.xml needed for pojos?
> Now that I think about it, I guess it makes sense. The jar containing the
> pojo, since it is in lib it is in the classpath of axis2 and so axis2 can
> find it to initialize it. Right? Is this how it works???
hope you are already familiar with a the deployment architecture of
axis2. if not refer [1]
the pojoDeployer is responsible for deploying the pojo classes. you
can define your own deployer to deploy a service. you will see set of
registered deployers in the axis2 xml. there we have define,
<deployer extension=".class" directory="pojo"
class="org.apache.axis2.deployment.POJODeployer"/>
so that any .class file put in to directory named pojo will be
deployed by the pojoDeployer.
[1] http://wso2.org/library/3708
--Pradeep
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
Re: Axis2 deployment mechanism for POJOs
Posted by Pradeep Fernando <pr...@gmail.com>.
hi
comments inline,
On Thu, Jan 27, 2011 at 1:17 PM, am am <ak...@yahoo.com> wrote:
> Hi Deepal thanks for reply:
>>Only at the starting time or does it work runtime as well?
> What do you mean? If the clients can use the service? I can see the wsdl and
> I tried a service call and it works.
> Also is a services.xml needed for pojos?
> Now that I think about it, I guess it makes sense. The jarĀ containing the
> pojo, since it is in lib it is in the classpath of axis2 and so axis2 can
> find it to initialize it. Right? Is this how it works???
hope you are already familiar with a the deployment architecture of
axis2. if not refer [1]
the pojoDeployer is responsible for deploying the pojo classes. you
can define your own deployer to deploy a service. you will see set of
registered deployers in the axis2 xml. there we have define,
<deployer extension=".class" directory="pojo"
class="org.apache.axis2.deployment.POJODeployer"/>
so that any .class file put in to directory named pojo will be
deployed by the pojoDeployer.
[1] http://wso2.org/library/3708
--Pradeep
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
Re: Axis2 deployment mechanism for POJOs
Posted by am am <ak...@yahoo.com>.
Hi Deepal thanks for reply:
>Only at the starting time or does it work runtime as well?
What do you mean? If the clients can use the service? I can see the wsdl and I
tried a service call and it works.
Also is a services.xml needed for pojos?
Now that I think about it, I guess it makes sense. The jar containing the pojo,
since it is in lib it is in the classpath of axis2 and so axis2 can find it to
initialize it. Right? Is this how it works???
________________________________
From: Deepal jayasinghe <de...@gmail.com>
To: java-dev@axis.apache.org
Sent: Thu, January 27, 2011 1:54:07 AM
Subject: Re: Axis2 deployment mechanism for POJOs
I am Axis2 starter and I have the following question.
>Most of the tutorials mention that to deploy a pojo, the pojo should
>be placed under the pojo directory (and if it does not exist, create
>it).
>
>Additionally, pojos under a package, should be placed in a .jar and
>modify the deployer in axis2.xml to point to pojo directory for
>jars.
>But in official guide of axis2
>http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is no mention
>of a need for pojo directory.
>
>
Need to update the document.
Additionally, I noticed that if I drop the jar containing the pojo
class to be deployed as a web service, in the WEB-INF/lib
directory the pojo deployment still works!
>
Only at the starting time or does it work runtime as well?
So, can someone please tell me if the pojo directory is needed or
not? Or is the pojo directory required only, if you have no
services.xml file descriptor for the pojo?
>
The requirement of pojos directory is to support pojo deployment, if you are
going to deploy services as services aar file, then you do not need it. You
can simply delete it.
Deepal
Because for the case of
http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is indeed a
services.xml for the pojo. (This is not mentioned in most tutorials)
>I am trying to understand how axis2 engine works in deploying.
>
>Thank you
>
>
Re: Axis2 deployment mechanism for POJOs
Posted by am am <ak...@yahoo.com>.
Hi Deepal thanks for reply:
>Only at the starting time or does it work runtime as well?
What do you mean? If the clients can use the service? I can see the wsdl and I
tried a service call and it works.
Also is a services.xml needed for pojos?
________________________________
From: Deepal jayasinghe <de...@gmail.com>
To: java-dev@axis.apache.org
Sent: Thu, January 27, 2011 1:54:07 AM
Subject: Re: Axis2 deployment mechanism for POJOs
I am Axis2 starter and I have the following question.
>Most of the tutorials mention that to deploy a pojo, the pojo should
>be placed under the pojo directory (and if it does not exist, create
>it).
>
>Additionally, pojos under a package, should be placed in a .jar and
>modify the deployer in axis2.xml to point to pojo directory for
>jars.
>But in official guide of axis2
>http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is no mention
>of a need for pojo directory.
>
>
Need to update the document.
Additionally, I noticed that if I drop the jar containing the pojo
class to be deployed as a web service, in the WEB-INF/lib
directory the pojo deployment still works!
>
Only at the starting time or does it work runtime as well?
So, can someone please tell me if the pojo directory is needed or
not? Or is the pojo directory required only, if you have no
services.xml file descriptor for the pojo?
>
The requirement of pojos directory is to support pojo deployment, if you are
going to deploy services as services aar file, then you do not need it. You
can simply delete it.
Deepal
Because for the case of
http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is indeed a
services.xml for the pojo. (This is not mentioned in most tutorials)
>I am trying to understand how axis2 engine works in deploying.
>
>Thank you
>
>
Re: Axis2 deployment mechanism for POJOs
Posted by Deepal jayasinghe <de...@gmail.com>.
> I am Axis2 starter and I have the following question.
> Most of the tutorials mention that to deploy a pojo, the pojo should
> be placed under the pojo directory (and if it does not exist, create it).
> Additionally, pojos under a package, should be placed in a .jar and
> modify the deployer in axis2.xml to point to pojo directory for jars.
> But in official guide of axis2
> http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is no
> mention of a need for pojo directory.
Need to update the document.
> Additionally, I noticed that if I drop the jar containing the pojo
> class to be deployed as a web service, in the WEB-INF/lib directory
> the pojo deployment still works!
Only at the starting time or does it work runtime as well?
> So, can someone please tell me if the pojo directory is needed or not?
> Or is the pojo directory required only, if you have no services.xml
> file descriptor for the pojo?
The requirement of pojos directory is to support pojo deployment, if you
are going to deploy services as services aar file, then you do not need
it. You can simply delete it.
Deepal
> Because for the case of
> http://axis.apache.org/axis2/java/core/docs/pojoguide.html there is
> indeed a services.xml for the pojo. (This is not mentioned in most
> tutorials)
> I am trying to understand how axis2 engine works in deploying.
>
> Thank you
>