You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Parvathy J A <pa...@suntecgroup.com> on 2013/02/12 14:40:14 UTC

Axis2 WebService From POJO and Jetty Deployment

 
Hi,

   I have exposed a POJO class as webservice programatically using axis2 and i tested the same using SimpleHTTPServer in Axis2, and im getting the wsdl correctly.

   But when i tried to deploy the same in Jetty its throwing error as EPR not found. I dont have an axis .aar file .I just have the location of my class file.

               Server server = new Server(8081);
                ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
                AxisConfiguration cfg = context.getAxisConfiguration();
               
                AxisService service = AxisService.createService(SampleServiceImpl.class.getName(), cfg, null, "", "http://samples", SampleServiceImpl.class.getClassLoader());
                service.setScope("application");
                context.setContextRoot("");
                cfg.addService(service);
               
               
                WebAppContext webapp = new WebAppContext();
                webapp.setContextPath("/");
                webapp.setServer(server);
               
                FileResource basePath = new FileResource(new URL("file:E:\\Nuwaza\\workspace\\webservertest\\target\\test-classes"));//the place where my class is present
                webapp.setBaseResource(basePath);
                ServletHolder holder=new ServletHolder(new AxisServlet());
                holder.setInitParameter("axis2.repository.path", "C:\\Parvathy\\ServiceContainer\\axis2-1.6.2-bin\\axis2-1.6.2\\repository"); //the default repository with axis library
               
                webapp.addServlet(holder, "/services/*");
               
                server.setHandler(webapp);
                server.start();
                server.join();

Please guide

Regards,
Parvathy J A




This electronic mail (including any attachment thereto) may be confidential and privileged and is intended only for the individual or entity named above. Any unauthorized use, printing, copying, disclosure or dissemination of this communication may be subject to legal restriction or sanction. Accordingly, if you are not the intended recipient, please notify the sender by replying to this email immediately and delete this email (and any attachment thereto) from your computer system...Thank You.

RE: Axis2 WebService From POJO and Jetty Deployment

Posted by Martin Gainty <mg...@hotmail.com>.
verify the Axis2.war has been built and deploys properly1)Axis2.war builds without error
2)Axis2.war deploys to your Container closely follow these steps (and apprise us of the results)http://axis.apache.org/axis2/java/core/docs/installationguide.html#servlet_container
you'll be able to verify proper installation of axis2.war by referencing the axis2 namespace on Server and Port
http://Server:Port/axis2
Martin ______________________________________________ 
Note de déni et de confidentialitéCe message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 From: kshanth2101@gmail.com
Date: Sun, 10 Mar 2013 14:33:33 +0530
Subject: Re: Axis2 WebService From POJO and Jetty Deployment
To: java-user@axis.apache.org



On Tue, Feb 12, 2013 at 7:10 PM, Parvathy J A <pa...@suntecgroup.com> wrote:

















Hi,



   I have exposed a POJO class as webservice programatically using axis2 and i tested the same using SimpleHTTPServer in Axis2, and im getting the wsdl correctly.



   But when i tried to deploy the same in Jetty its throwing error as EPR not found. 
This is probably because, the service is not correctly deployed. 


I dont have an axis .aar file .I just have the location of my class file.

What are errors did you see when the server is starting? 


Can you try other options mentioned in here [1] and see? It basically says about WAR based deployment of Axis2 on jetty. 

Thanks,Kishanthan.[1] http://ssagara.blogspot.com/2009/10/axis2-on-embedded-jetty.html 





               Server server = new Server(8081);

                ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);

                AxisConfiguration cfg = context.getAxisConfiguration();

              

                AxisService service = AxisService.createService(SampleServiceImpl.class.getName(), cfg, null, "", "http://samples", SampleServiceImpl.class.getClassLoader());




                service.setScope("application");

                context.setContextRoot("");

                cfg.addService(service);

              

              

                WebAppContext webapp = new WebAppContext();

                webapp.setContextPath("/");

                webapp.setServer(server);

              

                FileResource basePath = new FileResource(new URL("file:E:\\Nuwaza\\workspace\\webservertest\\target\\test-classes"));//the place where my class is present

                webapp.setBaseResource(basePath);

                ServletHolder holder=new ServletHolder(new AxisServlet());

                holder.setInitParameter("axis2.repository.path", "C:\\Parvathy\\ServiceContainer\\axis2-1.6.2-bin\\axis2-1.6.2\\repository"); //the default repository with axis library

              

                webapp.addServlet(holder, "/services/*");

              

                server.setHandler(webapp);

                server.start();

                server.join();



Please guide



Regards,

Parvathy J A












This electronic mail (including any attachment thereto) may be confidential and privileged and is intended only for the individual or entity named above. Any unauthorized use, printing, copying, disclosure or dissemination of this communication may be subject to legal restriction or sanction. Accordingly, if you are not the intended recipient, please notify the sender by replying to this email immediately and delete this email (and any attachment thereto) from your computer system...Thank You.



 		 	   		  

Re: Axis2 WebService From POJO and Jetty Deployment

Posted by Kishanthan Thangarajah <ks...@gmail.com>.
On Tue, Feb 12, 2013 at 7:10 PM, Parvathy J A <pa...@suntecgroup.com>wrote:

> **
>
>
> Hi,
>
>    I have exposed a POJO class as webservice programatically using axis2
> and i tested the same using SimpleHTTPServer in Axis2, and im getting the
> wsdl correctly.
>
>    But when i tried to deploy the same in Jetty its throwing error as EPR
> not found.
>

This is probably because, the service is not correctly deployed.

> I dont have an axis .aar file .I just have the location of my class file.
>

What are errors did you see when the server is starting?

Can you try other options mentioned in here [1] and see? It basically says
about WAR based deployment of Axis2 on jetty.


Thanks,
Kishanthan.
[1] http://ssagara.blogspot.com/2009/10/axis2-on-embedded-jetty.html

>
>                Server server = new Server(8081);
>                 ConfigurationContext context =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> null);
>                 AxisConfiguration cfg = context.getAxisConfiguration();
>
>                 AxisService service =
> AxisService.createService(SampleServiceImpl.class.getName(), cfg, null, "",
> "http://samples", SampleServiceImpl.class.getClassLoader());
>                 service.setScope("application");
>                 context.setContextRoot("");
>                 cfg.addService(service);
>
>
>                 WebAppContext webapp = new WebAppContext();
>                 webapp.setContextPath("/");
>                 webapp.setServer(server);
>
>                 FileResource basePath = new FileResource(new URL("
> file:E:\\Nuwaza\\workspace\\webservertest\\target\\test-classes"));//the
> place where my class is present
>                 webapp.setBaseResource(basePath);
>                 ServletHolder holder=new ServletHolder(new AxisServlet());
>                 holder.setInitParameter("axis2.repository.path",
> "C:\\Parvathy\\ServiceContainer\\axis2-1.6.2-bin\\axis2-1.6.2\\repository");
> //the default repository with axis library
>
>                 webapp.addServlet(holder, "/services/*");
>
>                 server.setHandler(webapp);
>                 server.start();
>                 server.join();
>
> Please guide
>
> Regards,
> Parvathy J A
>
>
>
>
> This electronic mail (including any attachment thereto) may be
> confidential and privileged and is intended only for the individual or
> entity named above. Any unauthorized use, printing, copying, disclosure or
> dissemination of this communication may be subject to legal restriction or
> sanction. Accordingly, if you are not the intended recipient, please notify
> the sender by replying to this email immediately and delete this email (and
> any attachment thereto) from your computer system...Thank You.
>