[JBoss Remoting] - Socket Communication - StreamCorruptedException
by giftsamuel asir
giftsamuel asir [http://community.jboss.org/people/giftysam] created the discussion
"Socket Communication - StreamCorruptedException"
To view the discussion, visit: http://community.jboss.org/message/557206#557206
--------------------------------------------------------------
Hi,
I am using EJB3 as the client socket and the server socket is a normal java class. My Application server is Sun GlassfishV2. I would like to communicate from the EJBBean(Client) to the server using Jboss Remoting. If I use transport protocol "sslsocket" in the InvokerLocator class means its working fine. But If I use the transport protocol "socket" means I am getting the following exception.
[ERROR] ServerThread - WorkerThread#0[192.168.0.76:36438] exception occurred during first invocation
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.jboss.remoting.transport.socket.ServerThread.createServerSocketWrapper(ServerThread.java:907)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:489)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
Caused by: java.io.StreamCorruptedException: invalid stream header: 806B0103
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.<init>(ObjectInputStreamWithClassLoader.java:97)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.createInput(JavaSerializationManager.java:54)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.getMarshallingStream(SerializableUnMarshaller.java:75)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.getMarshallingStream(SerializableUnMarshaller.java:58)
at org.jboss.remoting.transport.socket.ClientSocketWrapper.createInputStream(ClientSocketWrapper.java:179)
at org.jboss.remoting.transport.socket.ClientSocketWrapper.createStreams(ClientSocketWrapper.java:162)
at org.jboss.remoting.transport.socket.ClientSocketWrapper.<init>(ClientSocketWrapper.java:66)
at org.jboss.remoting.transport.socket.ServerSocketWrapper.<init>(ServerSocketWrapper.java:46)
I tried a lot to figure this problem. Please help me to resolve this problem.
Thanks in Advance!!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557206#557206]
Start a new discussion in JBoss Remoting at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
Re: [jboss-user] [JBoss Web Services CXF] - How to share session between web service calls?
by Anand Jayaraman
Anand Jayaraman [http://community.jboss.org/people/anand201301] replied to the discussion
"How to share session between web service calls?"
To view the discussion, visit: http://community.jboss.org/message/557201#557201
--------------------------------------------------------------
Hi,
I needed one clarification, will this work if there are two separate instances of BindingProvider being used from client code. For e.g.
Greeter greeter = service.getGreeterPort();
BindingProvider bp = (BindingProvider)greeter;
bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
Map<String, List<String>> headers= CastUtils.cast((Map)bp.getRequestContext().get("javax.xml.ws.http.request.headers"));
if (headers == null) {
headers = new HashMap<String, List<String>>();
bp.getRequestContext().put("javax.xml.ws.http.request.headers", headers);
}
List<String> cookies = Arrays.asList(new String[] {"a=a", "b=b"});
headers.put("Cookie", cookies);
String greeting = greeter.greetMe("Bonjour");
*//After this invocation i am creating a brand new instance of binding provider .*
Greeter *greeter1* = *service1*.getGreeterPort();
BindingProvider *bp1* = (BindingProvider)*greeter1*;
bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
Map<String, List<String>> headers= CastUtils.cast((Map)*bp1*.getRequestContext().get("javax.xml.ws.http.request.headers"));
if (headers == null) {
headers = new HashMap<String, List<String>>();
bp.getRequestContext().put("javax.xml.ws.http.request.headers", headers);
}
List<String> cookies = Arrays.asList(new String[] {"a=a", "b=b"});
headers.put("Cookie", cookies);
String greeting = *greeter1*.greetMe("Bonjour");
-------------------------------------------------------------------------------------------------
The headers set in the first BindingProvider may not be same as the headers in the second binding provider because CXF would create a different cookie for the second BindingProvider instance.
So is the solution to keep the header, cookie information in a local data structure in the client side and keep copying it back to all new BindingProvider instances created from client side so that the same cookie information is relayed back to the server?
But this way it would not be too different from the HttpConduit approach i had mentioned earlier.
Are there any changes on the server that also needs to be done?
Regards,
Anand
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557201#557201]
Start a new discussion in JBoss Web Services CXF at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
Re: [jboss-user] [JBoss Web Services CXF] - How to share session between web service calls?
by Anand Jayaraman
Anand Jayaraman [http://community.jboss.org/people/anand201301] replied to the discussion
"How to share session between web service calls?"
To view the discussion, visit: http://community.jboss.org/message/557200#557200
--------------------------------------------------------------
Hi,
I needed one clarification, will this work if there are two separate instances of BindingProvider being used from client code. For e.g.
Greeter greeter = service.getGreeterPort();
BindingProvider bp = (BindingProvider)greeter;
bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
Map<String, List<String>> headers= CastUtils.cast((Map)bp.getRequestContext().get("javax.xml.ws.http.request.headers"));
if (headers == null) {
headers = new HashMap<String, List<String>>();
bp.getRequestContext().put("javax.xml.ws.http.request.headers", headers);
}
List<String> cookies = Arrays.asList(new String[] {"a=a", "b=b"});
headers.put("Cookie", cookies);
String greeting = greeter.greetMe("Bonjour");
*//After this invocation i am creating a brand new instance of binding provider .*
Greeter *greeter1* = *service1*.getGreeterPort();
BindingProvider *bp1* = (BindingProvider)*greeter1*;
bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
Map<String, List<String>> headers= CastUtils.cast((Map)*bp1*.getRequestContext().get("javax.xml.ws.http.request.headers"));
if (headers == null) {
headers = new HashMap<String, List<String>>();
bp.getRequestContext().put("javax.xml.ws.http.request.headers", headers);
}
List<String> cookies = Arrays.asList(new String[] {"a=a", "b=b"});
headers.put("Cookie", cookies);
String greeting = *greeter1*.greetMe("Bonjour");
-------------------------------------------------------------------------------------------------
The headers set in the first BindingProvider may not be same as the headers in the second binding provider because CXF would create a different cookie for the second BindingProvider instance.
So is the solution to keep the header, cookie information in a local data structure in the client side and keep copying it back to all new BindingProvider instances created from client side so that the same cookie information is relayed back to the server?
But this way it would not be too different from the HttpConduit approach i had mentioned earlier.
Are there any changes on the server that also needs to be done?
Regards,
Anand
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557200#557200]
Start a new discussion in JBoss Web Services CXF at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
[JBoss Tools] - How to Build JBoss Tools with Maven3
by Denis Golovin
Denis Golovin [http://community.jboss.org/people/dgolovin] modified the blog post:
"How to Build JBoss Tools with Maven3"
To view the blog post, visit: http://community.jboss.org/community/jbosstools/blog/2010/06/27/how-to-bu...
--------------------------------------------------------------
*[Note: This blog has been replaced by a more up to date http://community.jboss.org/docs/DOC-15513 wiki page.]*
Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.
h2. Prerequisites
1. Java 1.6 SDK
2. Maven 3.beta1
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools)
4. subversion client 1.6.X (should work with lower version as well)
h2. Environment Setup
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
mvn -version
should print out something like
Apache Maven 3.0-alpha-7 (r921173; 2010-03-09 14:31:07-0800)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-22-generic-pae" arch: "i386" Family: "unix"
h3. Sources
Checkout sources from anonymous SVN like
svn co https://svn.jboss.org/repos/jbosstools/trunk jbosstools-src
This will take some time dependent on your bandwidth
h2. Build Strategies
All commands below is assuming that commands are executed in jbosstools-src folder after sources checked out as it suggested above.
There are several strategies to chose from building everything to build particular component or part of it like all plug-ins, all tests, all features, particular plugin/feature.
Target platform should be built first like
$mvn -f build/target-platform/pom.xml
If you want to just compile the modules, tests can be skipped by adding system property -Dmaven.test.skip=true and you should be able to faster verify compile issues.
h3. Build/Test Everything
Current version cannot be build without local changes because of problem with with drools component, so to go with this scenario you need to remove drools references from pom.xml and site/site.xml. After that to build/test everything use:
$mvn clean install
h3. Build/Test Particular Component with Dependencies
For convenience there are aggregator projects defined for each component. It provides a simple way to build/test components with dependencies.
$mvn clean install -f build/component/${component.name}.xml
where ${component.name} is component you want to build/test. Currently build/component folder contains aggregator projects for:
1. tests,
2. jmx,
3. archives,
4. as,
5. common,
6. seam
more is coming soon.
h3. Build/Test Single Component
Be aware that to get this work all dependencies for this component must be installed in maven repo. It can be done by build everything first or by build component and its dependencies using aggregated project as it explained above. You can skip tests for this build and then enable them back when you run single component build.
To build single component use pom.xml in component's folder like it is shown below.
$mvn clean install -f ${component.name}/pom.xml
where ${component.name} is component's root folder name. For instance to build jmx component use command below
$mvn clean install -f jmx/pom.xml
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/community/jbosstools/blog/2010/06/27/how-to-bu...]
15 years, 8 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven3
by Nick Boldt
Nick Boldt [http://community.jboss.org/people/nickboldt] modified the document:
"How to Build JBoss Tools with Maven3"
To view the document, visit: http://community.jboss.org/docs/DOC-15513
--------------------------------------------------------------
Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.
h2. Prerequisites
1. Java 1.6 SDK
2. Maven 3.beta1
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools)
4. subversion client 1.6.X (should work with lower version as well)
h2. Environment Setup
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
mvn -version
should print out something like
Apache Maven 3.0-beta-2 (r983206; 2010-08-07 07:00:51-0400)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32.14-127.fc12.i686" arch: "i386" Family: "unix"
h3. Sources
Checkout sources from anonymous SVN like
svn co http://anonsvn.jboss.org/repos/jbosstools/trunk jbosstools-trunk
This will take some time dependent on your bandwidth
h2. Build Strategies
All commands below is assuming that commands are executed in jbosstools-src folder after sources checked out as it suggested above.
There are several strategies to chose from building everything to build particular component or part of it like all plug-ins, all tests, all features, particular plugin/feature.
Target platform and parent pom should be built first like
mvn clean install -f build/parent/pom.xml
If you want to just compile the modules, tests can be skipped by adding system property *-Dmaven.test.skip=true* and you should be able to faster verify compile issues.
h3. Build/Test Everything
Current version cannot be build without local changes because of problem with with drools component, so to go with this scenario you need to remove drools references from pom.xml and site/site.xml. After that to build/test everything use:
mvn clean install
h3. Build/Test Particular Component with Dependencies
For convenience there are aggregator projects defined for each component. It provides a simple way to build/test components with dependencies.
mvn clean install -f build/component/${component.name}.xml
where ${component.name} is component you want to build/test. Currently build/component folder contains aggregator projects for:
1. tests
2. jmx
3. archives
4. as
5. common
6. seam
7. vpe
8. archives
9. as
More are coming soon. To know the order in which to build prerequisite components for your component, see http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml
h3. Build/Test Single Component
Be aware that to get this work all dependencies for this component must be installed in maven repo. It can be done by build everything first or by build component and its dependencies using aggregated project as it explained above. You can skip tests for this build and then enable them back when you run single component build.
To build single component use pom.xml in component's folder like it is shown below.
mvn clean install -f ${component.name}/pom.xml
where ${component.name} is component's root folder name. For instance to build jmx component use command below
mvn clean install -f jmx/pom.xml
or :if you prefer, you can build a series of components in order (with tests skipped using *-Dmaven.test.skip=true*):
for d in tests jmx archives as; do \
pushd $d; mvn clean install -Dmaven.test.skip=true; popd; \
done
----
h3. Adding a Plugin To An Existing Component
Now that you can build your component, you can easily add a new plugin to that component. Here's how.
0. Make sure your new plugin compiles in your workspace. Ensure your MANIFEST.MF contains all references/includes/requirements you need. Be sure to set the correct Bundle-RequireExecutionEnvironment (eg., JDK5 or JDK6).
1. When you are satisfied, you can commit your new plugin project to SVN.
cd ~/trunk/as/plugins; \
svn add org.jboss.ide.eclipse.as.rse.core; \
svn ci -m "JBIDE-123456 Initial commit of new as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core
2. Next, add a pom.xml file to the root of your new project.
You can use m2eclipse to help w/ this if you have it installed; otherwise copy from another existing plugin project and edit appropriately. The version of the pom should match the version in the manifest.mf. Note that 3.2.0.qualifier (in MANIFEST.MF) is equivalent to 3.2.0-SNAPSHOT in the pom.xml.
3. Build your plugin:
cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core; \
mvn3 clean install
4. If your component's new plugin builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:
vi ~/trunk/as/plugins/pom.xml
5. To ensure that your plugin is available on the update site, be sure that it is contained in at least one feature's feature.xml, and that that feature appears in three places:
vi ~/trunk/as/site/site.xml # (the AS update site)
vi ~/trunk/site/site.xml # (the JBoss Tools update site) and vi ~/trunk/build/aggregate/site/site.xml # (the JBoss Tools aggregate update site, which includes pi4soa, Teiid Designer, XulRunner, Drools, ...)
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15513]
Create a new document in JBoss Tools Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
15 years, 8 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven3
by Nick Boldt
Nick Boldt [http://community.jboss.org/people/nickboldt] modified the document:
"How to Build JBoss Tools with Maven3"
To view the document, visit: http://community.jboss.org/docs/DOC-15513
--------------------------------------------------------------
Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.
h2. Prerequisites
1. Java 1.6 SDK
2. Maven 3.beta1
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools)
4. subversion client 1.6.X (should work with lower version as well)
h2. Environment Setup
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
$mvn -version
should print out something like
Apache Maven 3.0-beta-2 (r983206; 2010-08-07 07:00:51-0400)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32.14-127.fc12.i686" arch: "i386" Family: "unix"
h3. Sources
Checkout sources from anonymous SVN like
$svn co http://anonsvn.jboss.org/repos/jbosstools/trunk jbosstools-src
This will take some time dependent on your bandwidth
h2. Build Strategies
All commands below is assuming that commands are executed in jbosstools-src folder after sources checked out as it suggested above.
There are several strategies to chose from building everything to build particular component or part of it like all plug-ins, all tests, all features, particular plugin/feature.
Target platform and parent pom should be built first like
$mvn clean install -f build/parent/pom.xml
If you want to just compile the modules, tests can be skipped by adding system property *-Dmaven.test.skip=true* and you should be able to faster verify compile issues.
h3. Build/Test Everything
Current version cannot be build without local changes because of problem with with drools component, so to go with this scenario you need to remove drools references from pom.xml and site/site.xml. After that to build/test everything use:
$mvn clean install
h3. Build/Test Particular Component with Dependencies
For convenience there are aggregator projects defined for each component. It provides a simple way to build/test components with dependencies.
$mvn clean install -f build/component/${component.name}.xml
where ${component.name} is component you want to build/test. Currently build/component folder contains aggregator projects for:
1. tests
2. jmx
3. archives
4. as
5. common
6. seam
7. vpe
8. archives
9. as
More are coming soon. To know the order in which to build prerequisite components for your component, see http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml
h3. Build/Test Single Component
Be aware that to get this work all dependencies for this component must be installed in maven repo. It can be done by build everything first or by build component and its dependencies using aggregated project as it explained above. You can skip tests for this build and then enable them back when you run single component build.
To build single component use pom.xml in component's folder like it is shown below.
$mvn clean install -f ${component.name}/pom.xml
where ${component.name} is component's root folder name. For instance to build jmx component use command below
$mvn clean install -f jmx/pom.xml
or :if you prefer, you can build a series of components in order (with tests skipped using *-Dmaven.test.skip=true*):
$for d in tests jmx archives as; do \
pushd $d; mvn clean install *-Dmaven.test.skip=true*; popd; \
done
------------------------------------------------------
h3. Adding a Plugin To An Existing Component
Now that you can build your component, you can easily add a new plugin to that component. Here's how.
0. Make sure your new plugin compiles in your workspace. Ensure your manifest.mf contains all references/includes/requirements you need. Be sure to set the correct Bundle-RequireExecutionEnvironment (eg., JDK5 or JDK6).
1. When you are satisfied, you can commit your new plugin project to SVN.
cd ~/trunk/as/plugins
svn add org.jboss.ide.eclipse.as.rse.core
svn ci -m "JBIDE-123456 Initial commit of new org.jboss.ide.eclipse.as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core
2. Next, add a pom.xml file to the root of your new project.
You can use m2eclipse to help w/ this if you have it installed; otherwise copy from another existing plugin project and edit appropriately. The version of the pom should match the version in the manifest.mf. Note that 3.2.0.qualifier (in manifest.mf) is equivalent to 3.2.0-SNAPSHOT in the pom.xml.
3. Build your plugin:
cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core
mvn3 clean install
4. If your component's new plugin builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:
vi ~/trunk/as/plugins/pom.xml
5. To ensure that your plugin is available on the update site, be sure that it is contained in at least one feature's feature.xml, and that that feature appears in three places:
vi ~/trunk/as/site/site.xml # (the AS update site)
vi ~/trunk/site/site.xml # (the JBoss Tools update site) and
vi ~/trunk/build/aggregate/site/site.xml # (the JBoss Tools aggregate update site, which includes pi4soa, Teiid Designer, XulRunner, Drools, and more)
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15513]
Create a new document in JBoss Tools Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
15 years, 8 months