Bug 98645 - Target (BeanInfo/Editor) should deal with System.exit()
Summary: Target (BeanInfo/Editor) should deal with System.exit()
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: VE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Orme CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-07 05:43 EDT by Markus Schweizer CLA
Modified: 2011-06-13 11:37 EDT (History)
3 users (show)

See Also:


Attachments
Java source code file with which error occured (2.66 KB, text/plain)
2005-06-07 05:54 EDT, Markus Schweizer CLA
no flags Details
log file (23.28 KB, text/plain)
2005-07-15 11:23 EDT, Jonathan Stinton CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schweizer CLA 2005-06-07 05:43:54 EDT
After pasting text into source code editor and saving the changes I got the
Message IWAV0138E:
Remote VM terminated too soon. See .log file for trace of output. For VM
"Project (Simulation1)-VM for Simulation1".
a few times. And then also a null pointer exception occured. After closing and
restarting eclipse the message and error rised again. Eclipse hangs up completly.
Comment 1 Markus Schweizer CLA 2005-06-07 05:54:17 EDT
Created attachment 22497 [details]
Java source code file with which error occured

after pasting line
>>> public native void initialisiereNativeCode(); <<<
and saving the message and error occured
Comment 2 Gili Mendel CLA 2005-07-15 10:47:27 EDT
Is this is still valid in the latest build?
Comment 3 Jonathan Stinton CLA 2005-07-15 11:07:56 EDT
yes, this is still very much valid... hosed everything several times over.  i'll
try to narrow down what exactly it is, all i hadd to do was open the attached
file with the VE.
Comment 4 Jonathan Stinton CLA 2005-07-15 11:21:40 EDT
problem is here:

static {
	try {
		System.loadLibrary("Simulation");
	} catch (UnsatisfiedLinkError e) {
		System.out.println(">>> Die Datei Simulation.dll konnte nicht gefunden werden!");
		System.exit(1);
	}
}
Comment 5 Jonathan Stinton CLA 2005-07-15 11:23:06 EDT
Created attachment 24840 [details]
log file

this is the log you get after uncommenting the above mentioned lines and
reloading the file.
Comment 6 Srimanth CLA 2005-07-15 17:29:00 EDT
Its pretty obvious that the remote VM is dead if an instance of this class is
created on it. There might as well be  
static{
  System.exit(1);
} 
code in the class. 

The question arises as to why an instance of this class was created? It turns
out that codegen tries to determine if it needs to create a THIS bean using
introspection at 
-----------------------------------
ThisReferenceRule.useInheritance(ThisReferenceRule.java:114)
-----------------------------------
and introspection for some reason might be trying to create an instance. 

The stacktrace of the codegen call is :
----------------------------------------------
java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
	at java.io.DataOutputStream.flush(DataOutputStream.java:101)
	at
org.eclipse.jem.internal.proxy.common.remote.Commands.sendGetClassCommand(Commands.java:1282)
	at
org.eclipse.jem.internal.proxy.remote.REMConnection.getClass(REMConnection.java:135)
	at
org.eclipse.jem.internal.proxy.remote.REMStandardBeanTypeProxyFactory.getClassReturn(REMStandardBeanTypeProxyFactory.java:389)
	at
org.eclipse.jem.internal.proxy.remote.REMStandardBeanTypeProxyFactory.createBeanTypeProxy(REMStandardBeanTypeProxyFactory.java:202)
	at
org.eclipse.jem.internal.proxy.remote.REMStandardBeanTypeProxyFactory.getBeanTypeProxy(REMStandardBeanTypeProxyFactory.java:368)
	at
org.eclipse.jem.internal.proxy.remote.REMStandardBeanTypeProxyFactory.getBeanTypeProxy(REMStandardBeanTypeProxyFactory.java:271)
	at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdapter.introspect(BeaninfoClassAdapter.java:754)
	at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdapter.introspectIfNecessary(BeaninfoClassAdapter.java:472)
	at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdapter.introspectIfNecessary(BeaninfoClassAdapter.java:459)
	at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdapter.getEStructuralFeatures(BeaninfoClassAdapter.java:1073)
	at
org.eclipse.jem.java.impl.JavaClassImpl.getEStructuralFeatures(JavaClassImpl.java:394)
	at org.eclipse.jem.java.impl.JavaClassImpl.getProperties(JavaClassImpl.java:1308)
	at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdapter.allProperties(BeaninfoClassAdapter.java:1202)
	at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdapter.getAllProperties(BeaninfoClassAdapter.java:1081)
	at
org.eclipse.jem.java.impl.JavaClassImpl.getAllProperties(JavaClassImpl.java:1349)
	at
org.eclipse.ve.internal.java.codegen.java.rules.ThisReferenceRule.useInheritance(ThisReferenceRule.java:114)
	at
org.eclipse.ve.internal.java.codegen.java.TypeVisitor.createThisIfNecessary(TypeVisitor.java:115)
	at
org.eclipse.ve.internal.java.codegen.java.TypeVisitor.visit(TypeVisitor.java:210)
	at
org.eclipse.ve.internal.java.codegen.java.JavaBeanModelBuilder.visitType(JavaBeanModelBuilder.java:512)
	at
org.eclipse.ve.internal.java.codegen.java.JavaBeanModelBuilder.build(JavaBeanModelBuilder.java:417)
	at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslator.reverseParse(JavaSourceTranslator.java:830)
	at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslator.decodeDocument(JavaSourceTranslator.java:910)
	at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslator.loadModel(JavaSourceTranslator.java:576)
	at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEditorPart$Setup.run(JavaVisualEditorPart.java:1977)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

---------------------------------------


For me the IDE is still working, but VE becomes useless as remote VM dies
constantly. Assigning to Joe to determine why introspection might be loading the
class. If I comment out the static{} block, everything works fine.
Comment 7 Joe Winchester CLA 2005-07-19 19:34:18 EDT
The class is loaded by the VM for the Project that does introspection to 
determine its shape. Istatic blocks are called on class load and during this 
it fails to load the library and exits the VM.
Ideally you should put your dll (or lib on Linux/Unix) into the library path.  
The only way to do this right now is for you to update the /lib directory of 
the JRE/SDK that you are using for the Project that you are working in.
Another thing that might work is to stop the exit, so try something like
} catch {
  if (!java.beans.Beans.isDesignTime()){
    System.exit(0);
  }
}
Having said that we should not freeze up quite so badly when the BeanInfo VM 
dies so rather than close this I will leave it open and defer to 1.2 so we can 
think of making the BeanInfo VM death more graceful