This content has been marked as final. Show 10 replies
I am having the same problems, but since you don't give a lot of details, I at least wanted to give you some information that you might not have.
First of all, you have to create a jar file and a manifest file. You have to specify in the manifest file that this is a bean. Then you need to create a jar file. You also need to create the folders that are specified in your package. For example com.lastname.firstname, must have folder structure ...\firstname\lastname\com, it will create the package under your com folder.
Then you need to run the packager to generate the dll. The packager comes with Java sdk, but you need Visual C++ 6.0 SP3 or later to run it!!! Don't ask me why. I know, it's stupid.
C:\j2sdk1.4.2_04\bin>packager �out c:\j2sdk1.4.2_04\jre\axbridge\bin �reg c:\david\www\simplebean.jar SimpleBean
Then you need to register the dll using this command:
C:\j2sdk1.4.2_04\jre\axbridge\bin> c:\winnt\system32\regsvr32 SimpleBean.dll
You might have to create the axbridge if you don't already have it.
You should get a popup message saying:
DllRegisterServer in SimpleBean.dll succeeded.
So, this is how far I got. I am trying to call the bean from JScript, but I get a memory error.
PS, I am doing this on Windows 2000 Pro. Also make sure you have Classpath set.
You can find more info about this topic on this forum (although I don't think anyone is having any success with it):
Well, I hope this helps.
But how do I set the classpath? I got my simple test bean working (used in VisualBasic). But when I want to use a method of the bean that itself uses another class, I just get NoClassDefFoundError.
- setting system CLASSPATH environment variable
- copying the JAR with the external classes to %JRE%/lib/ext/
- using additonal "Class-Path:" entry in the manifest
- copied the JAR with external classes to %JRE%/axbridge/lib
- set "-cp ..." as VM parameter in the PLugin Control Panel
but nothing helps - my external class is not found! (The same bean methods work when used within a Java application, so the class is really in the external JAR and works).
Is there another way to set the classpath for ActiveX bridge?
Hmm, strange cause I would think what you did would have worked. did you 'echo %CLASSPATH%' and do you see the path you expect?
Did you try running it on the command line (java -cp <yourpath> ....)?
Do you have more than one bean in your Jar?
Is the bean called as a Main method?
Like I said, I am having problems myself running this but I figured I try to give you any help I could. You can check out my thread at:
If you have any suggestions, I would appreciate it!
Hmm, strange cause I would think what you did wouldYes, echoed %CLASSPATH% in DOS box and see the correct classpath.
have worked. did you 'echo %CLASSPATH%' and do you
see the path you expect?
Did you try running it on the command line (java -cpYes, the Java bean itself works also as expected (main() as application or used by other Java application).
Do you have more than one bean in your Jar?No. Just one simple bean with a few methods.
Is the bean called as a Main method?No. It just has simple get/set/callXYZ methods - nothing fancy.
Like I said, I am having problems myself running thisI'm going to visit it ...
but I figured I try to give you any help I could.
You can check out my thread at:
If you have any suggestions, I would appreciate it!Yep, it seems that there are still just few people using the ActiveX bridge. This forum is quite small. :-(
Seems like you have tried just about everything, and I am running out of suggestions.
This ActiveX is a Royal pain to use! Since Java is so popular these days, you would think they would make it easier to call javabeans/classes from other applications!
Thanks for your suggestions on my post, I will try them. If I still can't get it to work, I will try a different approach on my project since I can't spend too much more time on this. I would like to spend more time on it, but unfortunately there is a budget I have to stay within :-(
Do you have any other options, such as using IIS etc? It seems like there are more people using this. Have you looked into NJAWIN? I don't know much about it, but I have seen a few posts on it during my search for ActiveX. Check out this link:
I finally got it to work now. I deinstalled all versions of SDK/JRE of Java I previously had. Ensured that my test DLL ist not registered anymore and also not anywhere in the Windows registry. Rebootet and installed 1.5.0_01. I still got the ClassNotFoundExceptions until I copied my JAR into the JRE's lib/ext/ folder (which I've also done before). And finally, the classes were found.
But now I get a NoClassDefFoundError when I try to use a method that uses the reflection API. It can't find the className "java.lang.String" when I call
Yeah, this ActiveX bridge is still a pain in the ass ... :-(
Looks like you are doing some progress, and taking a step back at the same time! I am a little hesitant to installing 1.5 (which I assume is a Beta version) when they (Sun) can't even get an official release to work!
Maybe this would work better using MS SDK, have you tried this?
Looks like M$ also have some ActiveX tools that I wasn't aware of that might work. I am busy with other things so I can't test it out now, but if you are interested you can check out:
There are some ActiveX components in the drop down menu that might be of interest.
Nope, I haven't used the MS SDK, as Microsoft is not supporting Java anymore (the old tools just support the very old Java 1.1 VM of Microsoft).
1.5 is not beta anymore, indeed, the second version (1.5.0_01) was already released with some bugfixes.
After I got it to work yesterday, I still got several Automation Errors, ClassNotFoundErrors and found out, that only the very basic datataypes work, like String and numbers. Even though the ActiveX bridge guide (http://java.sun.com/j2se/1.5.0/docs/guide/beans/axbridge/developerguide/index.html) says that Java Objects can be used, I wasn't able to call methods that had an
parameter or arrays like
String, Object). In the end, I'm writing a wrapper now that only accepts strings and converts them in the Java bean to real Java types via reflection. I also read somewhere that the Microsoft COM model only support these basic datatypes, see also http://www.javaworld.com/javaworld/jw-09-1998/jw-09-bridge-p4.html
It seems that I am having the same problem and I just want to ask if someone found a fix already.
var currentTransaction = orderApplet.getTransaction();
var myList = new VBArray(currentTransaction.getOrders()));
When I tried to research the value of the parameter being used to pass inside the constructor of the VBArray, it states that the parameter should be a type of 'safeArray' which can come from an activeX control or an object.
I have been reading a lot of threads about the activeX bridge and the problem of Microsoft and Sun in making these two objects (beans/applets and activeX) communicate in MS IE 6. Unfortunately, I cannot find a concrete and more detailed solution to the problem that I am having. As an additional information, I have already downloaded the latest JRE from SUN which is the 1.5 version.
When I tried running this in a different machine with a MS Windows 2000/IE 5 environment, I did not encounter any problem. Can someone please give me an idea on how to make this thing work on a XP/IE 6 environment using the latest JRE (1.5)?
I will appreciate any help or advise that you can give me. I have been stuck in this problem in the past 4 days and forums or suggestions that I have found does not seem to solve this problem.
Thanks a Lot in advance.
I have bean which has a GUI and converted to dll. My converted dll is working fine in VB if the classes in my bean are dependent on the other classes. But if it depends on the classes from another jar it's giving NoClassDef found error. I tried all the solution posted on this forum. like placing all jars in jre\lib\et. Can any of succeeded in this conversion process. Does this activeX convesrion works properly?
I will really appreciate your reply.