Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: error KettleEnvironment.init();

  1. #1
    Join Date
    Mar 2015
    Posts
    12

    Default error KettleEnvironment.init();

    Hello,

    I am execute kettle with a program in java, but i recibe this error:


    java.lang.NullPointerException: null
    at org.pentaho.di.core.logging.LogChannel.logDetailed(LogChannel.java:91)
    at org.pentaho.di.i18n.GlobalMessages.calculateString(GlobalMessages.java:269)
    at org.pentaho.di.i18n.LAFMessageHandler.calculateString(LAFMessageHandler.java:126)
    at org.pentaho.di.i18n.GlobalMessages.getString(GlobalMessages.java:293)
    at org.pentaho.di.i18n.BaseMessages.getString(BaseMessages.java:81)
    at org.pentaho.di.core.logging.LogLevel.<clinit>(LogLevel.java:29)
    at org.pentaho.di.core.logging.DefaultLogLevel.<init>(DefaultLogLevel.java:26)
    at org.pentaho.di.core.logging.DefaultLogLevel.getInstance(DefaultLogLevel.java:31)
    at org.pentaho.di.core.logging.DefaultLogLevel.getLogLevel(DefaultLogLevel.java:40)
    at org.pentaho.di.core.logging.LogChannel.<init>(LogChannel.java:30)
    at org.pentaho.di.core.logging.LogChannel.<clinit>(LogChannel.java:18)
    at org.pentaho.di.core.KettleEnvironment.createDefaultKettleProperties(KettleEnvironment.java:111)
    at org.pentaho.di.core.KettleEnvironment.createKettleHome(KettleEnvironment.java:102)
    at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:51)
    at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:43)
    at hello.MvcConfig.cargaDatos(MvcConfig.java:94)
    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:483)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:85)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)


    I make dependences of all jars, but i also recibe this error.

    This is my code java:

    Code:
    String file="C:/Users/Desktop/pdi-ce-5.3.0.0-213/data-integration/proyect.kjb"; //Job file path that needs to be executed
            Repository repository=null; //Checking for repository
            
            try {
                KettleEnvironment.init();
                            
                JobMeta jobmeta=new JobMeta(file,repository);
                Job job=new Job(repository, jobmeta);
                job.start();
                job.waitUntilFinished();
                
                if(job.getErrors()>0){
                    System.out.println("Erroruting Job");
                }
                
            } catch (KettleException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }


    I use jars 4.2.0-stable
    What is the problem??

    Thank you very much!

  2. #2
    Join Date
    Sep 2013
    Posts
    235

    Default

    some how log object becomes null here
    https://github.com/pentaho/pentaho-k...annel.java#L91
    and most probably is because
    https://github.com/pentaho/pentaho-k...annel.java#L32 is null
    have no idea why it is happens.

    By the way, looking to a stack-trace I see you have a tomcat with spring security, your
    Code:
    at hello.MvcConfig.cargaDatos(MvcConfig.java:94)
    ...attempts to initialize KettelEnvironment, and it attempts to create...

    Code:
    at org.pentaho.di.core.KettleEnvironment.createDefaultKettleProperties(KettleEnvironment.java:111)
    	at org.pentaho.di.core.KettleEnvironment.createKettleHome(KettleEnvironment.java:102)
    	at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:51)
    	at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:43)
    ...kettle home like the situation when kettle home is not found, and it attempts to output about it in log but fail to do that (so also fail to create kettle home and initialize environment - but not sure about it).
    This is a very beginning of job and failed on "KettleEnvironment.init()" phase so it even was not properly initialized.

    4.2.0-stable a little bit outdated for me. So can't say more.

  3. #3
    Join Date
    Mar 2015
    Posts
    12

    Default

    I prove with the version 5.3.0 but i recibe the same error. I dont know how i can resolve this problem

    Thank you

    Quote Originally Posted by Dzmitry View Post
    some how log object becomes null here
    https://github.com/pentaho/pentaho-k...annel.java#L91
    and most probably is because
    https://github.com/pentaho/pentaho-k...annel.java#L32 is null
    have no idea why it is happens.

    By the way, looking to a stack-trace I see you have a tomcat with spring security, your
    Code:
    at hello.MvcConfig.cargaDatos(MvcConfig.java:94)
    ...attempts to initialize KettelEnvironment, and it attempts to create...

    Code:
    at org.pentaho.di.core.KettleEnvironment.createDefaultKettleProperties(KettleEnvironment.java:111)
        at org.pentaho.di.core.KettleEnvironment.createKettleHome(KettleEnvironment.java:102)
        at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:51)
        at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:43)
    ...kettle home like the situation when kettle home is not found, and it attempts to output about it in log but fail to do that (so also fail to create kettle home and initialize environment - but not sure about it).
    This is a very beginning of job and failed on "KettleEnvironment.init()" phase so it even was not properly initialized.

    4.2.0-stable a little bit outdated for me. So can't say more.

  4. #4
    Join Date
    Sep 2013
    Posts
    235

    Default

    Code:
    prove with the version 5.3.0 but i recibe the same error.
    the most valuable is full stack-trace with line numbers, same error for 5.3 says nothing. In 5.3 a lot things changed, so the may be different calls -different stack trace different line numbers. When I say 4.2 is outdated - that means in my IDE I don't have 4.2 version of source code and it will take a lot time to checkout 4.2 build it and start discovering.
    Sorry.
    Last edited by Dzmitry; 04-08-2015 at 07:15 AM.

  5. #5
    Join Date
    Mar 2015
    Posts
    12

    Default

    Quote Originally Posted by Dzmitry View Post
    Code:
    prove with the version 5.3.0 but i recibe the same error.
    the most valuable is full stack-trace with line numbers, same error for 5.3 says nothing. In 5.3 a lot things changed, so the may be different calls -different stack trace different line numbers. When I say 4.2 is outdated - that means in my IDE I don't have 4.2 version of source code and it will take a lot time to checkout 4.2 build it and start discovering.
    Sorry.

    I prove execute in project java, not with framework spring and this execute well. How I could know change for this didnt give me error when I execute with spring??

    Thank you very much.

  6. #6
    Join Date
    Sep 2013
    Posts
    235

    Default

    When you execute something in web-server context this is different from when you do something in context of regular java. There is 2 classic behaviors possible - the one is separate classloaders, the second - web container does not have access to some filesystem places other then the root of deployed webapp. Both is usually made to keep security of application on web server. Something that happens on web-server should not break web server boundaries. A lot security violation is based on braking web server boundaries and making changes to OS or something else.

    How I could know change for this didnt give me error when I execute with spring??
    Why don't you ask you spring-security configuration why it is prevent creating kettle home?

  7. #7
    Join Date
    Mar 2015
    Posts
    12

    Default

    Quote Originally Posted by Dzmitry View Post
    When you execute something in web-server context this is different from when you do something in context of regular java. There is 2 classic behaviors possible - the one is separate classloaders, the second - web container does not have access to some filesystem places other then the root of deployed webapp. Both is usually made to keep security of application on web server. Something that happens on web-server should not break web server boundaries. A lot security violation is based on braking web server boundaries and making changes to OS or something else.



    Why don't you ask you spring-security configuration why it is prevent creating kettle home?

    you think that it is a problem spring security and not is a problem of kettle??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.