when drools example is started,it is failed, Why? - drools

Notes:
Java must be installed. Get the JRE (http://www.java.com) or the JDK.
For optimal performance, Java is recommended to be OpenJDK 7 or higher.
For JDK, the environment variable JAVA_HOME should be set to the JDK installation directory
For example: set "JAVA_HOME=C:\Program Files\Java\jdk1.6.0"
The working dir should be the directory of this script.
Starting examples app with JDK from environment variable JAVA_HOME (C:\Program Files\Java\jdk1.8.0_251)...
13:07:44.382 [main] ERROR o.k.a.i.utils.ServiceDiscoveryImpl.processKieService:131 - Loading failed because There already exists an implementation for service org.drools.core.reteoo.KieComponentFactoryFactory with same priority 0
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.drools.dynamic.DynamicServiceRegistrySupplier.get(DynamicServiceRegistrySupplier.java:32)
at org.drools.dynamic.DynamicServiceRegistrySupplier.get(DynamicServiceRegistrySupplier.java:23)
at org.kie.api.internal.utils.ServiceRegistry$Impl.getServiceRegistry(ServiceRegistry.java:88)
at org.kie.api.internal.utils.ServiceRegistry$ServiceRegistryHolder.(ServiceRegistry.java:47)
at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:39)
at org.kie.api.internal.utils.ServiceRegistry.getService(ServiceRegistry.java:35)
at org.kie.api.KieServices$Factory$LazyHolder.(KieServices.java:358)
at org.kie.api.KieServices$Factory.get(KieServices.java:365)
at org.kie.api.KieServices.get(KieServices.java:349)
at org.drools.examples.DroolsExamplesApp.(DroolsExamplesApp.java:59)
at org.drools.examples.DroolsExamplesApp.main(DroolsExamplesApp.java:52)
Caused by: java.lang.RuntimeException: Unable to build kie service url = jar:file:/C:/Users/slb0547/Downloads/drools-distribution-7.45.0.Final/drools-distribution-7.45.0.Final/examples/binaries/drools-traits-7.45.0.Final.jar!/META-INF/kie.conf
at org.kie.api.internal.utils.ServiceDiscoveryImpl.registerConfs(ServiceDiscoveryImpl.java:105)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.lambda$getServices$1(ServiceDiscoveryImpl.java:83)
at java.util.Optional.ifPresent(Optional.java:159)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:81)
at org.kie.api.internal.utils.ServiceRegistry$Impl.(ServiceRegistry.java:60)
at org.drools.dynamic.DynamicServiceRegistrySupplier$LazyHolder.(DynamicServiceRegistrySupplier.java:27)
... 11 more
Caused by: java.lang.RuntimeException: There already exists an implementation for service org.drools.core.reteoo.KieComponentFactoryFactory with same priority 0
at org.kie.api.internal.utils.ServiceDiscoveryImpl$PriorityMap.put(ServiceDiscoveryImpl.java:222)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.processKieService(ServiceDiscoveryImpl.java:124)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.registerConfs(ServiceDiscoveryImpl.java:101)
... 16 more

I changed the version to usedrools-distribution-6.5.0.Final instead of the 7.46. Now I can play with the examples.
That's not a real answer, but I hope that will be enough for now.

Related

RTI DDS Connext Host on PI

I'm getting this error when I'm trying to run an RTI DDS example on Raspberry PI:
NDDSHOME=/home/pi/RTI/ndds.5.0.0
DYLD_LIBRARY_PATH=/home/pi/RTI/ndds.5.0.0/lib/armv6vfphLinux3.xgcc4.7.2:/home/pi/RTI/ndds.5.0.0/lib/armv6vfphLinux3.xgcc4.7.2jdk:/home/pi/RTI/ndds.5.0.0/lib/armv6vfphLinux3.xgcc4.7.2jdk
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.rti.ndds.config.Version.get_core_library_build_number_string()Ljava/lang/String;
at com.rti.ndds.config.Version.get_core_library_build_number_string(Native Method)
at com.rti.ndds.config.Version.<init>(Unknown Source)
at com.rti.ndds.config.Version.<clinit>(Unknown Source)
at simpledds.MonitorDicoveredInformation.start(MonitorDicoveredInformation.java:37)
at simpledds.MonitorDicoveredInformation.main(MonitorDicoveredInformation.java:312)
What can be the problem?
This error indicates that the dynamic libraries for RTI Connext DDS (e.g. libnddscore.so and others similarly named) are not found in your load library path.
From your target directory name (armv6vfphLinux3.xgcc4.7.2) it appears you are running on a Linux platform. In that case the environment variable that needs to be set to add to the load library path is called LD_LIBRARY_PATH. The name you are using DYLD_LIBRARY_PATH is the correct name for the MacOS platform but not for Linux.
Gerardo

java.io.IOException: Invalid argument at java.io.WinNTFileSystem.canonicalize0

I am using Eclipse Mars with Tomcat v8.0.30 ,jre 1.8.0_73. Yesterday I didnt have any problems but today my Tomcat server fail to start. A dialog pops up and it says: "Starting Tomcat v8.0 Server at localhost has encountered a problem. Server Tomcat v8.0 Server at localhost failed to start.
I have this error in the console:
org.apache.catalina.startup.Bootstrap initClassLoaders
SEVERE: Class loader creation threw exception
java.io.IOException: Invalid argument
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.WinNTFileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at java.io.File.getCanonicalFile(Unknown Source)
at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:168)
at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:201)
at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:146)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:256)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
I have Tomcat EE v7.0 server which gives me the exact same problem.
I reinstalled Eclipse and Tomcat , I restarted my PC , I restored default options multiple times. I created new server couple of times and I even deleted "org.eclipse.core.resources" and the result is still the same.
Any suggestions?
I suspect your CATALINA_HOME is set wrong. Usually users writing path\bin; where it is only-path-to-tomcat without bin or any folder.
Remove backslash \ at the end of the CATALINA_HOME
You must check your tomcat log catalina.out to trace the route cause
Also check your TOMCAT_HOME/conf/catalina.properties file. There may be some unseen character that causesjava.io.IOException: Invalid argument

LogManager Exception in JBOSS AS 7.1 with java.util.Logger

I created a java application and initialize a java.util.Logger with that application and run that application as -javaagent with jboss AS 7 server and i got IllegalStateException (i am using eclipse IDE).Here follows my logger initialization code
static public void setup() throws IOException {
// Get the global logger to configure it
Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
logger.setLevel(Level.INFO);
fileTxt = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.txt");
fileHTML = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.html");
// create txt Formatter
formatterTxt = new SimpleFormatter();
fileTxt.setFormatter(formatterTxt);
logger.addHandler(fileTxt);
// create HTML Formatter
formatterHTML = new BMITHtmlFormatter();
fileHTML.setFormatter(formatterHTML);
logger.addHandler(fileHTML);
}
When i create -javaagent jar appended with above lines of code and run with jboss as7 server i got following exception
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
... 7 more
And i serched in fourms and i got a solution which is Open the launch configuration for the server definition.
and add -logmodule org.jboss.logmanager to the program arguments before org.jboss.as.standalone.
But it results the same exception with some additional warning. Here follows the exception
WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
... 7 more
I had the same problem with JBOSS EAP 6, it took me 2 days for find a solution !.
The cause is that your agent need to create a Logger at statup, he need to be able to access the logmanager classes before JBOSS Modules has been initialized. You need to add JBoss LogManager to the boot classloader. Then, there will be a conflict between LogManager available via ModuleClassLoader and classes loaded via system classloader.
The solution is to make Java Agent and JBoss Modules use the same classloader to load the LogManager classes.
For EAP 6, In your standalone.conf (or domain) (It must be close for your version)
add
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/main/jboss-logmanager-1.3.1.jar"
and for make Java Agent and JBoss Modules use the same classloader
modify this piece of code in adding org.jboss.logmanager like this :
if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,org.jboss.logmanager"
fi
Hope this will help.
I found the solution after searching for couple of days in the below link.
https://github.com/jbossas/jboss-as-maven-plugin/issues/40#issuecomment-14943429
I have to tweak a little bit to get is work in Windows 7.
Open Eclipse.
Add Jboss 7.1 Runtime 1 server.
Select the Server and press F3.
Click on Open Launch Config.
Goto VM arguments.
Add the below two entries.
"-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"
"-Djava.util.logging.manager=org.jboss.logmanager.LogManager"
Now select the Classpath TAB
Select User Entries
Click Add External Jars
Select the three jar files
a) jboss-logmanager-1.2.0.GA.jar
b) jboss-logmanager-log4j-1.0.0.GA.jar
c) log4j-1.2.16.jar
Paths
C:/jboss-as-7.1.1.Final/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.0.GA.jar"
C:/jboss-as-7.1.1.Final/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar"
C:/jboss-as-7.1.1.Final/modules/org/apache/log4j/main/log4j-1.2.16.jar"
This will start the standalone jboss without any issues.
In EAP 6.4, the correct logmanager's path should be
$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.4.Final-redhat-1.jar

JBOSS 5.0 Starting Error

I have installed Jboss 5.0.0GA-jdk6... While trying to start jboss by running "run.bat" (inside bin folder), I am getting following error... what am I doing wrong ?
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed:
*** DEPLOYMENTS IN ERROR: Name -> Error
StandardBindings -> java.lang.IllegalArgumentException: Wrong arguments. new for
target java.lang.reflect.Constructor expected=[int] actual=[java.util.HashSet]
*** DEPLOYMENTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual S
tate}
ServiceBindingManager -> ServiceBindingStore{Installed:Instantiated}
SystemPropertyBinder -> SystemPropertyBinder#1{Installed:Described}
SystemPropertyBinder#1 -> ServiceBindingManager{Installed:Described}
ServiceBindingStore -> StandardBindings{Installed:**ERROR**}
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalVa
lidate(AbstractKernelDeployer.java:290)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(A
bstractKernelDeployer.java:174)
at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java
:148)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:
394)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:547)
at java.lang.Thread.run(Unknown Source)
15:05:41,329 INFO [ServerImpl] Runtime shutdown hook called, forceHalt: true
15:05:41,332 INFO [ServerImpl] Shutdown complete
Shutdown complete
Halting VM
Press any key to continue . . .
There is a bug in the profile.xml
For a fix quick add the type "class=java.io.File" to the parameter of the constructor as showed:
<bean name="AttachmentStore"
class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore">
<constructor><parameter class="java.io.File"><inject bean="BootstrapProfileFactory"
property="attachmentStoreRoot" /></parameter></constructor>
For a detailed explanation go to: https://issues.jboss.org/browse/JBAS-6981
There is bug with incompatible version of java.You should add jre 6 in to jboss configuration file under jre folder .
jboss 5.0.0.GA requires IBMV9 jdk.
so we can use jboss 4.3.2.GA instead . it is compatible with jdk 6 and jdk 7.

Netbeans 3 on Windows 7

Has anyone managed to make Netbeans 3 work on Windows 7? I realise this is against everything that is holy, but I either try and get it working, buy new hardware, or upgrade the whole project to a later IDE...
I had to manually set my JAVA_HOME and place a folder path on the command line when running the installer, but after that I am getting the following error in the install log:
Found matching JVM at c:\Java\jdk1.5.0_06
Matching JVM home is c:\Java\jdk1.5.0_06
Matching JVM file is C:\Users\spalmer\AppData\Local\Temp\LRE72A4.tmp
Executing launch script command: "c:\Java\jdk1.5.0_06/bin\java.exe" -cp "";"C:\Users\spalmer\AppData\Local\Temp\LRE72A5.tmp\setup.jar";"" -Dtemp.dir="C:\Users\spalmer\AppData\Local\Temp" -Dis.jvm.home="c:\Java\jdk1.5.0_06" -Dis.jvm.temp="0" -Dis.media.home="C:\Users\spalmer\AppData\Local\Temp\LRE72A5.tmp\setup.jar" -Dis.launcher.file="C:\development\surveycollector\trunk\docs\Everything you need to set up a survey collector\netbeans-3_6-windows.exe" -Dis.jvm.file="C:\Users\spalmer\AppData\Local\Temp\LRE72A4.tmp" -Dis.external.home="C:\development\surveycollector\trunk\docs\Everything you need to set up a survey collector" -Xms20m -Xmx60m run in working directory C:\development\surveycollector\trunk\docs\Everything you need to set up a survey collector
Output from the launch script execution
StdOut:
ErrOut:
An error occurred during wizard bean change notification:
java.lang.NullPointerException
at java.awt.Dimension.<init>(Dimension.java:91)
at javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(BasicProgressBarUI.java:757)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at com.installshield.wizard.awt.ColumnLayout.layoutContainer(ColumnLayout.java:174)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
at com.installshield.wizard.awt.AWTWizardUI.setCurrent(AWTWizardUI.java:1827)
at com.installshield.wizard.awt.AWTWizardUI.runnableBeanStarted(AWTWizardUI.java:1873)
at com.installshield.wizard.StandardWizardListener.execute(StandardWizardListener.java:127)
at com.installshield.wizard.StandardWizardListener.currentBeanChanged(StandardWizardListener.java:106)
at com.installshield.wizard.Wizard$RunThread.run(Wizard.java:1545)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.awt.Dimension.<init>(Dimension.java:91)
at javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(BasicProgressBarUI.java:757)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at com.installshield.wizard.awt.ColumnLayout.layoutContainer(ColumnLayout.java:174)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.awt.Dimension.<init>(Dimension.java:91)
at javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(BasicProgressBarUI.java:757)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at com.installshield.wizard.awt.ColumnLayout.layoutContainer(ColumnLayout.java:174)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.awt.Dimension.<init>(Dimension.java:91)
at javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(BasicProgressBarUI.java:757)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at com.installshield.wizard.awt.ColumnLayout.layoutContainer(ColumnLayout.java:174)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
I would suggest importing the project to a newer version of the IDE. You'll make the code more accessible for future needs. Otherwise you're just perpetuating an obvious problem.
If that's not possible (sometimes it's not our call) here's another VM option you can check out: http://www.virtualbox.org/
I just found a simpler fix to our problem:
C:\Java>SET JAVA_HOME='C:\j2sdk1.4.2_17'
C:\Java>netbeans-3_6-windows
As you see, that's all I had to do and Netbeans installed perfectly, using Java 1.4 as runtime.
Just in case you need it still.
Check out Windows Virtual PC (Windows XP Mode or Win 7). Installing Netbeans 3 on it might do the trick.
My guess is that Java 5 is too new for NB3. Try Java 1.4.2 or maybe even 1.3.something.
I had the similar NPE in a different szenario with an old JExpress installer. I found a workaround.
The workaround is to change desktop theme to some default theme like Win XP or Classic. Then this problem does not happen.