You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by slawek <s....@gmail.com> on 2012/02/29 20:17:44 UTC

simple-webservice on eclise

Hello,

I'm new in tomee, i did few examples and now I would like to start
simple-webservice example. I work with eclipse (configuration follow
instruction on page:
http://lorands.com/2010/11/debuging-openejbs-tomee-with-eclipse-wtp/).
Unfortunatly i can't start this example, when i execute test i see error:

...
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Failed to create service.
...
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
...

I lost almost all day trying to resolve this problem, and now i have not
idea what to do.

Best Regards
sw

--
View this message in context: http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4432643.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple-webservice on eclise

Posted by Romain Manni-Bucau <rm...@gmail.com>.
np,

not sure what is your issue exactly but personaly when i was using eclipse
(i now use Idea) i was using m2eclipse integration with WTP and it was
building my war as expected.

Maybe just an eclipse config mistake?

- Romain


2012/3/2 slawek <s....@gmail.com>

> Hello,
>
> The problem was solved! Follow your advice I deploy simple-webservice
> directly copy jar to tomee - and it works. But I was stil confused becouse
> i
> can't develop and deploy application in easy way using Dynamic Web Project.
> Finnaly I discover that when i drop all libraries from WEB-INF\lib (my
> classes are in WEB-INF\class) it works.
> Next step is to set up connection to db and return data from db via web
> service. I hope that will take me less time that webservices:)
>
> Thanks Romain for you help!
>
> Best Regards
> sw
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4436858.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: simple-webservice on eclise

Posted by slawek <s....@gmail.com>.
Hello,

The problem was solved! Follow your advice I deploy simple-webservice
directly copy jar to tomee - and it works. But I was stil confused becouse i
can't develop and deploy application in easy way using Dynamic Web Project.
Finnaly I discover that when i drop all libraries from WEB-INF\lib (my
classes are in WEB-INF\class) it works. 
Next step is to set up connection to db and return data from db via web
service. I hope that will take me less time that webservices:)

Thanks Romain for you help!

Best Regards
sw



--
View this message in context: http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4436858.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple-webservice on eclise

Posted by Romain Manni-Bucau <rm...@gmail.com>.
To run it i did it:

Create an dir test, create test/WEB-INF, create WEB-INF/classes, create
test/WEB-INF/lib copy simple-webservices.jar in lib.

Start tomee.

No need to play with cxf, it iq done for you.

Le 1 mars 2012 20:06, "slawek" <s....@gmail.com> a écrit :

> So, i haven't idea what i do wrong. Mayby i write it steb by step.
> - create new Dynamic Web Project in Eclipse Java EE IDE for Web Developers
> -
> indigo
> - modify configuration, add cxf 2
> - create package org.superbiz.calculator.ws
> - create in above package session bean named Calculator and paste sample
> code
> - create in above package interface CalculatorWs and paste sample code
> - add require libraries to project (openejb)
> - run as tommee server (first i did modyfication follow page:
> http://lorands.com/2010/11/debuging-openejbs-tomee-with-eclipse-wtp/)
>
> Best Regards
> sw
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4435844.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: simple-webservice on eclise

Posted by slawek <s....@gmail.com>.
So, i haven't idea what i do wrong. Mayby i write it steb by step.
- create new Dynamic Web Project in Eclipse Java EE IDE for Web Developers -
indigo
- modify configuration, add cxf 2
- create package org.superbiz.calculator.ws
- create in above package session bean named Calculator and paste sample
code
- create in above package interface CalculatorWs and paste sample code
- add require libraries to project (openejb)
- run as tommee server (first i did modyfication follow page:
http://lorands.com/2010/11/debuging-openejbs-tomee-with-eclipse-wtp/)

Best Regards
sw

--
View this message in context: http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4435844.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple-webservice on eclise

Posted by Romain Manni-Bucau <rm...@gmail.com>.
using http://localhost:8080/test/webservices/Calculator?wsdl (my webapp is
called test) works.

here is my code:

@Test
    public void test() throws Exception {
        Service calculatorService = Service.create(
                new URL("
http://localhost:8080/test/webservices/Calculator?wsdl"),
                new QName("http://superbiz.org/wsdl", "CalculatorService"));

        assertNotNull(calculatorService);

        CalculatorWs calculator =
calculatorService.getPort(CalculatorWs.class);
        assertEquals(10, calculator.sum(4, 6));
        assertEquals(12, calculator.multiply(3, 4));
    }

- Romain


2012/3/1 slawek <s....@gmail.com>

> Hello,
>
> Unfortunetly bellow links are incorrect. I think problem is connected with
> information:
>
> ...
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Failed to create service.
> ...
> Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
> ...
>
> This message was generated by junit test. But when I try to see wsdl file
> via browser, errors aren't generate.
>
> Thank for help.
>
> Best Regards
> sw
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4434759.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: simple-webservice on eclise

Posted by slawek <s....@gmail.com>.
Hello,

Unfortunetly bellow links are incorrect. I think problem is connected with
information:

... 
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Failed to create service. 
... 
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog 
... 

This message was generated by junit test. But when I try to see wsdl file
via browser, errors aren't generate. 

Thank for help.

Best Regards
sw


--
View this message in context: http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4434759.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple-webservice on eclise

Posted by Romain Manni-Bucau <rm...@gmail.com>.
did you check the logs?

if you are using a version a bit old it is
http://localhost:8080/ClassName?wsdl<http://localhost:8080/app-name/ClassName?wsdl>
otherwise
it is http://localhost:8080/app-name/webservices/ClassName?wsdl<http://localhost:8080/app-name/ClassName?wsdl>

- Romain


2012/3/1 slawek <s....@gmail.com>

> I use URL like http://localhost:8080/app-name/ClassName?wsdl
>
> Best Regards
> sw
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4433942.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: simple-webservice on eclise

Posted by slawek <s....@gmail.com>.
I use URL like http://localhost:8080/app-name/ClassName?wsdl

Best Regards
sw

--
View this message in context: http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4433942.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple-webservice on eclise

Posted by Romain Manni-Bucau <rm...@gmail.com>.
which url do you use?

- Romain


2012/2/29 slawek <s....@gmail.com>

> I do it exactly this way....
>
> Best regards
> sw
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4433059.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: simple-webservice on eclise

Posted by slawek <s....@gmail.com>.
I do it exactly this way....

Best regards
sw

--
View this message in context: http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4433059.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple-webservice on eclise

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

first you should use tomee and not tomcat + openejb. To do so simply create
a tomcat 7 wtp server then copy all config files in the config project of
eclipse (Server if i remember a bit).

Another point is simple-webservice should be repackaged in a webapp to be
deployed through wtp.

- Romain


2012/2/29 slawek <s....@gmail.com>

> Hello,
>
> I'm new in tomee, i did few examples and now I would like to start
> simple-webservice example. I work with eclipse (configuration follow
> instruction on page:
> http://lorands.com/2010/11/debuging-openejbs-tomee-with-eclipse-wtp/).
> Unfortunatly i can't start this example, when i execute test i see error:
>
> ...
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Failed to create service.
> ...
> Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
> ...
>
> I lost almost all day trying to resolve this problem, and now i have not
> idea what to do.
>
> Best Regards
> sw
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/simple-webservice-on-eclise-tp4432643p4432643.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>