baloise / proxy

An minimal authenticating HTTP(S) forward proxy based on https://github.com/adamfisk/LittleProxy. You can easily add sniffing / rewriting if needed. In short: Fiddler in Java
Eclipse Public License 2.0
4 stars 3 forks source link

Proxy not running with Java 17 #17

Closed whvneo closed 11 months ago

whvneo commented 11 months ago

We are facing an issue with Java 17

java -jar proxy.jar
starting
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
        at common.Crypto.base64encode(Crypto.java:10)
        at common.Crypto.encrypt(Crypto.java:34)
        at common.Crypto.userEncrypt(Crypto.java:20)
        at common.Password.set(Password.java:44)
        at common.Password.showDialog(Password.java:30)
        at common.Password.get(Password.java:54)
        at com.baloise.proxy.Proxy.start(Proxy.java:36)
        at com.baloise.proxy.Proxy.main(Proxy.java:50)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 8 more

The solution is to provide JAXB dependency in pom.xml

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.1</version>
    </dependency>
culmat commented 11 months ago

Hi @whvneo, thanks for reporting. This issue should be fixed since https://github.com/baloise/proxy/commit/6c500f6 Can you please try updating your proxy version with

if not exist %userprofile%\.proxy mkdir %userprofile%\.proxy

powershell -Command "$proxy = [System.Net.WebRequest]::GetSystemWebProxy();$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials;$wc = new-object system.net.WebClient;$wc.proxy = $proxy;$wc.DownloadFile('https://jitpack.io/com/github/baloise/proxy/win64-SNAPSHOT/proxy-win64-SNAPSHOT.jar', '%USERPROFILE%/.proxy/proxy.jar');"

( replace win64 with mac64 or lin64 as appropriate ) Regards, Matthias

whvneo commented 11 months ago

Hi @culmat

it works. Thx for the quick fix