In LS2J, when I use a JavaSession.GetClass to get a class, it finds the class correctly, but when I use a JavaClass.GetMethod that uses the same class in its signature, it throws a ClassNotFoundException in this class.
Does somebody know why?
This is an example (not the real code):
Dim objJSession As New JavaSession
Dim objJClass1 As JavaClass
Dim objJClass2 As JavaClass
Dim objJMethod As JavaMethod
Set objJClass1 = objJSession.GetClass(“java.io.BufferedOutputStream”) '>>>Here it finds the class correctly
Set objJClass2 = objJSession.GetClass(“MyClass”);
Set objMethod = objJClass2.GetMethod(“myMethod”,“(Ljava/io/BufferedOutputStream;)V”) '>>>Here it throws a ClassNotFoundException
Any help will be appreciated.
Thanks in advance.
Ricardo.
Subject: ClassNotFoundException with LS2J
try it this way
Set jSession = New JavaSession()
Set gPInfo = jSession.GetClass(“appSalesReps”)
Set chObject1 = gPInfo.CreateObject(“()V”)
//writeText is the methode
writeFile = chObject1.writeText(hDB1, doc.fName(0), doc.lName(0), gPhone1, doc.Add1(0), doc.Add2(0), doc.City(0), hState, doc.Zip(0), doc.Country(0), gWhereHearCode)
Subject: RE: ClassNotFoundException with LS2J
Michael,
I can’t do it, because “MyClass” is abstract and the method I need to invoke is static, so I don’t have a JavaObject object of “MyClass” to call the method straight from the object.
Any other idea?
Thanks in advance.
Ricardo Lucio
Subject: RE: ClassNotFoundException with LS2J
can you send to me the code that you are using?I will try to see if I can make it work on my end, then send it back to you