B4J Question how to instantiate library objects exchange web service

Roberto P.

Well-Known Member
Licensed User
Longtime User
I can not instantiate objects, especially ExchangeService from the EWS library with JavaObject.


B4X:
Dim aExchangeService As JavaObject
    aExchangeService.InitializeNewInstance("microsoft.exchange.webservices.ExchangeService", Null)


I need to instantiate the class ExchangeService that is in the package package: microsoft.exchange.webservices.data.core;

the class name is: ExchangeService

then name of library is: ews-java-api-2.0.jar

someone can help me?


thank you
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi Erel
the constructor waits for a parameter. but it should also accept null value.

Here is the mistake that gives me:

main._btnstart_click (java line: 97)
java.lang.ClassNotFoundException: microsoft.exchange$webservices$data$ExchangeService
at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:288)
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:83)
at b4j.example.main._btnstart_click(main.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.BA$1.run(BA.java:215)
at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
 
Upvote 0
Top