I am trying to mail the error logs to gmail. But logback doesn't send any mail and I am not getting any error,
even I change the username to a random-notvalid mail. I think it doesn't try to send the mail.
I have logged 500 mail in the main function but nothing it only logs to file and console appender.
for(int i=0;i<501;i++){
logger.error("mail test");
}
See logback.xml,pom.xml and console output.
Regards,
**logback.xml**
<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.gmail.com</smtpHost>
<smtpPort>465</smtpPort>
<SSL>true</SSL>
<username>myMail#gmail.com</username>
<password>aaaaa</password>
<to> myMail#gmail.com</to>
<from> myMail#gmail.com</from>
<subject>TESTING: %logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%date %-5level %logger{35} - %message%n</pattern>
</layout>
</appender>
.....
<root level="TRACE">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
<appender-ref ref="EMAIL" />
</root>
**pom.xml**
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.3</version>
</dependency>
Connected to the target VM, address: '127.0.0.1:51152', transport: 'socket'
23:25:31,588 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
23:25:31,588 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
23:25:31,588 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/D:/projects/TmfCorbaTester/target/classes/logback.xml]
23:25:31,686 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
23:25:31,702 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Added status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]
23:25:31,736 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Adding LoggerContextListener of type [ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
23:25:31,737 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator#8a548b - Propagating DEBUG level on Logger[ROOT] onto the JUL framework
23:25:31,742 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Starting LoggerContextListener
23:25:31,746 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender]
23:25:31,768 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [EMAIL]
23:25:31,871 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
23:25:31,875 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
23:25:31,925 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
23:25:31,927 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern D:/projects/TmfCorbaTester/TmfCorbaTester-%d-%i.log for the active file
23:25:31,931 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP#1d87b85 - The date pattern is 'yyyy-MM-dd' from file name pattern 'D:/projects/TmfCorbaTester/TmfCorbaTester-%d-%i.log.zip'.
23:25:31,931 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP#1d87b85 - Roll-over at midnight.
23:25:31,932 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP#1d87b85 - Setting initial period to Sat Apr 07 23:19:35 EEST 2012
23:25:31,936 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Cleaning on start up
23:25:31,936 |-INFO in ch.qos.logback.core.rolling.helper.SizeAndTimeBasedArchiveRemover#f8395f - first clean up after appender initialization
23:25:31,936 |-INFO in ch.qos.logback.core.rolling.helper.SizeAndTimeBasedArchiveRemover#f8395f - periodsElapsed = 64
23:25:31,979 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: D:\projects\TmfCorbaTester/TmfCorbaTester.log
23:25:31,980 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [D:\projects\TmfCorbaTester/TmfCorbaTester.log]
23:25:31,981 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
23:25:31,983 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
23:25:31,990 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
23:25:31,990 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUTJACORB]
23:25:31,991 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [jacorb] to DEBUG
23:25:31,991 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator#8a548b - Propagating DEBUG level on Logger[jacorb] onto the JUL framework
23:25:31,994 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [jacorb] to false
23:25:31,994 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[jacorb]
23:25:31,996 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUTJACORB] to Logger[jacorb]
23:25:31,996 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
23:25:31,996 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator#8a548b - Propagating TRACE level on Logger[ROOT] onto the JUL framework
23:25:31,996 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
23:25:32,001 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
23:25:32,001 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [EMAIL] to Logger[ROOT]
23:25:32,001 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
23:25:32,003 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#14b6bed - Registering current configuration as safe fallback point
mail test
**23:25:32,017 |-INFO in ch.qos.logback.classic.net.SMTPAppender[EMAIL] - SMTPAppender [EMAIL] is tracking [1] buffers**
mail test
mail test
mail test
mail test
..
..
.
Have you double checked the gmail settings? An example is in the logback documentation:
http://logback.qos.ch/manual/appenders.html#gmailSTARTTLS
Everything else looks good to me.
This worked for me:
<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.gmail.com</smtpHost>
<smtpPort>587</smtpPort>
<STARTTLS>true</STARTTLS>
<username></username>
<password></password>
<to></to>
<from></from>
<subject></subject>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<asynchronousSending>false</asynchronousSending>
</appender>
And this didn't:
<asynchronousSending>true</asynchronousSending>
I guess you are missing few jars in your pom.xml
JAVA activation jars
slf4j
logback core
Check below link :
https://github.com/abdulwaheed18/Slf4jTutorial/blob/master/src/com/waheed/tutorial8/Application8.java
https://github.com/abdulwaheed18/Slf4jTutorial/blob/master/sample8.xml
Related
I'm trying to configure a Spring Boot project to use net.logstash.logback.encoder.LogstashEncoder to format log output in JSON and provide the ability to use the keyValue method for adding custom fields to the output. I know there are other ways of doing it, but many of our current applications using an older version of Spring use this technique and it works well. In order to update those applications, we'd like to be able to use the same configuration.
The problem I'm having is that with the following logstash.xml file:
<configuration>
<appender name="json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>
<root level="INFO">
<appender-ref ref="json" />
</root>
</configuration>
I'm getting the following error when starting the app:
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in net.logstash.logback.encoder.LogstashEncoder#4f659288 - Error occurred while dynamically loading jackson modules java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module Unable to get public no-arg constructor
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
at com.lowes.oms.eor.services.order.Application.main(Application.java:33)
... 5 more
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in net.logstash.logback.encoder.LogstashEncoder#4f659288 - Error occurred while dynamically loading jackson modules java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module Unable to get public no-arg constructor
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:232)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:73)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:313)
... 23 more
If I look in com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module, there is a public no-arg constructor.
Relevant dependency versions:
Spring Boot*: 2.7.2
Jackson*: 2.13.3 (managed by Spring Boot)
Logback*: 1.2.11 (managed by Spring Boot)
Any thoughts on what I could be doing wrong?
Turns out this was an incompatibility between logstash-logback-encoder and jackson-datatype-hibernate5. Whenever I try to use the logstash encoder with jackson-datatype-hibernate5 on the classpath, the error occurs. I've raised an issue in the logstash github repo here: https://github.com/logfellow/logstash-logback-encoder/issues/878
I have the following logback configuration and I am using it in a very simple Java application that does nothing except logging one line. When I uncomment the Splunk appender line it doesn't let the application exit, even though the application is finished.
Is there a way to terminate all the logging threads so that the main application exits?
logback.xml
<appender name="SPLUNK" class="com.splunk.logging.HttpEventCollectorLogbackAppender">
<url>${splunkUrl}</url>
<token>${splunkToken}</token>
<source>${projectName}</source>
<host>${COMPUTERNAME}</host>
<sourcetype>batch_application_log:json</sourcetype>
<disableCertificateValidation>true</disableCertificateValidation>
<!--<messageFormat>json</messageFormat>-->
<!--<retries_on_error>1</retries_on_error>-->
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>"%msg"</pattern>
</layout>
</appender>
<root level="INFO">
<!--<appender-ref ref="SPLUNK"/>--> if I uncomment this line application never exits
</root>
Java code
public class Main {
public static void main(String[] args) {
final Logger logger = LoggerFactory.getLogger(Main.class);
logger.info("******");
}
}
You could add a Logback shutdown hook, this will close all appenders and stop any active threads related to Logback.
For example:
<configuration debug="true">
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook">
<!--
the default value is 0 millis, I have included a non default
value here just to show you how it can be supplied
-->
<delay>10</delay>
</shutdownHook>
...
<configuration>
With the shutdown hook in place and debug="true" Logback will emit its own log events like so ...
08:57:19,410 |-INFO in ch.qos.logback.core.hook.DelayingShutdownHook#2bafec4c - Sleeping for 10 milliseconds
08:57:19,421 |-INFO in ch.qos.logback.core.hook.DelayingShutdownHook#2bafec4c - Logback context being closed via shutdown hook
Note: there is no requirement to use debug="true", I have only o
included that to show you how to verify that the shutdown hook has been executed.
I have a short 2 step Spring Batch job that reads from an xml rest service call using StaxEventItemReader in Strict mode. I want it in strict mode because without the ability to connect to the rest service, there is no reason to continue. I want to catch the exception and exit gracefully with a custom message, not with a stack trace.
I'm able to catch the exception using a StepExecutionListener with afterStep() method checking the failures (stepExecution.getFailureExceptions()), but the stack trace is still being output. I'm getting my custom message (13:05:32,981 in the STS Output below) plus the stack trace. When I used the ItemReaderListener with onError method the onError method is not called, I'm guessing because it is an initialization exception not a read error.
What is the best method for capturing the failed to initialize reader exception and suppress the stack trace from the output?
SpringBatch Job:
<batch:job id="randomSends2NG">
<batch:step id="getStations" next="generateAndSend">
<batch:tasklet>
<batch:chunk reader="getStationsFromNG_RestXML"
processor="idExtractor"
writer="stationsWriter"
commit-interval="1">
</batch:chunk>
<batch:listeners>
<batch:listener ref="noStationsStopListener" />
</batch:listeners>
</batch:tasklet>
</batch:step>
<batch:step id="generateAndSend">
<batch:tasklet>
<batch:chunk reader="readStationIdsList"
processor="createRandomRequests"
writer="ngBroadcasterService"
commit-interval="400">
</batch:chunk>
</batch:tasklet>
</batch:step>
</batch:job>
STS output with stack trace:
13:05:30,479 [main] INFO SimpleJobLauncher - No TaskExecutor has been set, defaulting to synchronous executor.
13:05:30,776 [main] INFO DepartmentSendCountsNoOpReader - constructing stationSendCountsReader
LightYellow color:43
13:05:31,368 [main] INFO ProcessStatisticsTasklet - constructor...
13:05:31,525 [main] INFO RequestsListReader - constructing requestsListReader
13:05:31,588 [main] INFO Jaxb2Marshaller - Creating JAXBContext with classes to be bound [class com.pevco.pevcotubesystem.StationConfig]
13:05:31,886 [main] INFO SimpleJobLauncher - Job: [FlowJob: [name=randomSends2NG]] launched with the following parameters: [{hostNameOrIP=192.168.100.10:8383}]
13:05:31,902 [main] INFO SimpleStepHandler - Executing step: [getStations]
13:05:32,981 [main] ERROR AbstractStep - Encountered an error executing step getStations in job randomSends2NG
org.springframework.batch.item.ItemStreamException: Failed to initialize the reader
at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:147)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy8.open(Unknown Source)
at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:96)
at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:310)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:195)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:165)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:362)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:590)
Caused by: java.lang.IllegalStateException: Input resource must exist (reader is in 'strict' mode)
at org.springframework.batch.item.xml.StaxEventItemReader.doOpen(StaxEventItemReader.java:195)
at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:144)
... 27 more
13:05:32,981 [main] ERROR NoStationsStopListener - Not able to get stations list from NG. Check that NG is running
13:05:32,998 [main] INFO SimpleJobLauncher - Job: [FlowJob: [name=randomSends2NG]] completed with the following parameters: [{hostNameOrIP=192.168.100.10:8383}] and the following status: [FAILED]
13:05:32,998 [main] INFO ClassPathXmlApplicationContext - Closing org.springframework.context.support.ClassPathXmlApplicationContext#4f4a7090: startup date [Wed Jul 01 13:05:29 EDT 2015]; root of context hierarchy
When facing this problem probably the best solution is to check for REST service as soon as possible because "without the ability to connect to the rest service, there is no reason to continue [...] and exit gracefully with a custom message".
Before first step use a JobExecutionDecider where you check for REST availability and continue or end your job according to service presence/absence.
Installed sqoop server on one of the slave node (hadoop 2.4.1 cluster running on all ubunutu 14 nodes) ,
sqoop2-tool verify returns following error, (also tried placing mysql-connector-java-5.1.34-bin.jar into /usr/lib/sqoop/server/lib , /usr/lib/sqoop/lib/ (created this folder) and /var/lib/sqoop , nothing works )
sqoop2-tool verify
Sqoop home directory: /usr/lib/sqoop
Setting SQOOP_HTTP_PORT: 12000
Setting SQOOP_ADMIN_PORT: 12001
Using CATALINA_OPTS:
Adding to CATALINA_OPTS: -Dsqoop.http.port=12000 -Dsqoop.admin.port=12001
Mar 14, 2015 11:02:53 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/lib/sqoop/lib], exists: [false], isDirectory: [false], canRead: [false]
Sqoop tool executor:
Version: 1.99.5
Revision: 9665c01f674d69d41a6fcfffb2c0b94590f70f59
Compiled on Wed Feb 18 09:42:27 PST 2015 by vbasavaraj
Running tool: class org.apache.sqoop.tools.tool.VerifyTool
2015-03-14 23:02:54,477 INFO [main] core.SqoopServer (SqoopServer.java:initialize(51)) - Booting up Sqoop server
2015-03-14 23:02:54,493 INFO [main] core.PropertiesConfigurationProvider (PropertiesConfigurationProvider.java:initialize(96)) - Starting config file poller thread
log4j: Parsing for [root] with value=[WARN, file].
log4j: Level token is [WARN].
log4j: Category root set to WARN
log4j: Parsing appender named "file".
log4j: Parsing layout options for "file".
log4j: Setting property [conversionPattern] to [%d{ISO8601} %-5p %c{2} [%l] %m%n].
log4j: End of parsing for "file".
log4j: Setting property [file] to [#LOGDIR#/sqoop.log].
log4j: Setting property [maxBackupIndex] to [5].
log4j: Setting property [maxFileSize] to [25MB].
log4j: setFile called: #LOGDIR#/sqoop.log, true
log4j: setFile ended
log4j: Parsed "file" options.
log4j: Parsing for [org.apache.sqoop] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category org.apache.sqoop set to DEBUG
log4j: Handling log4j.additivity.org.apache.sqoop=[null]
log4j: Parsing for [org.apache.derby] with value=[INFO].
log4j: Level token is [INFO].
log4j: Category org.apache.derby set to INFO
log4j: Handling log4j.additivity.org.apache.derby=[null]
log4j: Finished configuring.
log4j: Could not find root logger information. Is this OK?
log4j: Parsing for [default] with value=[INFO,defaultAppender].
log4j: Level token is [INFO].
log4j: Category default set to INFO
log4j: Parsing appender named "defaultAppender".
log4j: Parsing layout options for "defaultAppender".
log4j: Setting property [conversionPattern] to [%d %-5p %c: %m%n].
log4j: End of parsing for "defaultAppender".
log4j: Setting property [file] to [#LOGDIR#/default.audit].
log4j: setFile called: #LOGDIR#/default.audit, true
log4j: setFile ended
log4j: Parsed "defaultAppender" options.
log4j: Handling log4j.additivity.default=[null]
log4j: Finished configuring.
Exception in thread "PurgeThread" org.apache.sqoop.common.SqoopException: JDBCREPO_0009:Failed to finalize transaction
at org.apache.sqoop.repository.JdbcRepositoryTransaction.close(JdbcRepositoryTransaction.java:115)
at org.apache.sqoop.repository.JdbcRepository.doWithConnection(JdbcRepository.java:109)
at org.apache.sqoop.repository.JdbcRepository.doWithConnection(JdbcRepository.java:61)
at org.apache.sqoop.repository.JdbcRepository.purgeSubmissions(JdbcRepository.java:589)
at org.apache.sqoop.driver.JobManager$PurgeThread.run(JobManager.java:648)
Caused by: java.sql.SQLNonTransientConnectionException: No current connection.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.commit(Unknown Source)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211)
at org.apache.sqoop.repository.JdbcRepositoryTransaction.close(JdbcRepositoryTransaction.java:112)
... 4 more
Caused by: java.sql.SQLException: No current connection.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 15 more
Verification was successful.
Tool class org.apache.sqoop.tools.tool.VerifyTool has finished correctly.
hduser#slave:/usr/lib/sqoop/bin$ hadoop version
Hadoop 2.4.1
Subversion http://svn.apache.org/repos/asf/hadoop/common -r 1604318
Compiled by jenkins on 2014-06-21T05:43Z
Compiled with protoc 2.5.0
From source with checksum bb7ac0a3c73dc131f4844b873c74b630
This command was run using /usr/local/hadoop/share/hadoop/common/hadoop-common-2.4.1.jar
This is related to the derby repository actually. In fact, this exception is probably not a problem. The message Verification was successful. means that the tool finished correctly. Try starting Sqoop2 via bin/sqoop.sh server start and connecting a client to it via bin/sqoop.sh client.
Follow up with the community at user#sqoop.apache.org.
I used API Manager 1.5.0,BAM 2.4.0,and mysql as WSO2AM_STATS_DB. After configuratting AM and BAM,starting BAM.It is ok! But,when I start AM,It shows those logs:
INFO - AgentDS Successfully deployed Agent Client
INFO - EmbeddedRegistryService Configured Registry in 124ms
INFO - RegistryCoreServiceComponent Registry Mode : READ-WRITE
INFO - UserStoreMgtDSComponent Carbon UserStoreMgtDSComponent activated successfully.
INFO - TaglibUriRule TLD skipped. URI: http://tiles.apache.org/tags-tiles is already defined
WARN - CarbonServerManager Carbon initialization is delayed due to the following unsatisfied items:
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.mediation.configadmin-4.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.apimgt.gateway-1.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.localentry-4.2.0
WARN - CarbonServerManager Carbon initialization is delayed due to the following unsatisfied items:
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.mediation.configadmin-4.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.apimgt.gateway-1.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.localentry-4.2.0
WARN - CarbonServerManager Carbon initialization is delayed due to the following unsatisfied items:
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.mediation.configadmin-4.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.apimgt.gateway-1.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.localentry-4.2.0
WARN - CarbonServerManager Carbon initialization is delayed due to the following unsatisfied items:
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.mediation.configadmin-4.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.apimgt.gateway-1.2.0
WARN - CarbonServerManager Waiting for required OSGiAxis2Service: org.wso2.carbon.localentry-4.2.0
AM can not run, It always shows "Waiting for required OSGiAxis2Service....." . I do not know how to resolve it.