We use Spring Integration fairly heavily and it works great. However, I'm unsure how to get Jsch/Spring Integration to log the actual file that is in question, when I get an error thrown from, for example, trying to do a list on a directory that does not exist on an sftp server. I get exceptions like the below.
Is there any way to coax either Spring Integration or Jsch to print out information on the file for "No such file"? When I looked at Jsch code it did not seem like there was any logging for that particular issue, but I may have missed something, and even if it does not have something, maybe the Spring code that is catching this exception has some context that it could log.
As it is, we either have to attach a debugger in instances like this, or try to make an educated guess about what directory or directories we may have to set up.
Caused by: org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:444)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:235)
... 13 common frames omitted
Caused by: org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:104)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:50)
at org.springframework.integration.file.remote.session.CachingSessionFactory$CachedSession.list(CachingSessionFactory.java:218)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:239)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:235)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:435)
... 14 common frames omitted
Caused by: com.jcraft.jsch.SftpException: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
I opened INT-4534 to add the directory to the exception.
Related
While running UploadJars utility after giving all the parameters, utility is failing with following exception:
Logging configuration class "oracle.core.ojdl.logging.LoggingConfiguration" failed
java.lang.ClassNotFoundException: oracle.core.ojdl.logging.LoggingConfiguration
Error occurred in performing the operation:
Exception in thread "main" java.lang.NullPointerException
at oracle.iam.platformservice.utils.JarUploadUtility.main(JarUploadUtility.java:232)
Any help will be appreciated :)
We had the same problem.
We added
ORACLE_COMMON/modules/oracle.odl_11.1.1/ojdl.jar
(where ORACLE_COMMON is your oracle_common directory) to the start of our CLASSPATH and the error went away.
I think UploadJars.sh worked anyway, it was just writing out a problem with logging what it was doing.
btw, Note you might need to use UpdateJars.sh if an earlier version of the file already exists. You can check if the upload/update was successful by looking at the date in OIMHOME_JARS.UPDATED_ON.
There is some issue with the implementation of DecisionTable in Excel file, if i am using newClasspathResource to load the excel file, where as if i use newFileResource with path of the file it works fine with the same file.
The Exception is:
Caused by: org.drools.template.parser.DecisionTableParseException: An error occurred opening the workbook. It is possible that the encoding of the document did not match the encoding of the reader.
at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:85)
at org.drools.decisiontable.SpreadsheetCompiler.parseResource(SpreadsheetCompiler.java:126)
at org.drools.decisiontable.SpreadsheetCompiler.getRuleSheetListener(SpreadsheetCompiler.java:185)
at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:172)
at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:167)
at org.drools.decisiontable.DecisionTableProviderImpl.compileResource(DecisionTableProviderImpl.java:81)
at org.drools.decisiontable.DecisionTableProviderImpl.loadFromResource(DecisionTableProviderImpl.java:44)
at org.drools.compiler.compiler.DecisionTableFactory.loadFromResource(DecisionTableFactory.java:37)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.decisionTableToPackageDescr(KnowledgeBuilderImpl.java:404)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addPackageFromDecisionTable(KnowledgeBuilderImpl.java:374)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addKnowledgeResource(KnowledgeBuilderImpl.java:766)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:2249)
Caused by: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:211)
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:168)
at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:83)
... 47 more
I think i found the reason, why this was a problem. Actually with my gradle builds, i was processing and filtering some resources and realised that xls file being in resources as well, was being processed through it and somehow being changed while in compiled build path.
I skipped this file to pass through those filtering and processing via build and all is good.
I'm using CAS for single signon solution, My log(log4j version 1.2.15) file completely fills with the Exception(org.jasig.cas.authentication.handler.BadCredentialsAuthenticationException)
Stack trace when User enters invalid login credentials.
Is there a solution to trim the Stack trace in CAS or Java?
I can't use log4j EnhancePatternLayout to achieve this as it requires log4j version 1.2.16
Any suggestions around this problem would be appreciated.
Thanks
I haven't used CAS. However, the way that I've gotten around similar problems in the past is by suppressing log messages from the offending class. For example, if you're using a log4j.properties file, insert this line:
log4j.logger.com.jasig.cas.WhateverClassLogsTheException=OFF
Note that you will need to suppress messages from the class that throws the exception, not the exception class itself. Also, you can also use FATAL or other values to ensure that only log messages that are at or above the given level are logged. See the Log4J docs for more information.
Note that this will suppress all messages from that class, not just the particular log message that produces that exception.
The problem is CAS is passing Exception object to Log4j,so I did comment that line in my overlayed class. BindLdapAuthenticationHandler.java
I am trying to access a file on my computer using the following code:
new File('c:/test.txt').eachLine{
line->println line
}
I know the file exists, why do I see an error that the file is not found. Is this maybe an issue with my groovy install?
This has nothing to do with the code or your groovy installation.
Recheck the file extension. If you are on Windows 7, the file extensions might be hidden while viewed in the Windows Explorer.
Also, it is better to respect the case sensitivity of filenames, if in case you are working on a Linux machine (which I assume not).
Or perhaps it could also have something to do with file permissions if in case your stack trace looks like this:
java.io.FileNotFoundException: (Permission denied)
If you pass JMS params (-Xms -Xmx etc.) to the groovy command you would get that result. You can find the full explanation here.
When I launch CruiseControl.NET with a particular configuration file I receive the following error:
ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Duplicate node detected
What does this mean, and what causes it?
I think you have 2 nodes in your config where it only expected one. Is there any chance you could post the config file it is throwing the exception on here as additional information? I'm using cruisecontrol (not the .net version) currently and find it can be very picky about it's XML files (rightly so) but not tell you anything about where in the file the exceptions were thrown from.
I found that I had an incorrectly structured config file. In particular, some blocks were outside of the configuration section. The error pointed to the second of these exec sections- apparently it didn't like that there was more than one of a given section inside the project.
Thus, the error occurred due a config file like this:
<project>
<tasks>
...
</tasks>
<exec>...</exec>
<exec>...</exec>
<project>
In my case I had something like:
<task>...</task>
<sourceControls>...</sourceControls>
<task>...</task>
<publishers>...</publishers>
It didn't like the two "<task>" nodes so I fixed it by removing the first "<task>" node. I was trying to do some stuff before getting the latest from svn, and then doing the build after that in the second "<task>" node. I'll need to revisit how to do that...any suggestions?