B4J Question I can'nt update to ABMaterial 5.0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi
my project can work in abmaterial 4.51(B4J 9.3) but I cann't run in abmaterial 5.0(B4J 9.8). ide always give me following error

Error occurred on line: 174 (ABMApplication) ==>> srvr.Start
B4X:
Error occurred on line: 174 (ABMApplication)
java.lang.NoSuchMethodError: org.eclipse.jetty.servlet.ServletHolder.<init>(Ljakarta/servlet/Servlet;)V
    at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:212)
    at com.jinyi.linegatemt.abmapplication._startserver(abmapplication.java:192)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at com.jinyi.linegatemt.main.main(main.java:29)
 

jinyistudio

Well-Known Member
Licensed User
Longtime User
B4X:
'Non-UI application (console / server application)
#Region  Project Attributes
    #CommandLineArgs:     
    #AdditionalJar: FontAwesome
    #AdditionalJar: MaterialIcons     
    #AdditionalJar: sqlite-jdbc-3.32.3.3
    #AdditionalJar: jtds-1.3.1.jar
    #MergeLibraries: True
#End Region

B4X:
Waiting for debugger to connect...
Unexpected event (missing RaiseSynchronousEvents): CREATE
java.lang.Exception: Stack trace
    at java.base/java.lang.Thread.dumpStack(Thread.java:1387)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:199)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at com.jinyi.linegatemt.jystring.<clinit>(jystring.java:17)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at anywheresoftware.b4a.shell.Shell$MethodCache.getMethod(Shell.java:847)
    at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:539)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:628)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at com.jinyi.linegatemt.main.<clinit>(main.java:17)
Program started.
----------------------
   Instapost V1.0
----------------------
Authorization exception: -97
> Please mail machine.sn Or online register
Start B4J Analyse!
When an error occurs, check the B4JAnalyse.log file in the Objects folder to see the last B4J line it was working on.
Collecting data from B4J source files... (1/2)
ABMShared.bas
afterregister.bas
DBM.bas
DBUtils.bas
FileUtils.bas
jyAuth.bas
jyString.bas
jyStyle.bas
ModalShared.bas
MyABM.bas
MyDB.bas
NetUtils.bas
Protection.bas
task.bas
ABMAceEditor.bas
ABMUploadHandler.bas
api.bas
Comparators.bas
CompStarRating.bas
ConfigurationItemSheet.bas
CSVParser.bas
customIFrame.bas
HTMLElement.bas
jyAbmPanel.bas
jyAbmPanels.bas
jyStLabelNum.bas
ABMCacheControl.bas
jyTeleLine.bas
MashCSS.bas
MashMacAddress.bas
MashStats.bas
MashWaterBall.bas
ABMCacheScavenger.bas
omxplayer.bas
SimpleGrid.bas
ABMCustomComponentTemplate.bas
timetable.bas
watchdog.bas
ABMDownloadHandler.bas
ABMErrorHandler.bas
ABMRootFilter.bas
about.bas
ABMApplication.bas
design.bas
devices.bas
linepost.bas
logview.bas
notifys.bas
profile.bas
registerform.bas
registers.bas
tickets.bas
tokens.bas
ABMPageTemplateAlternative.bas
instapost.b4j
Analysing data from B4J source files... (2/2)
loading D:\jylab\project\b4j\x64\instapost\Objects: copymewithjar.needs...
Using cache system: 3.0
Current App version: 1657846637470
Needs material/awesome icons
Building D:\jylab\project\b4j\x64\instapost\Objects\copymewithjar.js.needs
Building core.min.1657846637470.css...
2022-07-15 08:57:21.724:INFO :oeju.log:main: Logging initialized @4896ms to org.eclipse.jetty.util.log.Slf4jLog
PageNeedsUpload: /instapost/profile
PageNeedsUpload: /instapost/tokens
PageNeedsUpload: /instapost/registerform
PageNeedsUpload: /instapost/devices
PageNeedsUpload: /instapost/notifys
Error occurred on line: 173 (ABMApplication)
java.lang.NoSuchMethodError: org.eclipse.jetty.servlet.ServletHolder.<init>(Ljakarta/servlet/Servlet;)V
    at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:212)
    at com.jinyi.linegatemt.abmapplication._startserver(abmapplication.java:183)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at com.jinyi.linegatemt.main.main(main.java:29)
Lunch Instapost  on the windows
Viewer running on os: windows 10
Trying to open: http://localhost:8100/instapost/
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Jetty 11 is based on Jakarta Servlet 5.0, which is part of Jakarta EE 9.
Jakarta EE 9 underwent the "big bang" change to namespace and packaging, there is no longer a javax.servlet.* it is now jakarta.servlet.*.

So I would start to look if anywhere in your code you use maybe a JavaObject or inline Java that still uses javax.servlet instead of jakarta.servlet.
It may also be some other library that you use still uses it.

Alwaysbusy
 
Upvote 0
Top