Beans go boom in VB app on shutdown

Installed on Windows NT 4 (SP5):

-

1) JRE 1.3.1

2) BDK 1.1

3) Java Plugin 1.1

Steps to see behavior:

1) Run PackageBean.bat to run ActiveX Packager for Beans

2) Select the molecule.jar file in the \BDK\jars directory (note: typing in directory tends to screw up app, so use mouse based selection)

3) Hit the "Next" button 3 times (i.e. accept defaults)

4) On final screen, uncheck the "Register the reg file" option (it always causes errors for me), then hit the "Start Generation" button.

5) Press ok to dismiss dialog indicating success

6) Navigate to \Java Plug-in 1.1\classes directory

7) Double-click the "molecule.reg" file to add information to registry

8) Double-click the "molecule.tlb" file to register the type library (note: if dialog displays asking for application, choose "Other..." button and type in c:\winnt\regtlib.exe)

9) Open up VB6 (sp3 or later) and Create new "Standard EXE" project.

10) Select the Projects->Components menu item

11) Find and select "Molecule Bean Control"

12) Add an instance of the Molecule control to the form

13) Run the application - everything should work

14) Stop the application, then close VB -->BOOM!

VB6.EXE - Application Error

The instrucation at "0x77f6754b" referenced memory at "0x00000027". The memory could not be "read".

The same behavior can be seen if an executable is created and run -or- if other beans are used. Why?

[1540 byte] By [psuthar] at [2007-9-26 8:44:09]
# 1
Try running it on JRE 1.3.0.
nphelps at 2007-7-1 19:33:52 > top of Java-index,Desktop,Deploying...
# 2

this is a fairly common posted problem here...

look here... http://forum.java.sun.com/thread.jsp?forum=40&thread=157223

i talk about vba here but i have had the same problem and resolution with straight vb too. essentially make your bean a subclass of some javax.swing class.

also note you only need to do this for the first object you are going to create in vb. for example...

class a extends JComponent

class b can be attained from a method of a does not need to extend any swing class.

i hope this helps. if not write back and i'll do my best tho' d$ would be an excellent motivator for this....

Guest at 2007-7-1 19:33:52 > top of Java-index,Desktop,Deploying...
# 3
If I am using the molecule.jar file that came with the BDK, how do I make the bean a subclass of some javax.swing class?Thanks for the reply!
psuthar at 2007-7-1 19:33:52 > top of Java-index,Desktop,Deploying...
# 4

That doesn't seem to work for me. I'm using JDK 1.3.1 and even after subclassing javax.swing.JComponent it still produces the problem in Visual Basic --and I am setting the object to Nothing. Incidentally, this problem doesn't occur with Python code that uses the winall module... odd hu? Any other ideas?

nphelps at 2007-7-1 19:33:52 > top of Java-index,Desktop,Deploying...
# 5
UPDATE1) Upgraded from Windows NT (SP5) to Windows 2000 (SP1)2) Downgraded from JRE 1.3.1 to JRE 1.3.03) Still using BDK 1.14) Still using Java Plugin 1.1Molecule bean control now runs in VB app with no shutdown problems!
psuthar at 2007-7-1 19:33:52 > top of Java-index,Desktop,Deploying...
# 6

> That doesn't seem to work for me. I'm using JDK 1.3.1

> and even after subclassing javax.swing.JComponent it

> still produces the problem in Visual Basic --and I am

> setting the object to Nothing. Incidentally, this

> problem doesn't occur with Python code that uses the

> winall module... odd hu? Any other ideas?

well i am not having this problem so...... what are the differences. i have sp6a for nt and sp2 for vs6. maybe you can try your bean\control in a macro first and see what that does. i think if you get the same memory error with the macro it is still something with the java but if not then it is vb. it certainly sounds more like vb.

last but not least if you are not already using it i have had much better luck with the international version of the jre than than the plain english version.

Guest at 2007-7-1 19:33:52 > top of Java-index,Desktop,Deploying...