Hadoop's WordCount runs form command line but not from Eclipse - eclipse

In the last few days, I have tested multiple version of Hadoop (1.0.1, 1.0.2, 1.1.4). In each case, I can easily run the WordCount program using the following command line:
hadoop jar hadoop-examples-1.1.1.jar wordcount /input output
Since the above command executes successfuly, then I assume that my Hadoop configuration is correct. But I get the following error message for each single version when I try to run the program using exact same input from Eclipse. Can anyone give me the reason why it wouldn't run from Eclipse?
Dec 12, 2012 2:19:41 PM org.apache.hadoop.util.NativeCodeLoader <clinit>
WARNING: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Dec 12, 2012 2:19:41 PM org.apache.hadoop.mapred.JobClient copyAndConfigureFiles
WARNING: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
****file:/tmp/wordcount/in
Dec 12, 2012 2:19:42 PM org.apache.hadoop.mapred.JobClient$2 run
INFO: Cleaning up the staging area file:/tmp/hadoop-root/mapred/staging/root-41981592/.staging/job_local_0001
Dec 12, 2012 2:19:42 PM org.apache.hadoop.security.UserGroupInformation doAs
SEVERE: PriviledgedActionException as:root cause:org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979)
at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1093)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
at com.igalia.wordcount.WordCount.run(WordCount.java:94)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at com.igalia.wordcount.App.main(App.java:28)

Add the following two lines in your job through your Configuration abject :
Configuration.addResource(new Path("path-to-your-core-site.xml file"));
Configuration.addResource(new Path("path-to-your-hdfs-site.xml file"));

For hadoop-2.2.0 on windows 7, I added the below lines and it solved the issue (NOTE: My Hadoop Home is: C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0)
Configuration conf = new Configuration();
conf.addResource(new Path("C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0\etc\hadoop\core-site.xml"));
conf.addResource(new Path("C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0\etc\hadoop\hdfs-site.xml"));

Related

Alfresco 5.2.4 in weblogic server

I am getting the following error when trying to install Alfresco 5.2.4 in weblogic 12. I am using all the supported technology stack as per the alfresco documentation. Any help would be greatly appreciated.
<Nov 28, 2018 10:13:21,313 PM CST> <Error> <javax.faces> <BEA-000000> <Unable
to call #PreDestroy annotated methods because no InjectionProvider can be
found. Does this container implement the Mojarra Injection SPI?>
<Nov 28, 2018 10:13:21,313 PM CST> <Error>
<javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Critical
error during deployment:
com.sun.faces.config.ConfigurationException: Factory
'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
I have faced similar issue recently. The following Work Around should fix this error:
Uncomment following lines in /META-INF/weblogic-application.xml
<package-name>javax.faces.*</package-name>
<package-name>javax.faces.application.*</package-name>
<package-name>javax.faces.component.*</package-name>
<package-name>javax.faces.context.*</package-name>
<package-name>javax.faces.convert.*</package-name>
<package-name>javax.faces.el.*</package-name>
<package-name>javax.faces.event.*</package-name>
<package-name>javax.faces.lifecycle.*</package-name>
<package-name>javax.faces.model.*</package-name>
<package-name>javax.faces.render.*</package-name>
<package-name>javax.faces.validator.*</package-name>
<package-name>javax.faces.webapp.*</package-name>

vertx run FileName.java not working

I am trying to run vertx programme. I am standing on the same folder the .java exist.
vertx run TestVerticle.java
Mar 24, 2017 7:19:27 PM io.vertx.core.Starter
SEVERE: Failed in deploying verticle
java.lang.ClassNotFoundException: TestVerticle
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:42)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:188)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:595)
at io.vertx.core.Starter.runVerticle(Starter.java:333)
at io.vertx.core.Starter.run(Starter.java:130)
at io.vertx.core.Starter.main(Starter.java:101)
I checked JAVA_HOME, CLASS_PATH ll properly set unable to find the reason. Please help. I have been struggling this from last two days without any success.
I am using Ubuntu 16.04 from Digital Ocean
Atlast before I go to sleep I curiously tried vertx run with --cp command and it worked !
vertx run -cp $CLASS_PATH TestVerticle.java (even though TestVerticle.java present in the current folder !)
which means that my CLASS_PATH or the current folder is not taken into consideration by default by vertx. Unfortunately I don't know why but atleast my server is now running.

Weblogic 12c - Connection was forcibly closed by the remote host

can someone please help me resolve the following exception,
<Feb 10, 2015 11:43:47 AM CST> <Error> <HTTP> <BEA-101019> <[ServletContext#1297842065[app:_auto_generated_ear_ module:dmportal path:null spec-version:3.0]] Servlet failed with an IOException.
java.io.IOException: An existing connection was forcibly closed by the remote Host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:470)
Truncated. see log file for complete stacktrace
<Feb 10, 2015 11:43:50 AM CST> <Error> <HTTP> <BEA-101020> <[ServletContext#1297842065[app:_auto_generated_ear_ module:dmportal path:null spec-version:3.0]] Servlet failed with an Exception
weblogic.servlet.internal.ServletNestedRuntimeException: Cannot parse POST parameters of request: '/dmportal/pushTime.do'
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2426)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:2243)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekParameter(ServletRequestImpl.java:2462)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekPostParameter(ServletRequestImpl.java:2445)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.access$2600(ServletRequestImpl.java:2014)
Truncated. see log file for complete stacktrace
Caused By: java.net.ProtocolException: EOF after reading only: '0' of: '16' promised bytes, out of which at least: '0' were already buffered
at weblogic.servlet.internal.PostInputStream.complain(PostInputStream.java:84)
at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:189)
at weblogic.servlet.internal.ServletInputStreamImpl$1.read(ServletInputStreamImpl.java:189)
at weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:251)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2400)
Truncated. see log file for complete stacktrace
<Feb 10, 2015 11:43:50 AM CST> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
java.lang.AssertionError: Assertion violated.
java.lang.AssertionError: Assertion violated
at weblogic.utils.Debug.assertion(Debug.java:58)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2404)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:2243)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekParameter(ServletRequestImpl.java:2462)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekPostParameter(ServletRequestImpl.java:2445)
Truncated. see log file for complete stacktrace
I am using Oracle OEPE eclipse with weblogic 12c. It was working fine before i started working on the Mobile application.
i have installed following plugins in my eclipse.
1. Android Tools
2. JBoos Hybrid Mobile tools
The following open source installed on my pc
1. Node Js
2. Cordova
3. Ripple emulator
I enabled SSL in weblogic and tried with https url and it worked fine.
You can change the url in config.xml file. then it will works.

Why is database medrec not found by the Avitek sample application?

Circumstances: performed a by-the-book developer install using wls1212_dev.zip and wls1212_dev_supplemental.zip. Followed the README.txt and the README_SUPP.txt strictly. Created a sample domain by hand, no issues seen. Executed the run_samples.sh configuration script, no issues seen.
When starting the medrec domain (Avitek sample app) using startWebLogic.sh, the medrec database is not found (specific error below). The Avitek app comes up and display-only pages are navigable, but database touches all fail. The WLS console in the medrec domain works fine. The JDBC data source "MedRecGlobalDataSourceXA" exists in the domain and the fields look ... well, reasonable, to my untrained eye.
For now I am taking the error message at face value and assuming database creation failed within the setup script (run_samples.sh) But I examined all the logs in wlserver/samples after executing the run_samples.sh script, and there was nothing that seemed relevant.
Platform: VirtualBox VM with CentOS 6.5 and JDK1.7.0_45
Other notes: I am aware of the security fix in 1.7.0_51 and higher JDKs that breaks existing Derby database applications. I purposely chose to avoid this issue by installing the 0_45 JDK until I resolve this "database not found" issue.
Grateful for any help.
Error:
<May 25, 2014 8:40:46 AM PDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<May 25, 2014 8:40:46 AM PDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<May 25, 2014 8:40:47 AM PDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "MedRecGlobalDataSourceXA" due to error weblogic.application.ModuleException: org.apache.derby.client.am.DisconnectException: The connection was refused because the database medrec was not found.
weblogic.application.ModuleException: org.apache.derby.client.am.DisconnectException: The connection was refused because the database medrec was not found.
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:338)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:172)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:167)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
Truncated. see log file for complete stacktrace
Caused By: org.apache.derby.client.am.DisconnectException: The connection was refused because the database medrec was not found.
at org.apache.derby.client.net.NetConnectionReply.parseRDBNFNRM(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source)
at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
Truncated. see log file for complete stacktrace
In linux unset variable LANG before starting Derby database server.

Glassfish 3.x start failed

i'm trying to run my java EE web application on Glassfish v3.x on Netbeans 7 but it wont work, and gives me the following error: Glassfish 3.x start failed.
i don't know what's the problem glassfish used to work fine before but then suddenly stoped working i unistalled netbeans and glassfish n install it again, but still the same problem.
here is the glassfish log:
Launching GlassFish on Felix platform
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
INFO: Grizzly Framework 1.9.31 started in: 585ms - bound to [0.0.0.0:3700]
INFO: Grizzly Framework 1.9.31 started in: 580ms - bound to [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.31 started in: 738ms - bound to [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.31 started in: 584ms - bound to [0.0.0.0:7676]
INFO: Grizzly Framework 1.9.31 started in: 539ms - bound to [0.0.0.0:4848]
GRAVE: Exception while visiting com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class of size 84805
java.lang.ArrayIndexOutOfBoundsException: 48188
at org.objectweb.asm.ClassReader.readClass(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:362)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:171)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:133)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:346)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:305)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:294)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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:662)
INFO: SEC1002: Security Manager is OFF.
INFO: SEC1010: Entering Security Startup Service
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
INFO: SEC1011: Security Service(s) Started Successfully
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
INFO: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]
INFO: WEB0171: Created virtual server [server]
INFO: WEB0171: Created virtual server [__asadmin]
INFO: WEB0172: Virtual server [server] loaded default web module []
INFO: Initialisation de Mojarra 2.1.0 (FCS 2.1.0-b11) pour le contexte '/mavenproject1'
INFO: Monitoring jndi:/server/mavenproject1/WEB-INF/faces-config.xml for modifications
INFO: PWC1412: WebModule[null] ServletContext.log():Initializing Spring root WebApplicationContext
Best Regards.
I know this was asked months ago but this question being one of the few sources i found in Google when encountering this problem, I think it'd good to share what bit i learnt:
I had the same exact problem and tried both things stated above. Still, my XML files didn't seem to be corrupted. In the end I found that the root of the problem was on the icu4j library which was, dont know why, among the dependencies in my project. Once I removed it, I was free of that error at last!
Should also be noted that Netbeans 7.0.1 (The IDE I'm using) also "uses" this library. I moved this library out of its original location just in case. NB continues to run without any problems so far.
Hope it helps someone else too!
I fixed mine in this way. It seemed that my XML file for the domain was corrupt ( I have no idea how) but what i did is as follows:
Remove your current server from the server node( right click and remove), then make a new server, except when it says to pick a domain, type in your own domain name (EX. myDomain) and then set up the server.
Wait for a few seconds, and bam, new XML file, not corrupt, and you should be able to run your server perfectly fine!
That's strange... How it does say "startup failed" if it loaded your app? Take a look at the last three lines of the log!
I had some problems like this, but all I needed is to right-click on the GF server node on "Services" tab and "refresh" it. Usually NB consider a slow GF startup as "failed".
Another answer which is possible now if using Java 8, but not at the time the OP asked, is that the server code contains lambdas. If you do have lambdas in your code, try to replace them with anonymous inner classes and your class(es) that were affected should now be good to go.