com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into x folder - jxbrowser

Recently migrated to JxBrowser 7.0 and i have the following error coming every time i try to start the application .
com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0
at jxbrowser#7.0/com.teamdev.jxbrowser.internal.ChromiumExtractor.extract(ChromiumExtractor.java:45)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.extractChromiumBinaries(EngineImpl.java:386)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:156)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:96)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.initialize(WebBrowserTabController.java:191)
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:567)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.<init>(WebBrowserTabController.java:166)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createNewTab(WebBrowserController.java:180)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createAndAddNewTab(WebBrowserController.java:161)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.initialize(WebBrowserController.java:116)
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:567)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.<init>(WebBrowserController.java:99)
at XR3Player/com.goxr3plus.xr3player.application.MainLoader.lambda$startPart2$8(MainLoader.java:373)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:835)
It says caused by :
Caused by: java.io.FileNotFoundException: chromium-win64.7z, chromium-win32.7z
... 44 more
where is this coming from ? My project is a Maven project and i have added all the needed dependencies and on the start of application i have added the license key and the directory i want to browser to have it's files :
static {
// Chromium Extract Location Dir
System.setProperty("jxbrowser.license.key", "license_key");
System.setProperty("jxbrowser.chromium.dir",
DatabaseTool.getAbsoluteDatabaseParentFolderPathWithSeparator() + "Chrome" + "7.0");
}
Enabling JxBrowser Logger :
01:19:49.837 DEBUG Verifying Chromium binaries...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.839 DEBUG Verifying Chromium binaries... [FAIL]
01:19:49.839 DEBUG Finding Chromium binaries in JARs...
01:19:49.839 DEBUG Finding WIN_64...
01:19:49.840 DEBUG Finding WIN_64... [FAIL]
01:19:49.840 DEBUG Finding WIN_32...
01:19:49.840 DEBUG Finding WIN_32... [FAIL]
Maven Dependencies :
<!-- CHROMIUM BROWSER -->
<dependency>
<groupId>com.teamdev.jxbrowser</groupId>
<artifactId>jxbrowser-win64</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>com.teamdev.jxbrowser</groupId>
<artifactId>jxbrowser-javafx</artifactId>
<version>7.0</version>
</dependency>

I believe this happens when you set up the project in an IDE and add the jxbrowser dependencies as libraries. For me, intellij did not recognize the os specific chromium jar as a valid jar directory. It did not place this jar in the classpath.
In my case, the resource not found was -
jxbrowser-linux64-7.5.jar
This jar contains - chromium-*.7z which is needed by jxbrowser.
I extracted and unzipped this file to an accessible location.
The location for the chromium installation should then be provided to the engine-
Engine engine = Engine.newInstance(
EngineOptions.newBuilder(HARDWARE_ACCELERATED)
.chromiumDir(Paths.get("/home/rgupta/.jxbrowser/chromium/chromium-linux64"))
.build());
Then, jxbrowser started working.

I had the same bug when i added the OS specific jar in Intellij classpath. What i have done to fix it is to remove it and put it back again. Intellij don't recognize it and display a popup with options to select what kind of jar it is. then select classes.

Related

Jar file created with JavaFX will not load because of error java.util.MissingResourceException: Can't find bundle for base name lng, locale en_US?

I have a resource bundle with language properties. If the local language is French, it loads french texts or else default English. My program works okay when using Intellij but when I create the jar file and try to run it by doing java -jar myapp.jar then it crashes and shows error.
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javafx.fxml.LoadException:file:/C:/Users/rsoph/OneDrive/Desktop/C195new/out/artifacts/C195_Project_jar/C195_Project.jar!/view/login_welcome_screen.fxml
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2595)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3237)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3194)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3163)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3136)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3113)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3106)
at main.Main.start(Main.java:33)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
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 com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
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 com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
... 17 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name lng, locale en_US
at java.base/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2055)
at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1689)
at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1593)
at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1556)
at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:932)
at controller.LoginWelcomeScreenController.initialize(LoginWelcomeScreenController.java:61)
... 29 more
This is how I use the resource bundle
ResourceBundle resBundle = ResourceBundle.getBundle("lng", Locale.getDefault());
if (Locale.getDefault().getLanguage().equals("fr")) {
usernameLabel.setText(resBundle.getString("username"));
passwordLabel.setText(resBundle.getString("password"));
loginButton.setText(resBundle.getString("login"));
exitButton.setText(resBundle.getString("exit"));
}
My program structure looks like this.
EDIT: This is how I created the jar executable file.
File -> Project Structure -> Artifacts -> click on the plus sign (+) -> Jar -> From modules with dependencies.
Select the main class and OK. Followed by Clicking on the + sign and adding all files from the javafx bin folder to the File ( all the dll files).
Go to Build -> Build artifacts -> Build.
The bundle name you are looking up is "lng", but your the files in your bundle have prefixes of "Lng".
The case of the resource file name and the bundle lookup string should match.
If you are using a Windows system, the lookup on the file name is case-insensitive when using the file protocol to access the unpackaged resources.
But, when packaged in a jar, the lookup of the resources using the jar protocol is case sensitive.
Which explains why you can find the resources when not packaged in a jar, and why the lookup fails after jar packaging.
In addition to the issue with the jar packaging, relying on case insensitive file names also means that the project would fail if used on an OS with a case sensitive file system, like a Mac or Linux system.

How to open fxml file in netbeans? [duplicate]

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 3 years ago.
I am working with scene builder that I save as fxml file. When I open it on netbeans it generates the following error.
Executing C:\Users\Niw\Documents\NetBeansProjects\school_system\dist\run803183839\school_system.jar using platform C:\Program Files(x86)\Java\jdk1.8.0_131\jre/bin/java
Exception in Application start method
java.lang.reflect.InvocationTargetException
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:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
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:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsupportedClassVersionError:
com/jfoenix/controls/JFXButton has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2916)
at javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2905)
at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2846)``
at javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2692)
at javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2661)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2517)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
at school_system.School_system.start(School_system.java:29)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(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$148(WinApplication.java:191)
... 1 more
Exception running application school_system.School_system
Java Result: 1
What should I do?
The problem is that your application was compiled using JDK 9, but you are trying to run it using JRE 8:
The relevant part of your stack trace which shows this is this message:
Caused by: java.lang.UnsupportedClassVersionError:
com/jfoenix/controls/JFXButton has been compiled by a more recent
version of the Java Runtime (class file version 53.0),
this version of the Java Runtime only recognizes class file versions
up to 52.0
The first line of your stack trace confirms that your are using JRE 1.8 which equates to class file version 52.0:
...using platform C:\Program Files(x86)\Java\jdk1.8.0_131\jre/bin/java
However, your project has been compiled using JDK 9, which equates to class file version 53.0 as detailed in the error message for the UnsupportedClassVersionError shown above.
There are two possible ways to resolve your problem in NetBeans:
Use a more recent version of JRE to run your application, with a version >= JRE 9. To do that:
Select your project in the Projects pane, right click to open the context menu and select Properties.
Select Libraries from the list of Categories, then select a JDK from the Java Platform drop list which is >= JDK 9.
Use only JDK 8 (if, and only if, that is possible):
Select Sources from the list of Categories, then select a JDK 8 from the Source/Binary Format drop list.
Rebuild your application.
After taking one of those two approaches you should be able to run your application in NetBeans.

Why is org.flywaydb.core.Flyway API not loading builtin mysql driver

I am trying to migrate with application startup using the Flyway programatic API, but it seems to fail to load mysql drivers.
I am using gradle everything works fine if I use command line (presummably because I can specify the driver), but I get the following error when application starts up:
Exception in thread "main" java.lang.reflect.InvocationTargetException
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:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: com.mysql.cj.jdbc.Driver => Check whether the jar file is present
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:141)
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:107)
at org.flywaydb.core.api.configuration.ClassicConfiguration.setDataSource(ClassicConfiguration.java:1226)
at org.flywaydb.core.api.configuration.FluentConfiguration.dataSource(FluentConfiguration.java:741)
... 8 more
Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate class com.mysql.cj.jdbc.Driver : com.mysql.cj.jdbc.Driver
at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:63)
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:137)
... 12 more
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:61)
... 13 more
This seems to be a problem of the mysql connector. I downgraded to 6.0.+ and works fine.
compile ('mysql:mysql-connector-java:6.0.+')

Failed to load jxbrowser in plain OSGi enviroment

I've been using jxbrpowser 6.2 with a trial license. Trying to load it in OSGi enviroment generates the following error:
Exception in thread "JavaFX Application Thread" java.lang.ExceptionInInitializerError
at com.teamdev.jxbrowser.chromium.internal.ipc.IPC.getDefault(Unknown Source)
at com.teamdev.jxbrowser.chromium.BrowserContext.<init>(Unknown Source)
(...)
at com.sun.glass.ui.win.WinApplication$$Lambda$39/30523883.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.teamdev.jxbrowser.chromium.internal.ChromiumExtractorException: Failed to extract chromium binaries into C:\Users\Vladimir\AppData\Local\Temp\jxbrowser-chromium-43.0.2357.52.6.2
at com.teamdev.jxbrowser.chromium.internal.ChromiumExtractor.extract(Unknown Source)
at com.teamdev.jxbrowser.chromium.internal.ipc.IPC.<init>(Unknown Source)
at com.teamdev.jxbrowser.chromium.internal.ipc.IPC.create(Unknown Source)
at com.teamdev.jxbrowser.chromium.internal.ipc.IPC$a.<clinit>(Unknown Source)
... 15 more
Caused by: java.lang.IllegalArgumentException: The /chromium-windows.zip resource cannot be found in JAR files.
at com.teamdev.jxbrowser.chromium.internal.ZIPExtractor.extract(Unknown Source)
at com.teamdev.jxbrowser.chromium.internal.e.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 19 more
I can successfully load jxbrowser in the non-OSGi environment, as well as in OSGi environment when resources are already extracted.
Is there any way to make jxbrowser successfully extracts the resources from the jar?
It is looking like you don't have a correct OSGI bundle for JxBrowser. As far as I know jxbrowser supports OSGI bundle distribution, you can simply install it into your OSGI container.
Alternatively you can create your own bundle with which is only exports JxBrowser public API, but contains JxBrowser libraries you need. You can automate it with Felix bundle plugin for example http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html
In order to make such a bundle working you will need to initialize an temporary browser instance (just create a browser component) inside bundle activator. So that chromium binaries will be extracted when bundle is installed in your OSGi container.

Errors on webapp deploying in Jetty

I have those problems with a webapp.Can you help me, please? :)
First error:
2012-03-15 09:51:57.023:WARN:oejs.ServletHandler:Error for NAME_OF_WEBAPP/NAME_OF_SERVLET
This request comes from a form contained in an html page.
After this error, the terminal shows me this error:
java.lang.NoClassDefFoundError: org/apache/lucene/analysis/payloads/PayloadEncoder
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:369)
at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:390)
at org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:84)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:141)
at org.apache.solr.schema.IndexSchema.readAnalyzer(IndexSchema.java:835)
at org.apache.solr.schema.IndexSchema.access$100(IndexSchema.java:58)
at org.apache.solr.schema.IndexSchema$1.create(IndexSchema.java:429)
at org.apache.solr.schema.IndexSchema$1.create(IndexSchema.java:447)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:141)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:456)
at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:95)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:520)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at connector.SolrConnector.<init>(SolrConnector.java:33)
at connector.SolrConnector.getInstance(SolrConnector.java:69)
at connector.SolrConnector.getSolrServer(SolrConnector.java:77)
at connector.QueryServlet.doGet(QueryServlet.java:117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:546)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:233)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:615)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:722)
Caused by:
java.lang.ClassNotFoundException: org.apache.lucene.analysis.payloads.PayloadEncoder
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:424)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:377)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:369)
at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:390)
at org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:84)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:141)
at org.apache.solr.schema.IndexSchema.readAnalyzer(IndexSchema.java:835)
at org.apache.solr.schema.IndexSchema.access$100(IndexSchema.java:58)
at org.apache.solr.schema.IndexSchema$1.create(IndexSchema.java:429)
at org.apache.solr.schema.IndexSchema$1.create(IndexSchema.java:447)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:141)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:456)
at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:95)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:520)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at connector.SolrConnector.<init>(SolrConnector.java:33)
at connector.SolrConnector.getInstance(SolrConnector.java:69)
at connector.SolrConnector.getSolrServer(SolrConnector.java:77)
at connector.QueryServlet.doGet(QueryServlet.java:117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:546)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:233)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:615)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:722)
When I compile the file WAR, there aren't errors..
I use Jetty 7.6.0.RC4, Solr 1.4.1 and Java 7.. ;)
java.lang.ClassNotFoundException: org.apache.lucene.analysis.payloads.PayloadEncoder
This is rather self-explaining. The mentioned class cannot be found in the runtime classpath.
Make sure that the mentioned class (or at least, the JAR file containing the class) is in the runtime classpath of the webapp. One of the folders covered by the webapp's default runtime classpath is the webapp's /WEB-INF/lib folder. Drop the necessary JARs in there.
As the package name hints, that class is part of Apache Lucene library. If you need to, you can just download it from over there.

Resources