Java XML Web Service - java

for a school project I'm trying to create my own SOAP web service.
While doing some work an error occur.
public class ServerMain {
private static final Logger LOGGER = Logger.getAnonymousLogger();
public static void main(String[] args) {
try{
Endpoint.publish("http://localhost:8976/s19103/people",
new PersonServiceImpl());
LOGGER.info("Service started");
System.out.println("START");
}
catch (Exception e){
e.printStackTrace();
}
}}
I got this error
Exception in thread "main" java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:803)
at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:721)
at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1394)
at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:180)
at javax.xml.ws.spi.Provider.provider(Provider.java:140)
at javax.xml.ws.Endpoint.publish(Endpoint.java:255)
at example.HelloWorld.main(HelloWorld.java:17)
Caused by: java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:461)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:65)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:133)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:85)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:156)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:93)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:142)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:262)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:249)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:442)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:652)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:274)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:271)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:271)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:96)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:779)
... 6 more
Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 36 more
What does it mean and what do I have to do to run my program?
Even when I try to run the automaticaly generated example HelloWorld I get the same error.

Related

JavaFX simple Button Exception in Application start? [duplicate]

This question already has an answer here:
getting java.lang.reflect.InvocationTargetException while adding a button to layout
(1 answer)
Closed 3 years ago.
I get error while I'm trying to run the simplest JavaFX code.
Without the Button works correctly, but with the button I get this error message:
public class Main extends Application {
Button button;
public static void main(String[] args) {
launch(args);
}
#Override
public void start(Stage stage) throws Exception {
stage.setTitle("JavaFX Test");
new Button("Click me");
StackPane layout = new StackPane();
layout.getChildren().add(button);
Scene scene = new Scene(layout, 900, 450);
stage.setScene(scene);
stage.show();
}
}
Exception in Application start method
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:567)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
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 java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.IllegalAccessError: superclass access check failed: class com.sun.javafx.scene.control.ControlHelper (in unnamed module #0x3f1056) cannot access class com.sun.javafx.scene.layout.RegionHelper (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.scene.layout to unnamed module #0x3f1056
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at javafx.scene.control.Control.<clinit>(Control.java:86)
at Main.start(Main.java:21)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
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)
... 1 more
Exception running application Main
button is never assigned a value. The Button from new Button("Click me") is never stored. You meant to initialize it like this: button = new Button("Click me");

Libaries correctly extracted?

A few days ago I switched from the Eclipse IDE to IntelliJ IDE. This is my first time I am coding with IntelliJ. I don't know how I can describe my Problem. :D Where is the Problem? I use this Java Application as a Plugin in my Bungeecord-Proxy
Stacktrace:
20:46:16 [WARNING] Exception encountered when loading plugin:
CloudNet-RestAPI java.lang.ExceptionInInitializerError at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
com.sun.proxy.$Proxy9.(Unknown Source) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739) at
com.sun.jersey.server.impl.application.WebApplicationImpl$26.run(WebApplicationImpl.java:1626)
at java.security.AccessController.doPrivileged(Native Method) at
com.sun.jersey.server.impl.application.WebApplicationImpl.createProxy(WebApplicationImpl.java:1623)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.(WebApplicationImpl.java:335)
at
com.sun.jersey.server.impl.container.WebApplicationProviderImpl.createWebApplication(WebApplicationProviderImpl.java:55)
at
com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:66)
at
com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:160)
at
com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:264)
at
com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:246)
at
com.sun.jersey.api.container.httpserver.HttpServerFactory.create(HttpServerFactory.java:117)
at
com.sun.jersey.api.container.httpserver.HttpServerFactory.create(HttpServerFactory.java:92)
at me.singulativ.restapi.main.RestAPI.onEnable(RestAPI.java:17) at
net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:227)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:266) at
net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:56)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) Caused by:
java.lang.RuntimeException: java.lang.ClassNotFoundException:
com.sun.ws.rs.ext.RuntimeDelegateImpl at
javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
at
javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.EntityTag.(EntityTag.java:35) ... 24
more Caused by: java.lang.ClassNotFoundException:
com.sun.ws.rs.ext.RuntimeDelegateImpl at
net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:53)
at
net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:27)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62) at
javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:155) at
javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:105)
... 26 more
Code:
package me.singulativ.restapi.main;
import com.sun.jersey.api.container.httpserver.HttpServerFactory;
import com.sun.net.httpserver.HttpServer;
import net.md_5.bungee.api.plugin.Plugin;
import java.io.IOException;
public class RestAPI extends Plugin {
private HttpServer server;
#Override
public void onEnable() {
try {
String host = "http://localhost:12345/";
server = HttpServerFactory.create(host);
server.start();
} catch (IOException e) {
e.printStackTrace();
}
}
#Override
public void onDisable() {
server.stop(0);
}
}
Dependencies
Artifacts

Mvvmfx: initialize-method causes NoClassDefFoundError: javax/annotation/PostConstruct

i'm trying to implement a mvvm-pattern with JavaFx. To do so i'm using the mvvmfx-framework.
To use data from a model i've tried to use the NotificationCenter. When inserting an initialize-method in my viewModel to subscribe to messages i get an Exception: NoClassDefFoundError: javax/annotation/PostConstruct.
I would be thankful if anybody could tell me what i'm doing wrong.
This is my viewModel:
#Singleton
public class BasementVM implements ViewModel {
#Inject
private NotificationCenter notificationCenter;
private NotificationObserver observer; // 1
private StringProperty basementViewKesselTempLbl = new SimpleStringProperty("27");
public StringProperty KesselTemperatur(){
return basementViewKesselTempLbl;
}
public String getKesselTemperatur(){
return basementViewKesselTempLbl.get();
}
public void setKesselTemperatur(String message){
basementViewKesselTempLbl.set(message);
}
public void initialize() {
// 2
observer = (key, payload) -> {
setKesselTemperatur(payload.toString());
};
notificationCenter.subscribe("test", new WeakNotificationObserver(observer)); // 3
}
}
This is where i start the application
public class Main extends MvvmfxGuiceApplication{
private static Logger logger = Logger.getLogger(Main.class);
#Override
public void startMvvmfx(Stage stage) throws Exception {
stage.setTitle("Hello World Application");
ViewTuple<DashBoardView, DashBoardVM> viewTuple = FluentViewLoader.fxmlView(DashBoardView.class).load();
Parent root = viewTuple.getView();
stage.setScene(new Scene(root));
stage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
And here goes the Stacktrace:
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:564)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
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:564)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:945)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at de.saxsys.mvvmfx.internal.viewloader.ViewLoaderReflectionUtils.lambda$initializeViewModel$9(ViewLoaderReflectionUtils.java:397)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1380)
at de.saxsys.mvvmfx.internal.viewloader.ViewLoaderReflectionUtils.initializeViewModel(ViewLoaderReflectionUtils.java:395)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.lambda$handleInjection$0(FxmlViewLoader.java:324)
at de.saxsys.mvvmfx.internal.viewloader.ViewLoaderReflectionUtils.lambda$createAndInjectViewModel$4(ViewLoaderReflectionUtils.java:272)
at de.saxsys.mvvmfx.internal.viewloader.ReflectionUtils.lambda$accessMember$3(ReflectionUtils.java:165)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at de.saxsys.mvvmfx.internal.viewloader.ReflectionUtils.accessMember(ReflectionUtils.java:161)
at de.saxsys.mvvmfx.internal.viewloader.ViewLoaderReflectionUtils.createAndInjectViewModel(ViewLoaderReflectionUtils.java:264)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.handleInjection(FxmlViewLoader.java:329)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.access$000(FxmlViewLoader.java:48)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader$DefaultControllerFactory.call(FxmlViewLoader.java:311)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader$DefaultControllerFactory.call(FxmlViewLoader.java:286)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:938)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:980)
at javafx.fxml/javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:227)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:752)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.access$2700(FXMLLoader.java:105)
at javafx.fxml/javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1154)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.loadFxmlViewTuple(FxmlViewLoader.java:171)
at de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.loadFxmlViewTuple(FxmlViewLoader.java:82)
Disconnected from the target VM, address: '127.0.0.1:59447', transport: 'socket'
at de.saxsys.mvvmfx.FluentViewLoader$FxmlViewStep.load(FluentViewLoader.java:333)
at de.piepnitz.MaltPie.Main.startMvvmfx(Main.java:35)
at de.saxsys.mvvmfx.guice.MvvmfxGuiceApplication.start(MvvmfxGuiceApplication.java:91)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
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:175)
... 1 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 41 more
Thanks in advance,
Piepette
Okay, i found the problem:
With Java 9, javax.annotation isn't visible by default as it's in a separate module. Since PostConstruct is part of javax.annotation, it isn't available.
So there are the following solutions:
Use Java 8 with mvvmfx.
Add the module
To add the module, you can do the following: It's possible to use the mixed set of Java SE and Java EE modules declared in java.se.ee module
Currently java.se.ee is included in standard JDK 9 but is not enabled by default. It's possible to enable this set of root modules via '--add-modules' option. For more information, check out: LogicBic
I see this error when I need to run an old Eclipse version for specific vender Eclipse plugins.
I use (in Windows) a bat file that changes the PATH temporarily for Eclipse to run with Java 8:
SETLOCAL
PATH={path_to_java_8_jre_or_java_8_jdk_bin_folder};%PATH%
eclipse.exe
ENDLOCAL
Set your shortcut to this bat file "Start In" with the Eclipse folder so Windows will find "eclipse.exe".

Error creating user registry object. The exception is java.lang.NoClassDefFoundError: com.dummy.registry.CustomRegistry (initialization failure)

Hi I currently have an WAS 7.0.29 and we've planned to update it to fix pack 41.
Upon the installation of the Fix pack I have encountered this:
[11/10/16 19:32:24:505 SGT] 00000000 UserRegistryC E SECJ0281E: Error creating user registry object. The exception is java.lang.NoClassDefFoundError: com.dummy.registry.CustomRegistry (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:139)
at java.lang.Class.forName(Class.java:294)
at com.ibm.ws.security.registry.UserRegistryImpl.initialize(UserRegistryImpl.java:225)
at com.ibm.ws.security.config.UserRegistryConfigImpl.do_createRegistryObjects(UserRegistryConfigImpl.java:686)
at com.ibm.ws.security.config.UserRegistryConfigImpl.createRegistryObjects(UserRegistryConfigImpl.java:643)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getUserRegistryImpl(UserRegistryConfigImpl.java:628)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getString(UserRegistryConfigImpl.java:850)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getPrincipalName(UserRegistryConfigImpl.java:577)
at com.ibm.ws.security.config.CSIv2ConfigImpl.initializeOnServer(CSIv2ConfigImpl.java:723)
at com.ibm.ws.security.config.CSIv2ConfigImpl.initialize(CSIv2ConfigImpl.java:1151)
at com.ibm.ws.security.config.CSIv2ConfigImpl.<init>(CSIv2ConfigImpl.java:100)
at com.ibm.ws.security.config.SecurityConfigObjectFactoryImpl.createCSIv2Config(SecurityConfigObjectFactoryImpl.java:116)
at com.ibm.ws.security.config.SecurityObjectLocator.do_getCSIv2Config(SecurityObjectLocator.java:852)
at com.ibm.ejs.ras.RasHelper.printStackTrace(RasHelper.java:368)
at com.ibm.ejs.ras.RasHelper.throwableToString(RasHelper.java:349)
at com.ibm.ejs.ras.MessageEvent6.convertParameters(MessageEvent6.java:346)
at com.ibm.ejs.ras.MessageEvent6.<init>(MessageEvent6.java:221)
at com.ibm.ejs.ras.Tr.fireMessageEvent(Tr.java:1538)
at com.ibm.ejs.ras.Tr.error(Tr.java:733)
at com.ibm.ws.security.config.UserRegistryConfigImpl.do_createRegistryObjects(UserRegistryConfigImpl.java:696)
at com.ibm.ws.security.config.UserRegistryConfigImpl.createRegistryObjects(UserRegistryConfigImpl.java:643)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getUserRegistryImpl(UserRegistryConfigImpl.java:628)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getString(UserRegistryConfigImpl.java:850)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getPrincipalName(UserRegistryConfigImpl.java:577)
at com.ibm.ws.security.config.CSIv2ConfigImpl.initializeOnServer(CSIv2ConfigImpl.java:723)
at com.ibm.ws.security.config.CSIv2ConfigImpl.initialize(CSIv2ConfigImpl.java:1151)
at com.ibm.ws.security.config.CSIv2ConfigImpl.<init>(CSIv2ConfigImpl.java:100)
at com.ibm.ws.security.config.SecurityConfigObjectFactoryImpl.createCSIv2Config(SecurityConfigObjectFactoryImpl.java:116)
at com.ibm.ws.security.config.SecurityObjectLocator.do_getCSIv2Config(SecurityObjectLocator.java:852)
at com.ibm.ws.security.config.SecurityObjectLocator.getCSIv2Config(SecurityObjectLocator.java:882)
at com.ibm.ws.security.config.SecurityObjectLocator.getCSIv2Config(SecurityObjectLocator.java:873)
at com.ibm.ws.security.auth.ContextManagerImpl.getProperty(ContextManagerImpl.java:2102)
at com.ibm.ws.security.auth.ContextManagerImpl.getProperty(ContextManagerImpl.java:2141)
at com.ibm.websphere.security.WSSecurityException.printStackTrace(WSSecurityException.java:230)
at com.ibm.ffdc.util.formatting.IncidentReportHeader.writeTo(IncidentReportHeader.java:77)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:207)
at com.ibm.ffdc.util.provider.IncidentLogger.writeHeader(IncidentLogger.java:70)
at com.ibm.ffdc.util.provider.IncidentLogger.writeIncidentTo(IncidentLogger.java:61)
at com.ibm.ws.ffdc.impl.FfdcProvider.logIncident(FfdcProvider.java:206)
at com.ibm.ws.ffdc.impl.FfdcProvider.logIncident(FfdcProvider.java:135)
at com.ibm.ffdc.util.provider.FfdcProvider.log(FfdcProvider.java:259)
at com.ibm.ws.ffdc.impl.FfdcProvider.log(FfdcProvider.java:148)
at com.ibm.ffdc.util.provider.IncidentEntry.log(IncidentEntry.java:105)
at com.ibm.ffdc.util.provider.Ffdc.log(Ffdc.java:90)
at com.ibm.ws.ffdc.FFDCFilter.processException(FFDCFilter.java:114)
at com.ibm.ws.security.config.UserRegistryConfigImpl.do_createRegistryObjects(UserRegistryConfigImpl.java:694)
at com.ibm.ws.security.config.UserRegistryConfigImpl.createRegistryObjects(UserRegistryConfigImpl.java:643)
at com.ibm.ws.security.config.UserRegistryConfigImpl.getUserRegistryImpl(UserRegistryConfigImpl.java:628)
at com.ibm.ws.security.core.distSecurityComponentImpl.getRealmFromUserRegistry(distSecurityComponentImpl.java:2808)
at com.ibm.ws.security.core.distSecurityComponentImpl.initialize(distSecurityComponentImpl.java:356)
at com.ibm.ws.security.core.SecurityComponentImpl.initialize(SecurityComponentImpl.java:94)
at com.ibm.ws.runtime.component.ContainerHelper.initWsComponent(ContainerHelper.java:1191)
at com.ibm.ws.runtime.component.ContainerHelper.initializeComponent(ContainerHelper.java:1098)
at com.ibm.ws.runtime.component.ContainerHelper.initializeComponents(ContainerHelper.java:900)
at com.ibm.ws.runtime.component.ContainerImpl.initializeComponents(ContainerImpl.java:776)
at com.ibm.ws.runtime.component.ContainerImpl.initializeComponents(ContainerImpl.java:750)
at com.ibm.ws.runtime.component.ServerImpl.initialize(ServerImpl.java:349)
at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:280)
at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:214)
at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:666)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:213)
at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:93)
at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:74)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
at org.eclipse.core.launcher.Main.run(Main.java:981)
at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:341)
at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:111)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:221)
at com.ibm.websphere.ras.Manager.createRASTraceLogger(Manager.java:241)
at com.dummy.registry.CustomRegistry.<clinit>(CustomRegistry.java:126)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:199)
at java.lang.Class.forName(Class.java:294)
at com.ibm.ws.security.registry.UserRegistryImpl.initialize(UserRegistryImpl.java:225)
at com.ibm.ws.security.config.UserRegistryConfigImpl.do_createRegistryObjects(UserRegistryConfigImpl.java:686)
... 36 more
Caused by: java.security.AccessControlException: Access denied (java.util.PropertyPermission com.ibm.ws.ffdc.SupportORBFFDC read)
at java.security.AccessController.throwACE(AccessController.java:121)
at java.security.AccessController.checkPermission(AccessController.java:194)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1293)
at java.lang.System.getProperty(System.java:404)
at java.lang.System.getProperty(System.java:388)
at com.ibm.websphere.ras.WsJrasTraceLogger.<clinit>(WsJrasTraceLogger.java:98)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:199)
... 43 more
.
My guess is that the issue is in the CustomRegistry that we have made which looks like this:
public class CustomRegistry implements UserRegistry {
protected static RASTraceLogger traceLogger;
private static RASMessageLogger msgLogger;
static {
Manager mgr = Manager.getManager();
traceLogger = mgr.createRASTraceLogger("MyWebsite", "Authentication", "Registry", CustomRegistry.class.getName());
msgLogger = mgr.createRASMessageLogger("MyWebsite", "Authentication", "Registry", CustomRegistry.class.getName());
msgLogger.setMessageFile("com.dummy.registry.RegistryMessages");
}
It points the usage of mgr.createRASTraceLogger in the CustomRegistry but I'm not sure what is the right approach for it.
Right now, I can't even start my server.
Your suggestions will be a great help! :)

HBase java custom filter error DeserializationException ClassNotFoundException

I extended the FilterBase in order to create my custom filter MyCustomFilter. I compiled it, uploaded the .jar to the server where run HBase, restarted it and when I add this class to the filters (I have only this filter)
ArrayList<String> testList = new ArrayList<String>();
List<Filter> filters = new ArrayList<Filter>();
Scan scan = new Scan();
scan.setMaxVersions(1);
scan.setCaching(10);
public static final byte[] FamilyName = Bytes.toBytes("D");
Filter filter1 = new MyCustomFilter(FamilyName);
filters.add(filter1);
FilterList filterList = new FilterList(
FilterList.Operator.MUST_PASS_ALL, filters);
scan.setFilter(filterList);
ResultScanner scanner = testTable.getScanner(scan);
try{
Result res = null;
int count = 0;
while ((res = scanner.next()) != null){
testList.add(new String(res.getRow()));
}
}
finally{
scanner.close();
}
this is the error when I execute the code:
org.apache.hadoop.hbase.DoNotRetryIOException: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.reflect.InvocationTargetException
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1467)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toScan(ProtobufUtil.java:994)
at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2237)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32205)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2114)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:101)
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:745)
Caused by: 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:497)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1463)
... 8 more
Caused by: org.apache.hadoop.hbase.exceptions.DeserializationException: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.ClassNotFoundException: filters.MyCustomFilter
at org.apache.hadoop.hbase.filter.MyCustomFilter.parseFrom(MyCustomFilter.java:396)
... 13 more
Caused by: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.ClassNotFoundException: filters.MyCustomFilter
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1467)
at org.apache.hadoop.hbase.filter.FilterList.parseFrom(FilterList.java:393)
... 13 more
Caused by: java.lang.ClassNotFoundException: filters.MyCustomFilter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at org.apache.hadoop.hbase.util.DynamicClassLoader.loadClass(DynamicClassLoader.java:147)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1457)
... 14 more
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteException.java:106)
at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteException.java:95)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.getRemoteException(ProtobufUtil.java:325)
at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:380)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:199)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:62)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:346)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:320)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:126)
at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException(org.apache.hadoop.hbase.DoNotRetryIOException): org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.reflect.InvocationTargetException
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1467)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toScan(ProtobufUtil.java:994)
at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2237)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32205)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2114)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:101)
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:745)
Caused by: 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:497)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1463)
... 8 more
Caused by: org.apache.hadoop.hbase.exceptions.DeserializationException: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.ClassNotFoundException: filters.MyCustomFilter
at org.apache.hadoop.hbase.filter.FilterList.parseFrom(FilterList.java:396)
... 13 more
Caused by: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.ClassNotFoundException: filters.MyCustomFilter
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1467)
at org.apache.hadoop.hbase.filter.FilterList.parseFrom(FilterList.java:393)
... 13 more
Caused by: java.lang.ClassNotFoundException: filters.MyCustomFilter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at org.apache.hadoop.hbase.util.DynamicClassLoader.loadClass(DynamicClassLoader.java:147)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter(ProtobufUtil.java:1457)
... 14 more
at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1226)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:213)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:287)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:32651)
at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:372)
... 10 more
The custom filter code is
package filters;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.exceptions.DeserializationException;
import org.apache.hadoop.hbase.filter.FilterBase;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.log4j.Logger;
public class MyCustomFilter extends FilterBase {
protected byte[] familyNameComparator = null;
protected boolean filterRow = true;
public MyCustomFilter(final byte[] familyName) throws Exception {
this.familyNameComparator = familyName;
}
#Override
public ReturnCode filterKeyValue(Cell cell) {
if (Bytes.compareTo(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength(), familyNameComparator,
0, familyNameComparator.length) != 0) {
return ReturnCode.SKIP;
} else {
return ReturnCode.INCLUDE;
}
}
public boolean filterRow() {
return this.filterRow;
}
public boolean filterRowKey(Cell cell) throws IOException {
return false;
}
#Override
public void reset() {
this.filterRow = true;
}
/**
* #return The filter serialized
*/
public byte[] toByteArray() {
return this.familyNameComparator;
}
}
And I modified the hbase-env.sh
# Extra Java CLASSPATH elements. Optional.
# export HBASE_CLASSPATH=
export HBASE_CLASSPATH="/mnt/datadisk/customfilters/customfilter.jar"
Any suggestions, please?
Best Regards!

Categories