Jboss Issue when Running server in Eclipse - java

I am trying to configure a local JBoss instance in Eclipse on Mac
Every time i try to run the server I get the following error
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:85)
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:272)
at org.jboss.modules.Main.main(Main.java:313)
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.<clinit>(BridgeRepositorySelector.java:42)
... 7 more
I am not entirely sure how to solve this so was hoping someone could help.
Thanks

answer from here
Open the launch configuration for the server definition. Add:
-logmodule org.jboss.logmanager to the program arguments before org.jboss.as.standalone

to open the launch configuration double click on the server and click "Open launch configuration"

Related

Can't use Selenium on a Java server

I tried making a discord patchbot in java (Data is on a dynamic website).
While the application works in eclipse and as a .jar on my desktop, I can't get it to work properly on the server.
The server is a java-server from sparkedhost.
On every start the following error occurs:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: java.lang.IllegalStateException: It must be an executable file: /home/container/botFiles/chromedriver.exe
at org.openqa.selenium.internal.Require.stateCondition(Require.java:169)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:148)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:142)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:38)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:231)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:437)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:127)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:48)
at selenium.SeleniumApplicaton.run(SeleniumApplicaton.java:40)
at main.WebScraper.getNews(WebScraper.java:31)
at main.DiscordBot.<init>(DiscordBot.java:60)
at main.DiscordBot.main(DiscordBot.java:27)
... 5 more
Regarding the error message in the stack trace:
It must be an executable file: /home/container/botFiles/chromedriver.exe
The executable you are trying to run (chromedriver.exe) looks like a Windows executable file. But the server you are running it on does not - it starts with a root directory of /, suggesting a Linux box.
Based on that, I think you may need to pick the chromedriver which matches your server operating system.
My guess in the question's comments is converted to an answer, since that turned out to be the solution.

[Eclipse not starting]:An error has occured. See the log file null

I'm unable to get my Eclipse Luna running. It was working fine till now and suddenly crashed. Now when i try to start it, I get the error saying:
An error has occured. See the log file null
I tried launching eclipse from terminal and also tried to delete the metadata folder from my workspace but nothing helped me.
Here is the crash log:
org.osgi.framework.BundleException: Error initializing container.
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:93)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:209)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:201)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:168)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:296)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.ExceptionInInitializerError
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.initWorker(EquinoxBundle.java:137)
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:83)
... 12 more
Caused by: java.security.ProviderException: setSeed() failed
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:458)
at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:329)
at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:212)
at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:209)
at java.security.SecureRandom.<init>(SecureRandom.java:190)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.computeNodeAddress(UniversalUniqueIdentifier.java:127)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.<clinit>(UniversalUniqueIdentifier.java:35)
... 14 more
Caused by: java.io.IOException: Operation not permitted
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:313)
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:456)
... 20 more
It seems you're using Solaris? This OS has an alternative entropy source called EGD, which needs special protocol to write to, which Sun JDK does not implement...
Can you try adding -Djava.security.egd=/dev/random to the vmargs section of your eclipse.ini.
If you still see the same issue. Make sure your user can write to /dev/random.
I fixed it myself. Few files in my security folder /jre/lib/security had got messed up.
Downloaded latest Java Cryptography Extension (JCE) and put the jars (Download US_export_policy.jar and local_policy.jar) in the security folder. My eclipse works fine now.

Jboss Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandle

When I tried jbosseap6.3 install as service. I got below error. Anyone have any idea on the below error. Any one shed light means it is very helpful for me.
java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE"
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:119)
at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:338)
at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:291)
at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:300)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:542)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
at org.jboss.as.logging.logmanager.ConfigurationPersistence.configure(ConfigurationPersistence.java:149)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:300)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:262)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at org.jboss.modules.Main.main(Main.java:443)
Caused by: java.lang.reflect.InvocationTargetException
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:408)
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:117)
... 18 more
Caused by: java.io.FileNotFoundException: C:\jboss-eap-6.3\standalone\log\server.log (The process cannot access the file because it is being used by another process)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:154)
at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:105)
at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:192)
at org.jboss.logmanager.handlers.FileHandler.<init>(FileHandler.java:122)
at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.<init>(PeriodicRotatingFileHandler.java:73)
... 23 more
Shutdown JBossEAP6.3.0 service [2015-05-29 09:58:27]
Try to start jBoss server as administrator by pressing right mouse key, it will permit jboss to create all folders and files .
Right click the installation directory of Jboss EA (mine is C:\program files\EAP6.1, then Properties, Security tab. Given everyone permissions on this folder (all users you can see just give full control). This should then be able to create logs etc files within the required folder.
This is just a workaround though only works for local installs.
I had the same issue, it worked after running it on root, maybe you are running it without the proper rights.
I had resolved this issue by creating log directory in the
C:\jboss-eap-6.3\standalone\
it's a problem due to permissions, the solution that worked for me is that i removed the home directory of jboss wildfly from C:\programmes to C:\
Starting Wildfly/Jboss from the administrator cmd worked!!
You are most likely getting this error because you either have the log file open in a text editor or you're already running that instance of JBoss.
I got the same exception
Try changing the path from c to another destination, that solved my issue and I am able to start the server

java newrelic agent throwing classnotfound exception

I am trying to install newrelic on a linux machine with tomcat 7. This installation does not have a catalina.sh so cannot use the newrelic installer.
I tried the manula approach of adding the newrelic.jar to the javaagent like:
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/share/tomcat7/newrelic/newrelic.jar"
But whenever I start the tomcat I get the following classnotfoundexception:
Unable to start New Relic agent: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:106)
at com.newrelic.agent.extension.dom.ExtensionDomParser.getTransformerFactory(ExtensionDomParser.java:360)
at com.newrelic.agent.extension.dom.ExtensionDomParser.fixNamespace(ExtensionDomParser.java:337)
at com.newrelic.agent.extension.dom.ExtensionDomParser.parseDocument(ExtensionDomParser.java:167)
at com.newrelic.agent.extension.dom.ExtensionDomParser.readFile(ExtensionDomParser.java:152)
at com.newrelic.agent.extension.ExtensionParsers$3.parse(ExtensionParsers.java:46)
at com.newrelic.agent.extension.JarExtension.<init>(JarExtension.java:59)
at com.newrelic.agent.extension.JarExtension.<init>(JarExtension.java:104)
at com.newrelic.agent.extension.ExtensionService.initializeBuiltInExtensions(ExtensionService.java:388)
at com.newrelic.agent.extension.ExtensionService.doStart(ExtensionService.java:145)
at com.newrelic.agent.service.AbstractService.start(AbstractService.java:54)
at com.newrelic.agent.service.ServiceManagerImpl.doStart(ServiceManagerImpl.java:124)
at com.newrelic.agent.service.AbstractService.start(AbstractService.java:54)
at com.newrelic.agent.Agent.premain(Agent.java:208)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:343)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:358)
Caused by: java.lang.ClassNotFoundException: org/apache/xalan/processor/TransformerFactoryImpl
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at javax.xml.transform.FactoryFinder.getProviderClass(FactoryFinder.java:124)
at javax.xml.transform.FactoryFinder.newInstance(FactoryFinder.java:179)
I have tried everything I could for this, but nothing works. I have even added the xalan jar manually to the tomcat lib but no luck
You need to make sure you have xalan.jar installed. If it is installed, it may be in the wrong place. You probably need it at the container level, here is a blog post that discusses this issue (tomcat5 but most of the advice should still apply).
http://doookstechstuff.blogspot.com/2010/04/how-to-fix-tomcat5-on-rhel5.html
Make sure that the location where you put the xalan.jar is in the classpath and that the user account you're running tomcat under has access to it. If you have dropped it in the tomcat /lib folder make sure the perms for the .jar file match the other objects in the folder.
Let us know if this helps. If you need additional information it might be best to create a ticket with New Relic Support (http://support.newrelic.com).

running rmi server, classnotfound [duplicate]

This question already has answers here:
java.rmi.ServerException: RemoteException occurred in server thread (ClassNotFoundException)
(5 answers)
Closed 6 years ago.
Hi I'm trying to run a java application that binds a class to the naming server, but i constantly get a ClassNotFoundException
First I start the registry:
rmiregistry
then from eclipse I try to execute the server but get this error
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: progInternet2008.commons.NominabileFactory
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at progInternet2008.Pozzobon.tesi.Slave.main(Slave.java:54)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: progInternet2008.commons.NominabileFactory
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:386)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: progInternet2008.commons.NominabileFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:711)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:655)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:592)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
... 12 more
I've read the RMI Java tutorial but still could not get it working...
As VM Arguments I've set this:
-Djava.rmi.server.codebase=file:${workspace_loc}/progInternet2008
please help me
(I'm using Java 6)
Run the rmiregisrty command from your /bin, /build, or /build/classes folder, whichever folder is the root of your built files.
I spent half a day trying to solve that same thing.
The exception is occurring because the rmiregistry application doesn't know where to load classes from. When you attempt to bind an object in the RMI registry, the registry downloads the class definition for that object. Some of the other answers are telling you to get around this by setting the classpath for the rmiregistry app so that it has the class definitions when it is started and doesn't need to download anything, but Sun's Java RMI tutorial explicitly says not to do this. I suspect this has the potential to cause conflicts between the version of the class in the registry and the class on the server.
The correct way to handle the problem is to set the java.rmi.server.codebase property as you were trying to do. The property requires that a directory path be terminated with a forward slash, like so:
-Djava.rmi.server.codebase=file:${workspace_loc}/progInternet2008/
You may also be having trouble if the ${workspace_loc} variable is a relative path and the rmiregistry application was not started in the same directory so the relative path is not correct for it. If you either make the path absolute, or start the rmiregistry in the appropriate directory, the ClassNotFoundException should go away. See the tutorial on the java.rmi.server.codebase property for a little more detailed information.
Okay I just overcame this problem. Make sure when you run rmiregistry that your CLASSPATH environment variable is set.
For example, you might have a script:
set CLASSPATH=[path to jdbc driver].jar
rmiregistry.exe
This was all I needed to get my lost classpath working. I'm not sure how to send -cp commandline to rmiregistry.exe. Its documentation is quite lacking.
I'm fairly certain that you'll have to start your RMI server using the same classpath as your application. I believe it takes the same parameters as java, i.e. -cp [your class path].
Close the cmd window where the rmiregistry was initially started.In a fresh cmd go to the location where your project classfiles are located(uptill bin) and start the registry using the below command:
rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false
If you are using Eclipse ,Run the ServerSideProject and your ImplementationClass Instance gets bound to the URL specified.
Just print a line below the the binding method and see to it whether it is gets printed. If it gets printed successfully it means your server is working fine.
try to add /bin at the end of your VM Arg:
-Djava.rmi.server.codebase=file:${workspace_loc}/progInternet2008/bin
The file you will run are in this directory, so you need to include it in the path.
I upgraded from JDK1.6.0_33 to 1.7.0_45 and had the same problem. I found this document and resolved the problem by starting rmiregistry with:
rmiregistry -Djava.rmi.server.useCodebaseOnly=false
Refer below
http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/enhancements-7.html
I had the same problem, to fix this ensure that your CLASSPATH is set to the path containing the server classes when running rmiregistry.
On a linux machine run the following commands.
export CLASSPATH="<server_class_path>"
Ensure the CLASSPATH has been set:
echo $CLASSPATH
Once the class path has been set, run rmiregistry
rmiregistry &
I spent a whole day uninstalling and reinstalling my JDK and changing the classpaths's and environment variables. But the culprit was that the command start rmigregistry didnt' start rmiregistry in a proper way. So, thanks for the comments on this page the solution was to unset the CLASSPATH temporarily. And that is done through the command set CLASSPATH=

Categories