Re: SSE support and regular endpoints

2018-03-14 Thread Andriy Redko
Hi Carlos,

Yes, sure, the systests/rs-sse holds a test suite for SSE and different 
application containers.

https://github.com/apache/cxf/tree/master/systests/rs-sse/rs-sse-jetty/src/test/java/org/apache/cxf/systest/jaxrs/sse/jetty
https://github.com/apache/cxf/tree/master/systests/rs-sse/rs-sse-tomcat/src/test/java/org/apache/cxf/systest/jaxrs/sse/tomcat
https://github.com/apache/cxf/tree/master/systests/rs-sse/rs-sse-undertow/src/test/java/org/apache/cxf/systest/jaxrs/sse/undertow

What you may have run to is the suble but important detail: the transport id 
should be set on servlet and factory bean levels,
and it should much (this is is what you are missing probably, it is usually not 
needed in most cases). The Wiki page I referred to 
explains that (with upcoming 3.2.3 this should be simplified and would need 
only factory bean to have transport set). We also have 
a few sample projects:

https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/sse_spring
https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/sse_tomcat

We have had the discussion recently on dev@ list about not relying on Atm for 
SSE implementation, that would make things much 
more simple and straigthforward. If you could submit the PR with your async 
implementation (even as a draft), the team could 
review it and validate the idea. 

Thanks.

Best Regards,
Andriy Redko

CSA> Hi Andriy,

CSA> could you point me to the tests that are started with the special
CSA> transport id? Just to see where we are doing something wrong, because in
CSA> our case changing the transport id breaks most of the regular endpoints.

CSA> In the meantime we have put together an impl that does not rely on
CSA> atmosphere, just uses asyncContext, and does not need any special
CSA> transport. Would you think this could be an interesting contribution or
CSA> is atmosphere needed for some reason?

CSA> It could also use a review by someone with CXF super knowledge.

CSA> Bests.

CSA> Carlos.


CSA> El 12/3/18 a las 16:09, Andrey Redko escribió:
>> Hi Carlos,

>> That's right, SSE in CXF requires dedicated transport, however it is fully
>> compatible with the existing HTTP transport (regular endpoints). Both SSE
>> and non-SSE endpoints should work just fine. Here is a link to the wiki,
>> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75974373,
>> which will be a part of the official documentation section shortly.

>> Thanks.

>> Best Regards,
>> Andriy Redko

>> On Mon, Mar 12, 2018, 8:25 AM Carlos Sierra Andrés 
>> wrote:

>>> Hi there,

>>> as you might already know we are implementing Aries JAX-RS OSGi spec on
>>> top of CXF. We have found a problem when trying to add SSE support,
>>> because it looks like it needs to use a special "transport id", so it
>>> can't be used to have both regular SSE endpoints and regular endpoints
>>> in the same application. Is this correct or are we doing something wrong?

>>> Bests.

>>> Carlos.






cxf 3.2.2 jax-ws not working

2018-03-14 Thread Seshayya Murali
Java 1.8, apache tomcat 8 and cxf 3.2.2  not working.  Do not put code which 
are not working.

It is a pain to developers


cxf version used  3.2.2
All cxf version lib were used in WEB-INF\lib folder



13-Mar-2018 21:38:20.806 WARNING [localhost-startStop-1] 
org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup Could not 
start WS-Discovery Service.
 javax.xml.ws.WebServiceException: java.lang.NullPointerException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
at 
org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:259)
at 
org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:154)
at 
org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:73)
at 
org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:137)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:224)
at 
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at 
org.apache.cxf.jaxws.spring.NamespaceHandler$SpringServerFactoryBean.create(NamespaceHandler.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


--apache-cxf-services.xml

http://www.springframework.org/schema/beans; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:jaxws="http://cxf.apache.org/jaxws; 
xmlns:soap="http://cxf.apache.org/bindings/soap; xsi:schemaLocation=" 
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 
http://cxf.apache.org/bindings/soap 
http://cxf.apache.org/schemas/configuration/soap.xsd 
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;>







---web.xml

http://java.sun.com/xml/ns/javaee; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; version="2.5" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;>
cxf

Apache CXF Endpoint
cxf
cxf

org.apache.cxf.transport.servlet.CXFServlet
1


cxf
/services/*


60


--

--apache cxf 3.2.2 version samples code
package demo.hw.server;
import java.util.Map;
import javax.jws.WebService;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;
@WebService(name="HelloWorld")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
public interface HelloWorld {
String sayHi(String text);
String sayHiToUser(User user);
@XmlJavaTypeAdapter(IntegerUserMapAdapter.class)
Map getUsers();
}

package demo.hw.server;

import java.util.LinkedHashMap;
import java.util.Map;
import javax.jws.WebService;
@WebService(serviceName = "HelloWorld", endpointInterface = 
"demo.hw.server.HelloWorld")
public class HelloWorldImpl implements HelloWorld {
Map users = new LinkedHashMap();
public String sayHi(String text) {
System.out.println("sayHi called");
return "Hello " + text;
}
public String sayHiToUser(User user) {
System.out.println("sayHiToUser called");
users.put(users.size() + 1, user);
return "Hello "  + user.getName();
}
public Map getUsers() {
System.out.println("getUsers called");
return users;
}
}
// END SNIPPET: service










"Talent is...@cxf.apache.org God-given; be humble. Fame is man-given; be 
thankful. Conceit is self-given; be careful."


[GitHub] reta closed pull request #391: [CXF-7678] Fluent setters support in search extension

2018-03-14 Thread GitBox
reta closed pull request #391: [CXF-7678] Fluent setters support in search 
extension
URL: https://github.com/apache/cxf/pull/391
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
 
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
index 3a5bbb08666..87723fbf135 100644
--- 
a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
+++ 
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
@@ -210,8 +210,9 @@ private String getPropertyName(Method m) {
 }
 
 private boolean isSetter(Method m) {
-return m.getReturnType().equals(void.class) && 
m.getParameterTypes().length == 1
-   && (m.getName().startsWith("set") || 
m.getName().startsWith("is"));
+return (m.getReturnType().equals(void.class) || 
m.getReturnType().equals(m.getDeclaringClass()))
+&& m.getParameterTypes().length == 1
+&& (m.getName().startsWith("set") || 
m.getName().startsWith("is"));
 }
 
 
diff --git 
a/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/BeanspectorTest.java
 
b/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/BeanspectorTest.java
index 4204413f46c..6ccc2e1139b 100644
--- 
a/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/BeanspectorTest.java
+++ 
b/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/BeanspectorTest.java
@@ -37,8 +37,9 @@ public void testSimpleBean() throws SearchParseException {
 assertTrue(getters.contains("promised"));
 
 Set setters = bean.getSettersNames();
-assertEquals(1, setters.size());
-assertTrue(getters.contains("a"));
+assertEquals(2, setters.size());
+assertTrue(setters.contains("a"));
+assertTrue(setters.contains("fluent"));
 }
 
 @Test(expected = IllegalArgumentException.class)
@@ -69,5 +70,9 @@ public String getA() {
 
 public void setA(String val) {
 }
+
+public SimpleBean setFluent(String val) {
+return this;
+}
 }
 }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dennisl opened a new pull request #4: Generate a help mojo for the cxf-xjc-plugin

2018-03-14 Thread GitBox
dennisl opened a new pull request #4: Generate a help mojo for the 
cxf-xjc-plugin
URL: https://github.com/apache/cxf-xjc-utils/pull/4
 
 
   Generate a help mojo for the cxf-xjc-plugin, so the user can get help 
regarding goals and parameters from the command line.
   
   You can read more about how to use a help mojo here: 
https://maven.apache.org/plugin-tools/maven-plugin-plugin/help-mojo.html
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dkulp closed pull request #4: Generate a help mojo for the cxf-xjc-plugin

2018-03-14 Thread GitBox
dkulp closed pull request #4: Generate a help mojo for the cxf-xjc-plugin
URL: https://github.com/apache/cxf-xjc-utils/pull/4
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cxf-xjc-plugin/pom.xml b/cxf-xjc-plugin/pom.xml
index d3a115a..a325fe0 100644
--- a/cxf-xjc-plugin/pom.xml
+++ b/cxf-xjc-plugin/pom.xml
@@ -124,6 +124,12 @@
 descriptor
 
 
+
+generate-helpmojo
+
+helpmojo
+
+
 
 
 


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dennisl opened a new pull request #392: Generate a help mojo for the cxf-codegen-plugin

2018-03-14 Thread GitBox
dennisl opened a new pull request #392: Generate a help mojo for the 
cxf-codegen-plugin
URL: https://github.com/apache/cxf/pull/392
 
 
   Generate a help mojo for the cxf-codegen-plugin, so the user can get help 
regarding goals and parameters from the command line.
   
   You can read more about how to use a help mojo here: 
https://maven.apache.org/plugin-tools/maven-plugin-plugin/help-mojo.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dkulp closed pull request #392: Generate a help mojo for the cxf-codegen-plugin

2018-03-14 Thread GitBox
dkulp closed pull request #392: Generate a help mojo for the cxf-codegen-plugin
URL: https://github.com/apache/cxf/pull/392
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/maven-plugins/codegen-plugin/pom.xml 
b/maven-plugins/codegen-plugin/pom.xml
index f987b9e42be..bce9916a575 100644
--- a/maven-plugins/codegen-plugin/pom.xml
+++ b/maven-plugins/codegen-plugin/pom.xml
@@ -147,6 +147,12 @@
 descriptor
 
 
+
+generate-helpmojo
+
+helpmojo
+
+
 
 
 


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] WhiteCat22 commented on issue #390: [CXF-7676] Create a proxy OutputStream to create an EntityStream that…

2018-03-14 Thread GitBox
WhiteCat22 commented on issue #390: [CXF-7676] Create a proxy OutputStream to 
create an EntityStream that…
URL: https://github.com/apache/cxf/pull/390#issuecomment-373143264
 
 
   Test has been created and is passing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


Re: cxf 3.2.2 jax-ws not working

2018-03-14 Thread Daniel Kulp

This is not enough information to be useful. 

The javax.xml.ws.WebServiceException has a NullPointerException as the cause, 
but you are not including the stack trace for that.   That’s the import part as 
knowing where the NPE occurred may help narrow it down.

You also don’t list which CXF jars are in the WEB-INF\lib folder.My gut 
feeling is there is one missing, but without the stack trace or list, I really 
have no idea.   

That said, if you aren’t use WSDiscovery, remove the cxf-services-ws-discovery* 
jars from the WEB-INF\lib.   


Dan




> On Mar 14, 2018, at 11:44 AM, Seshayya Murali  wrote:
> 
> Java 1.8, apache tomcat 8 and cxf 3.2.2  not working.  Do not put code which 
> are not working.
> 
> It is a pain to developers
> 
> 
> cxf version used  3.2.2
> All cxf version lib were used in WEB-INF\lib folder
> 
> 
> 
> 13-Mar-2018 21:38:20.806 WARNING [localhost-startStop-1] 
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup Could not 
> start WS-Discovery Service.
> javax.xml.ws.WebServiceException: java.lang.NullPointerException
> at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
> at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
> at 
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:259)
> at 
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:154)
> at 
> org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:73)
> at 
> org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
> at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:137)
> at 
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:224)
> at 
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
> at 
> org.apache.cxf.jaxws.spring.NamespaceHandler$SpringServerFactoryBean.create(NamespaceHandler.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
> 
> --apache-cxf-services.xml
> 
> http://www.springframework.org/schema/beans; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
> xmlns:jaxws="http://cxf.apache.org/jaxws; 
> xmlns:soap="http://cxf.apache.org/bindings/soap; xsi:schemaLocation=" 
> http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 
> http://cxf.apache.org/bindings/soap 
> http://cxf.apache.org/schemas/configuration/soap.xsd 
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;>
> address="/hello_world">
>
>
>
>
> 
> 
> ---web.xml
> 
> http://java.sun.com/xml/ns/javaee; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; version="2.5" 
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;>
>cxf
>
>Apache CXF Endpoint
>cxf
>cxf
>
> org.apache.cxf.transport.servlet.CXFServlet
>1
>
>
>cxf
>/services/*
>
>
>60
>
> 
> --
> 
> --apache cxf 3.2.2 version samples code
> package demo.hw.server;
> import java.util.Map;
> import javax.jws.WebService;
> import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
> import javax.jws.WebService;
> import javax.jws.soap.SOAPBinding;
> import javax.jws.soap.SOAPBinding.Style;
> import javax.jws.soap.SOAPBinding.Use;
> @WebService(name="HelloWorld")
> @SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
> public interface HelloWorld {
>String sayHi(String text);
>String sayHiToUser(User user);
>@XmlJavaTypeAdapter(IntegerUserMapAdapter.class)
>Map getUsers();
> }
> 
> package demo.hw.server;
> 
> import java.util.LinkedHashMap;
> import java.util.Map;
> import javax.jws.WebService;
> @WebService(serviceName = "HelloWorld", endpointInterface = 
> "demo.hw.server.HelloWorld")
> public class HelloWorldImpl implements HelloWorld {
>Map users = new LinkedHashMap();
>public String sayHi(String text) {
>System.out.println("sayHi called");
>return "Hello " + text;
>}
>public String sayHiToUser(User user) {
>System.out.println("sayHiToUser called");
>users.put(users.size() + 1, user);
>return "Hello "  + user.getName();
>}
>public Map getUsers() {
>System.out.println("getUsers called");
>return users;
>}
> }
> // END SNIPPET: service
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> "Talent is...@cxf.apache.org God-given; be humble. Fame is man-given; be 
> thankful. Conceit is self-given; be careful."

-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder -