Java.io.StreamCorruptedException Load
Hi There,
I am getting java.io.StreamCorruptedException while doing applet-servlet communication.
I am closing all the streams once done.
But still during load i am seeing this exception in the logs though its not stopping the application to work its working fine but in the logs i am seeing this exceptions during load.
Any pointers would be of great help.
Tx
I am assuming that the ObjectOutputStream called flush() prior to attempting to read the file.
That having been said, the serialization specification should be portable across JVM's. Is the source identical on both machines? If a field has been added or removed or renamed, you may get errors similar to the one you are experiencing.
- Saish
"My karma ran over your dogma." - Anon
Similar Messages
-
Am running into following exception even after following all guidelines to implement POF. The main objective is to perform Distributed Bulk cache loading.
Oracle Coherence GE 3.7.1.10 <Error> (thread=Invocation:InvocationService, member=1): Failure to deserialize an Invocable object: java.io.StreamCorruptedException: unknown user type: 1001
java.io.StreamCorruptedException: unknown user type: 1001
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3312)
at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2604)
at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:371)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:1)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService$InvocationRequest.read(InvocationService.CDB:8)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.deserializeMessage(Grid.CDB:19)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:31)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:662)
Following is the pof-config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config/1.1/coherence-pof-config.xsd">
<user-type-list>
<include>coherence-pof-config.xml</include>
<user-type>
<type-id>1001</type-id>
<class-name>com.westgroup.coherence.bermuda.loader.DistributedLoaderAgent</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1002</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.LPACacheProfile</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1003</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.Address</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1004</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.Discipline</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1005</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.Employment</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
</user-type-list>
<allow-interfaces>true</allow-interfaces>
<allow-subclasses>true</allow-subclasses>
</pof-config>
cache-config.xml
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config http://xmlns.oracle.com/coherence/coherence-cache-config/1.1/coherence-cache-config.xsd">
<defaults>
<serializer>pof</serializer>
</defaults>
<caching-scheme-mapping>
<cache-mapping>
<cache-name>DistributedLPACache</cache-name>
<scheme-name>LPANewCache</scheme-name>
<init-params>
<init-param>
<param-name>back-size-limit</param-name>
<param-value>250MB</param-value>
</init-param>
</init-params>
</cache-mapping>
</caching-scheme-mapping>
<caching-schemes>
<!-- Distributed caching scheme. -->
<distributed-scheme>
<scheme-name>LPANewCache</scheme-name>
<service-name>HBaseLPACache</service-name>
<serializer>
<instance>
<class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
<init-params>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>pof-config.xml</param-value>
</init-param>
</init-params>
</instance>
</serializer>
<backing-map-scheme>
<read-write-backing-map-scheme>
<internal-cache-scheme>
<class-scheme>
<class-name>com.tangosol.util.ObservableHashMap</class-name>
</class-scheme>
</internal-cache-scheme>
<cachestore-scheme>
<class-scheme>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.LPACacheProfile</class-name>
</class-scheme>
</cachestore-scheme>
<read-only>false</read-only>
<write-delay-seconds>0</write-delay-seconds>
</read-write-backing-map-scheme>
</backing-map-scheme>
<autostart>true</autostart>
</distributed-scheme>
<invocation-scheme>
<scheme-name>InvocationService</scheme-name>
<service-name>InvocationService</service-name>
<thread-count>5</thread-count>
<autostart>true</autostart>
</invocation-scheme>
</caching-schemes>
</cache-config>
DistributedLoaderAgent (user type 1001)
import java.io.IOException;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import org.apache.log4j.Logger;
import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import com.tangosol.io.pof.PortableObject;
import com.tangosol.io.pof.annotation.Portable;
import com.tangosol.io.pof.annotation.PortableProperty;
import com.tangosol.net.AbstractInvocable;
import com.tangosol.net.InvocationService;
@Portable
public class DistributedLoaderAgent extends AbstractInvocable implements PortableObject{
private static final long serialVersionUID = 10L;
private static Logger m_logger = Logger.getLogger(DistributedLoaderAgent.class);
@PortableProperty(0)
public String partDumpFileName = null;
public String getPartDumpFileName() {
return partDumpFileName;
public void setPartDumpFileName(String partDumpFileName) {
this.partDumpFileName = partDumpFileName;
public DistributedLoaderAgent(){
super();
m_logger.debug("Configuring this loader ");
public DistributedLoaderAgent(String partDumpFile){
super();
m_logger.debug("Configuring this loader to load dump file "+ partDumpFile);
partDumpFileName = partDumpFile;
@Override
public void init(InvocationService service) {
// TODO Auto-generated method stub
super.init(service);
@Override
public void run() {
// TODO Auto-generated method stub
try{
m_logger.debug("Invoked DistributedLoaderAgent");
MetadataTranslatorService service = new MetadataTranslatorService(false, "LPA");
m_logger.debug("Invoking service.loadLPACache");
service.loadLPACache(partDumpFileName);
}catch(Exception e){
m_logger.debug("Exception in DistributedLoaderAgent " + e.getMessage());
@Override
public void readExternal(PofReader arg0) throws IOException {
// TODO Auto-generated method stub
setPartDumpFileName(arg0.readString(0));
@Override
public void writeExternal(PofWriter arg0) throws IOException {
// TODO Auto-generated method stub
arg0.writeString(0, getPartDumpFileName());
Please assist.OK I have two suggestions.
1. Always create and flush the ObjectOutputStream before creating the ObjectInputStream.
2. Always close the output before you close the input. Actually once you close the output stream both the input stream and the socket are closed anyway so you can economize on this code. In the above you have out..writeObject() followed by input.close() followed by out.close(). Change this to out.writeObject() followed by out.close(). It may be that something needed flushing and the input.close() prevented the flush from happening. -
Java.io.StreamCorruptedException (APPLET SERVLET Communication)
Hi There,
I have an applet which calls the servlet over httpconnection and sends serialized object to the servlet.
It works fine but during heavy load it throws following exception but the application doesnot break :-
[8/5/09 7:36:09:498 EDT] 292c510e SystemErr R java.io.StreamCorruptedException
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.util.HashMap.readObject(HashMap.java:1172)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1003)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.cisco.swc.applications.dlm.servlet.MigrationReportServlet.doPost(MigrationReportServlet.java:53)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.cisco.tools.filter.AccessLogFilter.doFilter(AccessLogFilter.java:114)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.netegrity.was511.filter.ServletFilter.doFilter(ServletFilter.java:72)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1027)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:544)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:210)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:139)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:332)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:254)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:657)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:453)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
Any pointers would be of great help.
ThanksFirst, your singleton is not threadsafe, second because it's overly complicated. Simply eagerly initialize it.
Third: why don't you use the Session or a request parameter to handle your data?
Fourth: are you sure the serialized data is correctly written? -
Problematic frame: # J java.nio.MappedByteBuffer.load()
Helo all...
I'm getting an error when generating a PDF using BIRT Framework in Eclipse. Nothing fancy, just compiling a simple report to pdf.
The problem is, the JVM crashes with the following error:
# A fatal error has been detected by the Java Runtime Environment:
# EXCEPTION_IN_PAGE_ERROR (0xc0000006) at pc=0x0190f0be, pid=5848, tid=2392
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) Client VM (23.5-b02 mixed mode, sharing windows-x86 )
**# Problematic frame:
# J java.nio.MappedByteBuffer.load()Ljava/nio/MappedByteBuffer;**
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
# An error report file with more information is saved as:
# C:\Users\luis\Desktop\teste\birt\hs_err_pid5848.log
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
I already tried:
1. Run the program in another computers - it worked
2. Reinstall Java on the computer - It did nothing
3. I check the integrity of the disk C: - Nothing
I already spent two days trying to fix this and I don't have any progress. I can't find a solution on the web either.
Thanks in advanceThanks for the help.
But it can not be related to BIRT because it works in every other computer that I tried so far. There is only one computer that not works properly.
If it were BIRT's fault, it wouldn't work in any computer.
Thanks again -
Error Message - java.lang.LinkageError: loader constraint violation
Hi
I get the following errormessage if I try to apply a more recent build of the JPA Toplink Essentials.
If I use the glassfish-persistence-installer-v2-b45.jar all things work fine, but if a try to upgrade my program will fail. I tried the glassfish-persistence-installer-v2-b54.jar, all also tried all builds between?!
I have no idea how I may resolve the problem?!
Any ideas?
Thanks
Marcel
(I am using Java 6, Netbeans 5.5)
Exception in thread "AWT-EventQueue-0" java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "DatenStruktur.ConditionBasic.getCouplingElement()LDatenStruktur/CouplingElement;" the class loader (instance of oracle/toplink/essentials/internal/ejb/cmp3/JavaSECMPInitializer$TempEntityLoader) of the current class, DatenStruktur/ConditionBasic, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for interface DatenStruktur/Conditionable have different Class objects for the type DatenStruktur/CouplingElement used in the signature
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getDeclaredFields(PrivilegedAccessHelper.java:204)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataHelper.getFields(MetadataHelper.java:443)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor.usesPropertyAccess(MetadataDescriptor.java:1081)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessors(ClassAccessor.java:564)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:498)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor.processAccessor(MetadataAccessor.java:514)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processTableAndInheritance(ClassAccessor.java:1388)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:484)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:240)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:370)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:600)
at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:169)
at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:237)
at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:253)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:140)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java):96)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java):73)
at MainProgramManagement.ProgramMain.getEntityManagerFactory(ProgramMain.java:347)
at MainProgramManagement.ProgramMain.persistData(ProgramMain.java:788)upgrade to cf8, which supports jdk 1.6.
mx7 does not support 1.5 or 1.6
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
Hello,
Whenever I try to visit websites that have a java applet I get a dialogue with the following error:
java.lang.ClassNotFoundException: loader.class.
I have tried uninstalling/reinstalling java, and also adding the -xmx and -xms parameters for java applet runtime setting in control panel with various values from 128m to 1g.
The applet at http://www.java.com/en/download/installed.jsp?detect=jre&try=1 does work and reports "CONGRATULATIONS, you have the Latest version of Java!", "Java Runtime Version 1.6.0."
I have been experiencing this problem ever since I installed Windows Vista Home Premium a day or two ago. Any help is appreciated.
Regards
Greg
=====================================
Full output from Java Console
=====================================
Java Plug-in 1.6.0
Using JRE version 1.6.0 Java HotSpot(TM) Client VM
User home directory = C:\Users\Greg Taylor
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
load: class loader.class not found.
java.lang.ClassNotFoundException: loader.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
java.lang.ClassNotFoundException: loader.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 moreive been having the same problems, if youve resolved this problem, please tell me.
all help is appreciated -
I have an applet which calls a JSP to write data object to the db and then the
JSP sends back the updated data object. The writing part is ok but the response
is giving the following error. The data object is in a separate class which implements
Serialized.
Here's the code in the applet calling the JSP and the response from the JSP
URL server = null;
String urlConnectionString = "http://localhost:7001/isLoginValid.jsp";
try
server = new URL(urlConnectionString);
catch(MalformedURLException e)
System.out.println("URL exception: " + e );
// send request
ObjectInputStream response = null;
Object result = null;
try
URLConnection conn = server.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type", "application/octet-stream");
ObjectOutputStream request = new ObjectOutputStream(new
BufferedOutputStream(conn.getOutputStream()));
request.writeObject((Object)dvo);
request.flush();
request.close();
// get the result input stream
response = new ObjectInputStream(new BufferedInputStream
(conn.getInputStream()));
// read response back from the server
result = response.readObject();
if( result!=null && (result instanceof DataVO))
dvo = (DataVO)result;
String vo = dvo.printDataVO();
System.out.println("*DataVO*\n"+vo);
else
System.out.println("not an instanceof DataVO");
catch(IOException ignored)
System.out.println("Error in DataVO response");
ignored.printStackTrace();
Here's the code in the JSP sending the response back to the applet. The 'dvo'
object is the object which is serialized and has gets and sets for the diff. data
elements. When I print the 'dvo' before writing the object to outputStream it
prints the correct values for the data element.
// send response
response.setStatus(HttpServletResponse.SC_OK);
ObjectOutputStream outputStream = new ObjectOutputStream (new BufferedOutputStream
(response.getOutputStream()));
outputStream.writeObject(dvo);
outputStream.flush();
ERROR is as follows:
Error in DataVO response
java.io.StreamCorruptedException: InputStream does not contain a serialized object
at java/io/ObjectInputStream.readStreamHeader
at java/io/ObjectInputStream.<init>
What am I doing wrong?. Please respond soon. The applet is run on IIS and the
JSP in on weblogic 6.1. I'm not sure if that makes any difference.
I have an applet which calls a JSP to write data object to the db and then the
JSP sends back the updated data object. The writing part is ok but the response
is giving the following error. The data object is in a separate class which implements
Serialized.
Here's the code in the applet calling the JSP and the response from the JSP
URL server = null;
String urlConnectionString = "http://localhost:7001/isLoginValid.jsp";
try
server = new URL(urlConnectionString);
catch(MalformedURLException e)
System.out.println("URL exception: " + e );
// send request
ObjectInputStream response = null;
Object result = null;
try
URLConnection conn = server.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type", "application/octet-stream");
ObjectOutputStream request = new ObjectOutputStream(new
BufferedOutputStream(conn.getOutputStream()));
request.writeObject((Object)dvo);
request.flush();
request.close();
// get the result input stream
response = new ObjectInputStream(new BufferedInputStream
(conn.getInputStream()));
// read response back from the server
result = response.readObject();
if( result!=null && (result instanceof DataVO))
dvo = (DataVO)result;
String vo = dvo.printDataVO();
System.out.println("*DataVO*\n"+vo);
else
System.out.println("not an instanceof DataVO");
catch(IOException ignored)
System.out.println("Error in DataVO response");
ignored.printStackTrace();
Here's the code in the JSP sending the response back to the applet. The 'dvo'
object is the object which is serialized and has gets and sets for the diff. data
elements. When I print the 'dvo' before writing the object to outputStream it
prints the correct values for the data element.
// send response
response.setStatus(HttpServletResponse.SC_OK);
ObjectOutputStream outputStream = new ObjectOutputStream (new BufferedOutputStream
(response.getOutputStream()));
outputStream.writeObject(dvo);
outputStream.flush();
ERROR is as follows:
Error in DataVO response
java.io.StreamCorruptedException: InputStream does not contain a serialized object
at java/io/ObjectInputStream.readStreamHeader
at java/io/ObjectInputStream.<init>
What am I doing wrong?. Please respond soon. The applet is run on IIS and the
JSP in on weblogic 6.1. I'm not sure if that makes any difference.
-
Help I can't get Java to down load !
Hello BROitsJAMIE,
Thanks for using Apple Support Communities.
I'd like you to please follow the troubleshooting in the article linked to below in order to resolve this issue with your Mail.
OS X Mail: Troubleshooting sending and receiving email messages
Take care,
Alex H. -
Getting "java.io.StreamCorruptedException: invalid stream header"
When creating a self made Stream (MacInputStream) and then using an ObjectInputStream over it to read Objects from a socket, I get this error:
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
at TServidor.run(TServidor.java:32)
Is there any special feature that the "self-made" streams have to implement to be possible to use ObjectInput streams over them :P ?
Here is the MacInputStream.java code:
import java.io.Closeable;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import javax.crypto.Mac;
public class MacInputStream extends FilterInputStream implements Closeable{
private Mac mac; // algorithm
private byte [] mmac; //message MAC
private boolean FIRST_TIME;
public MacInputStream(InputStream is,Mac mac) {
super(is);
this.mac=mac;
FIRST_TIME=true;
public int read() throws IOException{
if(FIRST_TIME){
mmac = new byte [mac.getMacLength()];
super.read(mmac);
if(super.in.available()==0){
FIRST_TIME=true;
return -1;
int rbyte = super.in.read();
FIRST_TIME=false;
mac.update((byte)rbyte);
System.out.println("available: "+super.in.available());
if(super.in.available()==0){
byte [] macres =mac.doFinal();
System.out.println("message MAC: "+new String(mmac));
System.out.println("calculated MAC: "+new String(macres));
if(!Arrays.equals(macres, mmac)){
throw new IOException("violated integrity");
return rbyte;
public int read(byte [] b) throws IOException{
if(FIRST_TIME){
mmac = new byte [mac.getMacLength()];
super.in.read(mmac);
if(super.available()==0){
FIRST_TIME=true;
return -1;
int rbytes = super.in.read(b);
FIRST_TIME=false;
mac.update(b);
if(super.available()==0){
byte [] macres =mac.doFinal();
if(!Arrays.equals(macres, mmac)){
throw new IOException("violated integrity");
return rbytes;
}And here is the "main" function where the exception gets thrown:
public void run() {
try {
ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
Mac mac = Mac.getInstance("HmacMD5");
Key key = KeyGenerator.getInstance("HmacMD5").generateKey();
oos.writeObject(key);
oos.flush();
mac.init(key);
ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));
String test;
try {
while (true) {
test = (String)cis.readObject();
System.out.println(ct + " : " + test);
} catch (EOFException e) {
System.out.println("["+ct + "]");
} finally {
if (cis!=null) cis.close();
if (oos!=null) oos.close();
} catch (Exception e) {
e.printStackTrace();
}It's exactly in the line: ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));Any ideas?
I'm starting to desperate :P(a) I still don't see where you are writing the MAC that you're reading. You're reading something, but it's all or part of the Object stream header I described above, which is why ObjectInputStream' constructor is throwing that exception.
(b) You don't need to override read(byte[] b) when you extend FilterInputStream, but you do need to override read(byte[] b, int offset, int length), and you need to do it like this:
public int read(byte[] buffer, int offset, int length) throws IOException
int count = 0;
do
int c = read();
if (c < 0)
break;
buffer[offset+count++] = (byte)c;
} while (count < length && available() > 0);
return count > 0 ? count : -1;
}This way the read() method gets to see every byte that's read and to do its MAC thing or whatever it does. The above is one of only two correct uses of available() in existence: it ensures that you only block once while reading, which is the correct behaviour e.g. on a network. -
Java.io.StreamCorruptedException: invalid stream header
I am having a problem with sending two objects (over a socket). I have read in other posts that this could be due to trying to receive incompatible data types but my applications work fine if I send my objects synchronously rather than asynchronously.
I will try my best to describe what my problem is as my code is very long.
I have a server and a client application (2 apps). Multiple clients connect to the server and send their details (as an object) to the server. The server then amends the object (adds some more data) and sends it back to the clients. Both the SendObject and ReceiveObject class are threads and I have created a Listener (within the client) that activates when an object is received (asynchronous communication). The Listener method looks to see if the event is an instance of a particular class and casts is as appropriate (as per below).
public void receivedObject(ReceivedObjectEvent e) {
ReceiveObjectThread obj = (ReceiveObjectThread) e.getObject();
if(obj.getObject() instanceof Player) {
thePlayer = (Player) obj.getObject();
theTable.setHandData(thePlayer.getHand());
if(obj.getObject() instanceof GameData) {
gameData = (GameData) obj.getObject();
theTable.setPlayerList(gameData.getOpponents());
}The objects that are passed between applications both implement Serializable.
This all works fine synchronously object passing. However, if I try and spawn two sendObject threads within the server and the corresponding two receive threads within the client and wait for the Listener to activate (asynchronously) I get the following error:
java.io.StreamCorruptedException: invalid stream header: 00057372
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at ReceiveObjectThread.run(ReceiveObjectThread.java:84)
java.io.StreamCorruptedException: invalid stream header: ACED0006
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at ReceiveObjectThread.run(ReceiveObjectThread.java:84)
I am sure that this problem is due to my limited knowledge on socket and data transfer. Therefore any help on this one will be gratefully received.Hello ejp, your reply is very much appreciated.
If I explain how I have implemented my sockets you may be able to see where I wrong.
When a player connects, the client sends the server a �player� object. The server receives the �player� object and passes the socket from which it connected (within the server) to a socket property within the �player� class. Whenever the server needs to send an object to that client (player), it sends the output stream from the socket property within that �player� object. ( player.getSocket().getOutputStream() ).
Below is the code from the �SendObjectThread� class.
* This class allows an object to be passed over a Socket
* @author Harold Clements
* @version 1.0.1 12-Jun-2007 (12-Jul-2007)
//http://www.seasite.niu.edu/cs580java/Object_Serialization.html
public class SendObjectThread extends Thread {
private OutputStream out;
private Object obj;
* This constructor allows the user to passes the two parameters for transmitting.
* @param out The data stream that the object is going to be sent to.
* @param obj The object to be sent.
public SendObjectThread(OutputStream out, Object obj) {
this.out = out;
this.obj = obj;
* The main thread
public void run() {
try {
ObjectOutputStream objOut = new ObjectOutputStream(out);
objOut.writeObject(obj);
objOut.flush();
} catch (IOException e) {
e.printStackTrace();
}The client only has one socket which is defined when the client first makes a connection with the server. The �getOutputStream()� and �getInputStream()� are used for all communication from the client.
Is this what you described in your first option?
The funny thing about it all is if I create a new �receiveObjectTread� and wait for that to finish, then create another �receiveObjectTread� both objects in question (Player and GameData) are received correctly and the application works. I only have the problem when I set both threads off and leave it for the �ReceivedObjectEvent� listener to pick them up and cast them (as per my first post).
Thanks again for your help,
Harold Clements -
Java.io.StreamCorruptedException: Type code out of range, is 63
Hi,
i ma using Weblogic 7.0 ......... I got one exception in the weblogic log, Exception is as follows -
####<Nov 28, 2006 3:15:54 PM EST> <Info> <EJB> <atnyprd5>
<XXXServer1> <ExecuteThread: '83' for queue: 'default'> <kernel identity>
<11864:d63651c3623375dd> <010051> <EJB Exception during invocation from home:
[email protected]53 threw exception:
com.xxxxxx.exception.XXXXXXEJBException: MSG: javax.naming.CommunicationException
[Root exceptionis java.rmi.UnmarshalException: cannot unmarshaling return; nested exception is: 1990
java.io.StreamCorruptedException: Type code out of range, is 63]null TIME: 0> 1991
com.xxxxxx.exception.xxxxxxEJBException: MSG: javax.naming.CommunicationException
[Root exception is java.rmi.UnmarshalException: cannot unmarshaling return; nested exception is: 1992
java.io.StreamCorruptedException: Type code out of range, is 63]null TIME: 0 1993
at com.xxxxxx.util.EJBUtil.handleSysError (EJBUtil.java:40) 1994
at com.xxxxxx.util.EJBUtil.handleSysError (EJBUtil.java:59) 1995
at com.xxxxxx.db.DbAccess.initConnection (DbAccess.java:98) 1996
at com.xxxxxx.db.DbAccess.<init>(DbAccess.java:37)
I am getting this exception while fetching a datasource connection from the connection pool of weblogic.
My applciation is running for past 2 years and we did not got this exception before, So I suspect there is no problem in the code......... where it is going wrong ????
Please help me in this......
Thanks and regardsHi,
atleast any idea about what the exception is and what it is related to ???
Its bit urjent to resolve
Thankx and Regards -
Java.io.StreamCorruptedException: Type code out of range, is -20
Hi ,
When i am connecting from a client to an EJB running in Weblogic on the localhost , I got the follwoing exception.
GENERAL-EXCEPTION: java.rmi.UnmarshalException: failed to unmarshal cookie; nest
ed exception is:
java.io.StreamCorruptedException: Type code out of range, is -20
java.rmi.UnmarshalException: failed to unmarshal cookie; nested exception is:
java.io.StreamCorruptedException: Type code out of range, is -20
java.io.StreamCorruptedException: Type code out of range, is -20
at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1551)
at java.io.ObjectInputStream.refill(ObjectInputStream.java:1679)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:278)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:140)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:91)
at weblogic.rjvm.ResponseImpl.getReplicaInfo(ResponseImpl.java:171)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:264)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:229)
Can anyone tell what this type code -20 is?www.google.com is your friend.
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Type+code+out+of+range%2C+is+-20&btnG=Google+Search -
Hello! please help me, thanks! I'm Chinese.first to the sun forums.My English is bad,so sorry!
你好!感谢你的帮助!第一次来到sun 论坛来提问,很激动啊,呵呵。
java.io.StreamCorruptedException: invalid type code: 6A
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at controller.NetController$Receiver.run(NetController.java:88)
at java.lang.Thread.run(Thread.java:619)
java.io.StreamCorruptedException: invalid type code: 6A
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at controller.NetController$Receiver.run(NetController.java:88)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "Thread-3" java.lang.NullPointerException
at controller.DoubleModeController.updateYourCtrl(DoubleModeController.java:127)
at controller.DoubleModeController.receiveObj(DoubleModeController.java:123)
at controller.NetController$Receiver.run(NetController.java:92)
at java.lang.Thread.run(Thread.java:619)
下面是NetCotroller类的一个内部类,负责接收数据:
This is a inner class of NetCotroller class, it receive datas:
Java code
private class Receiver implements Runnable {
@Override
public void run() {
while(isRunning) {
ObjectInputStream ois = null;
try {
byte[] receiveBytes = new byte[1024*2];
dp = new DatagramPacket(receiveBytes, receiveBytes.length);
ds.receive(dp);
System.out.println("receive ...@_@");
ByteArrayInputStream bais = new ByteArrayInputStream(receiveBytes);
ois = new ObjectInputStream(bais);
//到下面这句时,就抛出了那异常!
// this sentence throw the Exception
receiveObj = ois.readObject();
ois.close();
ncl.receiveObj((Object[])receiveObj);
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}1.
I changed the code to this(when datagram was fragmented, just leave it alone,and back to "ds.receive(dp);" ):
Is it OK?
private class Receiver implements Runnable {
@Override
public void run() {
boolean isCorrupted = false;//changed
while(isRunning) {
isCorrupted = false;//changed
ObjectInputStream ois = null;
Object o = null;
try {
byte[] receiveBytes = new byte[1024*5];
dp = new DatagramPacket(receiveBytes, receiveBytes.length);
ds.receive(dp);
ByteArrayInputStream bais = new ByteArrayInputStream(receiveBytes);
ois = new ObjectInputStream(bais);
o = ois.readObject();
} catch (IOException e) {
isCorrupted = true;//changed
System.out.println(o);
System.out.println("IOException---NetController--receiver");
// e.printStackTrace();
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException---NetController--receiver");
if(!isCorrupted) {//changed
System.out.println("receive ...@_@..." + Arrays.toString((Object[])o));
ncl.receiveObj((Object[])o);
}2.Is there a src of "Russia Block of Net"?Please send it to my e-mail ([[email protected]|mailto:[email protected]]), thank you very much!
Edited by: HolleWorld on Jan 2, 2010 1:51 AM -
Help needed!
I'm using WLS6.1 with SP1.
Calling weblogic.deploy on command line causes the following exceptions no
matter if i'm using list or deploy option:
java weblogic.deploy -port 7501 list 12345678
java.io.StreamCorruptedException: Type code out of range, is 0
at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1280)
at
java.io.ObjectInputStream.SkipToEndOfBlockData(ObjectInputStream.java:1211)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:776)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:107)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:115)
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:686)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested
exception:
[java.io.StreamCorruptedException: Type code out of range, is 0]
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:688)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
JNDI naming exception: Naming exception trying to connect to:
t3://localhost:7501 as: system: beaadminyes, that was the reason.
thank you very much!
"Dimitri Rakitine" <[email protected]> schrieb im Newsbeitrag
news:[email protected]...
That sounds like you use 1.2 on the client side - make sure that you use1.3.
>
In weblogic.developer.interest.ejb Nora Serinek <[email protected]>
wrote:
Help needed!
I'm using WLS6.1 with SP1.
Calling weblogic.deploy on command line causes the following exceptionsno
matter if i'm using list or deploy option:
java weblogic.deploy -port 7501 list 12345678
java.io.StreamCorruptedException: Type code out of range, is 0
at
java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1280)
at
java.io.ObjectInputStream.SkipToEndOfBlockData(ObjectInputStream.java:1211)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:776)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
atjava.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:107)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:115)
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:686)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
atweblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
Code)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - withnested
exception:
[java.io.StreamCorruptedException: Type code out of range, is 0]
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:688)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
atweblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
Code)
JNDI naming exception: Naming exception trying to connect to:
t3://localhost:7501 as: system: beaadmin--
Dimitri -
UnmarshalException followed by java.io.StreamCorruptedException
package Jdbcpgms;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import java.io.*;
import java.util.*;
import weblogic.jndi.*;
* @author owner
public class DataSourceClient {
/** Creates a new instance of DataSourceClient */
public DataSourceClient() {}
public static void main (String [] args){
try{
TestDataSource testDS = new TestDataSource();
testDS.setDataBaseServer("http://jdbc:odbc:oracle:thin:@localhost:1521:MKPAppDB");
testDS.setDatabasePort(1521);
testDS.setDataBaseName("MKPAppDB");
//Context ctx = new InitialContext();
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context ctx = new InitialContext(ht);
ctx.rebind("MKPAppDB", testDS);
testDS = null;
testDS=(TestDataSource)ctx.lookup("dn=MKPAppDB");
Connection conn = testDS.getConnection("scott", "tiger");
System.out.println("DataSourc returned, bound to "+ testDS.getDataBaseServer()
+ ":" testDS.getDatabasePort()
":" + testDS.getDataBaseName());
catch(Exception e){
e.printStackTrace();
Above is the Client I use to create a context and bind my database to context.
I get below exception. Also I have attached my TestDataSource. please take a
look If you have solution to run my lient.
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
on: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:83)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl
.java:385)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:136)
at javax.naming.InitialContext.rebind(InitialContext.java:363)
at Jdbcpgms.DataSourceClient.main(DataSourceClient.java:37)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested
ex
ception is:
java.io.StreamCorruptedException
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
ava:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:284)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:244)
at weblogic.jndi.internal.ServerNamingNode_811_WLStub.rebind(Unknown Sou
rce)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:134)
... 2 more
Caused by: java.io.StreamCorruptedException
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:150
6)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:111)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
C:\java\j2sdk1.4.2\bin>javac C:\java\muthu\src\jdbcpgms\DataSourceClient.java
d C:\java\muthu\classes
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
javax.naming.CommunicationException [Root exception is java.net.ConnectException
: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:47)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLIni
tialContextFactoryDelegate.java:623)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:301)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:234)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at Jdbcpgms.DataSourceClient.main(DataSourceClient.java:36)
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachab
le; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:199)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:291)
... 7 more
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
javax.naming.CommunicationException [Root exception is java.net.ConnectException
: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:47)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLIni
tialContextFactoryDelegate.java:623)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:301)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:234)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at Jdbcpgms.DataSourceClient.main(DataSourceClient.java:36)
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachab
le; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:199)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:291)
... 7 more
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
[TestDataSource.java]Hi,
By putting 'TestDataSource' class in server classpath sould solve the problem.
Also , if u can, just try with weblogic 6.1 and post the exception.
Maybe you are looking for
-
Dear All, Please throw some light on the concept of valuation and explain with simple example difference between lowest value principle, strict lowest value principle and other valuation method. I tried to find it on help.sap but I'm not able to comp
-
Text display slanted in the middle nokia 5800
nokia 5800 displays text or menus in a bit tilted manner in the middle part of the screen whereas it is straight at the ends.movies play fine without the tilt.tried formatting the phone but same problem persists help please!
-
Calling Web Form from Client-Server Form
Hi. I have an existing Client-Server Form (6i) still in production that needs to call a Web Form and pass it a parameter. Obviously I can't use Call Form or New Form from the client-server version, but can I somehow issue a command line (including a
-
IR posting without DCIn happening for PO
Hi Gurus, I have a scenario, where the Invoice Receipt is happening without DCIn(Del. Cost Invoice) in Purchase Order, we were expecting a error for Exchange rate while posting the IDoc. Is there any setting or a way to determine the solution. Please
-
Including the internal table in Srcript Form
Hi all i am collecting all the data into an internal table in the print program of the Script, now i want to pass that internal table under the text element DELPOS. so my internal table contain item data, so i want every item to be printed on the for