Bug? [BANano] Server cannot compile

Heuristx

Active Member
Licensed User
Longtime User
Does anyone know some workaround?

Compiler error:

src\b4j\example\servercorsfilter.java:115: error: no suitable constructor found for FilterHolder(Class<CAP#1>)
FilterHolder fh = new FilterHolder((Class<? extends Filter>) Class.forName("org.eclipse.jetty.servlets.CrossOriginFilter"));
^
constructor FilterHolder.FilterHolder(Source) is not applicable
(argument mismatch; Class<CAP#1> cannot be converted to Source)
constructor FilterHolder.FilterHolder(Class<? extends jakarta.servlet.Filter>) is not applicable
(argument mismatch; Class<CAP#1> cannot be converted to Class<? extends jakarta.servlet.Filter>)
constructor FilterHolder.FilterHolder(jakarta.servlet.Filter) is not applicable
(argument mismatch; Class<CAP#1> cannot be converted to jakarta.servlet.Filter)
where CAP#1 is a fresh type-variable:
CAP#1 extends javax.servlet.Filter from capture of ? extends javax.servlet.Filter
 

alwaysbusy

Expert
Licensed User
Longtime User
I assume you are using BANanoServer? It has not been updated to jServer 4 yet, but you should be able to do it yourself with these steps:

1. unzip BANanoServer.b4xlib
2. In SERVERCorsFilter.bas replace:

B4X:
import javax.servlet.DispatcherType;
import javax.servlet.Filter;

with:

B4X:
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;

3. zip again to BANanoServer.b4xlib

Alwaysbusy
 
Top