[JBossWS] - streaming with jbossws with small packets, or getting HttpUr
by suvigy
hi!
I'm developing a hyperterminal applet, where I'd like that the user can send data to COM ports via applet, and the COM port sends data back via web-service (streaming). Is it possible to do it with JBOSSWS? I need streaming for that. But often only few bytes (even 1 byte) comes from the COM port, I would like this even 1 byte to be flushed. I don't want any buffering.
I created a test service in that I enabled MTOM, but it's buffering, because I have to wait 10 seconds on the client side till the data arrives:
Server side, in that I simulate the hyperterminal, after each byte I wait 1 second. It should be flushed each time :
| @MTOM
| @BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)
| @WebService
| public class TestService {
| @WebMethod
| public @XmlMimeType("application/octet-stream") DataHandler getStream() {
| return new DataHandler(new DataSource() {
|
| public String getContentType() {
|
| return "application/octet-stream";
| }
|
| public InputStream getInputStream() throws IOException {
|
| return new InputStream() {
| private int count = 0;
| @Override
| public int read() throws IOException {
| if (count!=0)
| try {
| Thread.sleep(1000);
| } catch (InterruptedException e) {
|
| }
| count++;
| if (count>10)
| return -1;
| return 'a';
|
| }
|
| };
|
| }
|
| public String getName() {
|
| return "test";
| }
|
| public OutputStream getOutputStream() throws IOException {
|
| return null;
| }
|
| });
|
| }
| }
|
|
|
If there is no Binding annotation at the beginning, then the behaviour is the same
Client Side:
| public class ConsoleTest {
|
| /**
| * @param args
| */
| public static void main(String[] args) throws Exception {
| MTOMFeature feature = new MTOMFeature();
|
| TestServiceService service = new TestServiceService();
|
| TestService port = service.getTestServicePort(feature);
| Map<String, Object> ctxt = ((BindingProvider)port).getRequestContext();
|
|
| // Enable HTTP chunking mode, otherwise HttpURLConnection buffers
| ctxt.put(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE, 1);
|
| DataHandler dh = port.getStream();
|
| InputStream is = dh.getInputStream();
| int data;
| while ((data = is.read())>-1) {
| System.out.print((char)data);
| }
| is.close();
|
| }
|
| }
And I have to wait 10 seconds, till the result comes. I would except the data to come continuously.
I don't know if it is possible.
If not, then I would write an own servlet for that. In the real application I maintain session, so the client uses cookie, but then I would need the http client of jbossws on the client side. Can I get it somehow (What type does it have? HttpUrlConnection?)?
Thnx
George
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124581#4124581
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124581
16 years, 11 months
[JBossWS] - strange: NoClassDefFoundError: org/jboss/wsf/spi/invocation/
by beligum
Hi all,
Please help me with this one: I've been trying to solve it all night.
I "patched" a fresh installed EAP-server (AS 4.2.0) (jboss developer studio) with jbossws 2.0.0 and am trying to deploy a webservices-enabled EAR.
All goes well, until I get this error:
| 03:51:26,409 ERROR [MainDeployer] Could not start deployment: file:/home/bram/Programs/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/tumbolia-ear.ear/tumbolia-ejb.jar/
| java.lang.NoClassDefFoundError: org/jboss/wsf/spi/invocation/RequestHandler
| at java.lang.ClassLoader.findBootstrapClass(Native Method)
| at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:301)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
| at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:193)
| at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
| at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:520)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
| at org.jboss.wsf.spi.deployment.EndpointHandlerDeployer.getRequestHandler(EndpointHandlerDeployer.java:76)
| at org.jboss.wsf.spi.deployment.EndpointHandlerDeployer.create(EndpointHandlerDeployer.java:66)
| at org.jboss.wsf.spi.deployment.BasicDeployerManager.deploy(BasicDeployerManager.java:69)
| at org.jboss.wsf.container.jboss42.MainDeployerHook.deploy(MainDeployerHook.java:46)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy34.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
|
Any ideas?
I must say that I'm starting the server from within developer studio.
b.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124235#4124235
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124235
16 years, 11 months