I have developed Java application to connect to Ldap server and get the details in csv format based on user arguments. The result csv file will be saved in HDFS (Hadoop File system).
In order to write to HDFS, I have imported org.apache.hadoop.security.UserGroupInformation and set the Kerberos configuration properly. Below are the code snippet.
config.set("hadoop.security.authentication","Kerberos");
UserGroupInformation.setConfiguration(config);
UserGroupInformation.loginUserFromKeytab(Principal,KeyTabfile);
we kept the keytab file in edge server of the POC environment. When I run the Java application from edge server, It is reading the keytab file running fine and writing the results to HDFS.
But my issue starts when I tried to shedule this application using oozie. Oozie will launch java actions in any of the data nodes in a cluster based on the availability of resources and oozie cant access the edge server. Because of this, my java action in oozie getting failed with security exception since it cant read the keytab file in edge server.
Below is exception details.
java.io.IOException: Login failure for hdfs://namenode:8020 from keytab xxxxx#zz.yy.COM: javax.security.auth.login.LoginException: java.lang.IllegalArgumentException: Empty nameString not allowed
at sun.security.krb5.PrincipalName.validateNameStrings(PrincipalName.java:171)
at sun.security.krb5.PrincipalName.<init>(PrincipalName.java:393)
at sun.security.krb5.PrincipalName.<init>(PrincipalName.java:460)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:650)
at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:617)
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 javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
at org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:967)
at RunLdap_Utility.ldapLookupLoop(RunLdap_Utility.java:142)
at RunLdap_Utility.main(RunLdap_Utility.java:72)
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.oozie.action.hadoop.JavaMain.run(JavaMain.java:56)
at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:47)
at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:35)
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.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:241)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1709)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)
Kindly suggest me the solution for this issue
Related
I am writing simple jakarta messaging applications with NetBeans and Glassfish. I followed the tutorial "The Jakarta EE 7 Tutorial" step by step. After successfully building all the "simple" Examples, I use the appclient -client target/producer.jar queue 3 in my windows terminal. While Can't send the message.
I'm using Glassfish-5.0.1 . It looks like I can't use the appclient. Can anyone give me some help?
The Jakarta EE 7/ 46.2 Writing Simple JMS Applications
jakartaee-tutorial-examples-master\jakartaee-tutorial-examples-master\jms\simple\producer>appclient -client target/producer.jar queue 3
java.io.FileNotFoundException: C:\Users\?????ó\AppData\Local\Temp\acc7678140812900140496.dat (System cannot find the specified path。)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileReader.<init>(FileReader.java:72)
at org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.optionsValue(AppClientContainerAgent.java:104)
at org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.premain(AppClientContainerAgent.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
File not found exception means you either did not have a correct specified path or you gave a path with no file for the inputstream to read.
I'm trying to create a web application in NetBeans 8.2, for this I try to use Apache Tomcat 8.0.27 which is integrated into this version. Previously I worked with Tomcat and Netbeans without any problem but in one occasion it failed.
I tried to modify environment variables in addition to reinstalling NetBeans with all its components but it did not work. I looked for information in other questions but I didn't find anything useful, possibly some file is corrupted but if it were the case, I would like to know how to solve it with a simple and understandable explanation, in some forums I read about how to find corrupted files and solve some things but they are not so clear to me.
Specs:
- Windows
- Netbeans 8.2
- Tomcat 8.0.27
- JDK & JDR 1.8.0.191
**Exception in thread "main" java.lang.InternalError:** java.util.zip.ZipException: error in opening zip file
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1052)
at sun.misc.URLClassPath.getResource(URLClassPath.java:249)
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.util.ResourceBundle$RBClassLoader.loadClass(ResourceBundle.java:512)
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2649)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1510)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1474)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1370)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:782)
at sun.security.provider.AuthPolicyFile$1.run(AuthPolicyFile.java:74)
at sun.security.provider.AuthPolicyFile$1.run(AuthPolicyFile.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.provider.AuthPolicyFile.<clinit>(AuthPolicyFile.java:71)
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.Class.newInstance(Class.java:442)
at javax.security.auth.Policy$2.run(Policy.java:236)
at javax.security.auth.Policy$2.run(Policy.java:228)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Policy.getPolicyNoCheck(Policy.java:227)
at javax.security.auth.Policy.getPolicy(Policy.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
at org.apache.catalina.startup.Catalina.load(Catalina.java:576)
at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
**Caused by: java.util.zip.ZipException: error in opening zip file**
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:940)
at sun.misc.URLClassPath$JarLoader.access$800(URLClassPath.java:801)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:886)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:879)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:878)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1050)
... 44 more
I would expect Tomcat to deploy without any problem but instead it is simply not deployed, sending the error every time.
Update: I installed the same NetBeans but in other computer AND it worked. I copyied the files of Tomcat and NetBeans but the error still (So, theres no a problem related to corrupted .jars i think). The project that im using to test it's a basic HTML page... A default Java web project.
This problem in most part of times is a Exception of corrupted jars.
Are you trying to connect to any database? If yes, try to remove .jar file from lib folder on WebContent and copy the file from your computer directory to your folder on IDE and try again. If no, try to do this procedure to all of .jars that you're using on your project and replace them all again.
Using JProfiler for a first time today.
I've started jpenable on my remote ubuntu server, but after I've inserted port java exception appeared:
Please enter a profiling port
[31758]
8086
java.io.IOException: Premature EOF
at sun.tools.attach.HotSpotVirtualMachine.readInt(HotSpotVirtualMachine.java:226)
at sun.tools.attach.LinuxVirtualMachine.execute(LinuxVirtualMachine.java:193)
at sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:40)
at sun.tools.attach.HotSpotVirtualMachine.loadAgentPath(HotSpotVirtualMachine.java:70)
at com.jprofiler.frontend.attach.AgentLoader.a(ejt:26)
at com.jprofiler.frontend.attach.c.b(ejt:291)
at com.jprofiler.frontend.attach.c.a(ejt:278)
at com.jprofiler.frontend.attach.c.a(ejt:248)
at com.jprofiler.frontend.EnableApplication.a(ejt:118)
at com.jprofiler.frontend.EnableApplication.g(ejt:81)
at com.jprofiler.frontend.EnableApplication.main(ejt:238)
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.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
What's wrong here? Thanks
I tried to deploy a report to my jasper server. I followed this tutorial: http://randomallsorts.blogspot.de/2009/12/jasper-reports-how-to-deploy-report-to.html. But in the end of the day, when I tried to have a look at my report in the admin interface I just received a pretty long error which I don't understand.
The server has encountered an error. Please excuse the inconvenience.
Error Message
com.mysql.jdbc.Driver Error Trace
com.jaspersoft.jasperserver.api.JSExceptionWrapper:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.loadDriverFromExistingClassLoaders(JdbcDriverServiceImpl.java:535)
at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.register(JdbcDriverServiceImpl.java:130)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy35.register(Unknown Source) at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.registerDriver(DbcpDataSourceFactory.java:58)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.createPooledDataSource(DbcpDataSourceFactory.java:50)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.getPoolDataSource(JdbcReportDataSourceServiceFactory.java:145)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.createService(JdbcReportDataSourceServiceFactory.java:128)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.createDataSourceService(EngineServiceImpl.java:1763)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1651)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897)
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) Error Message
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Error Trace
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.loadDriverFromExistingClassLoaders(JdbcDriverServiceImpl.java:535)
at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.register(JdbcDriverServiceImpl.java:130)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy35.register(Unknown Source) at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.registerDriver(DbcpDataSourceFactory.java:58)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.createPooledDataSource(DbcpDataSourceFactory.java:50)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.getPoolDataSource(JdbcReportDataSourceServiceFactory.java:145)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.createService(JdbcReportDataSourceServiceFactory.java:128)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.createDataSourceService(EngineServiceImpl.java:1763)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1651)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897)
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)
Does anybody have a clue what could be wrong there ? I am sorry but I am really a ireport amateur.
First you should install the driver on your Jasper Server.
Go to the web interface with a user in the role ROLE_ADMINISTRATOR
On the tree view, you can create a folder to hold your datasource
In that folder, right click and add a data source
Give it a meaningful name for you and upload the com.mysql.jdbc.Driver (if not already present).
Note: if you did a manual WAR installation, you probably installed the driver already.
Download the driver here http://dev.mysql.com/downloads/connector/j/
Check the jdbc url. Should be something like jdbc:mysql://your_host/your_database
Small hack is to check your max allow packet setting in your MYSQL server and set it accordingly in your jdbc url. On MYSQL driver, check it using this command:
SHOW VARIABLES LIKE 'max_allowed_packet';
Then set the url to: jdbc:mysql://your_host/your_database?maxAllowedPacket=WHATEVER_SIZE_YOU_GOT
Check the username, password and timezone and test the connection.
Edit the report on the web interface and set the datasource as being this one.
When you upload a new report, either via web interface or iReport Designer, assign this data source.
Good luck, hope it solves your problem :)
try using this guide..
Seems like it cannot find the mysql driver to connect.
http://jasperserver.sourceforge.net/docs/3-5-0/JasperServer-User-Guide.pdf
I am trying to put together a accumulo/cloudera quickstart. Accumulo is running, but I am having problems attempting to execute samples, namely hellowworld.
It appears it is finding hadoop and not accumulo classes?
Following is execution and error messages. I appreciate your assistance!
./bin/accumulo org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat "instance" localhost:2181 "username" "password" hellotable
Thread "org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat" died nulljava.lang.reflect.InvocationTargetException
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.apache.accumulo.start.Main$1.run(Main.java:89)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
at org.apache.accumulo.core.util.ContextFactory.createTaskAttemptContext(ContextFactory.java:131)
at org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat.run(InsertWithOutputFormat.java:56)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat.main(InsertWithOutputFormat.java:76)
... 6 more
Problem solved by:
1) Using cdh4 accumulo-1.4.3 tar
2) adding additional users
3) ensuring write permissions on supporting jars