karma not finding files - jasmine

This application is built in Visual Studio 2013 and uses gulpJs for bundling, minification, and running js tests. I can run my tests by right clicking on a html file in my tests project and 'View in Browser'. When I run the gulp task that starts karma, the browser opens and I get an error:
ReferenceError: angular is not defined
at Suite.<anonymous> (C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/billingAddressController.spec.js:5:16)
Here is my karma.conf.js
module.exports = function (config) {
config.set({
browsers: ['Chrome'],
frameworks: ['jasmine'],
files: [
'./../../eStore.JS.Specs/Tools/angular.min.js',
'./../../eStore.JS.Specs/Tools/angular-mocks.js',
'./Scripts/**/*.js',
'./../../eStore.JS.Specs/**/*.spec.js'
],
logLevel: config.LOG_DEBUG,
autoWatch: true,
singleRun: false
});
};
Here is my gulp.js test task:
var testFiles = '../../eStore.JS.Specs/**/*.spec.js';
gulp.task('test', function () {
gulp.src(testFiles)
.pipe(karma({
configFile: './karma.conf.js',
action: 'run'
})
.on('error', errorHandler));
});
It seems karma is requesting all my spec files, but I see no requests for angular, angular-mocks, or my JS files under test. Here is the karma output:
17 09 2015 16:18:33.827:DEBUG [plugin]: Loading karma-* from C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules
17 09 2015 16:18:33.832:DEBUG [plugin]: Loading plugin C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules/karma-chrome-launcher.
17 09 2015 16:18:33.846:DEBUG [plugin]: Loading plugin C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules/karma-jasmine.
17 09 2015 16:18:33.915:WARN [karma]: Port 9876 in use
17 09 2015 16:18:33.916:INFO [karma]: Karma v0.13.9 server started at http://localhost:9877/
17 09 2015 16:18:33.931:INFO [launcher]: Starting browser Chrome
17 09 2015 16:18:33.932:DEBUG [temp-dir]: Creating temp dir at C:\Users\lanry001\AppData\Local\Temp\karma-82999076
17 09 2015 16:18:33.933:DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --user-data-dir=C:\Users\lanry001\AppData\Local\Temp\karma-82999076 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate http://localhost:9877/?id=82999076
17 09 2015 16:18:36.120:DEBUG [web-server]: serving: C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules\karma\static/client.html
17 09 2015 16:18:36.169:DEBUG [web-server]: serving: C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules\karma\static/karma.js
17 09 2015 16:18:36.268:DEBUG [karma]: A browser has connected on socket KC-_aUVr3iMH3R9aAAAA
17 09 2015 16:18:36.270:DEBUG [web-server]: serving: C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules\karma\static/favicon.ico
17 09 2015 16:18:36.278:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=KC-_aUVr3iMH3R9aAAAA
17 09 2015 16:18:36.336:INFO [Chrome 45.0.2454 (Windows 7 0.0.0)]: Connected on socket KC-_aUVr3iMH3R9aAAAA with id 82999076
17 09 2015 16:18:36.337:DEBUG [launcher]: Chrome (id 82999076) captured in 2.421 secs
17 09 2015 16:18:36.375:DEBUG [web-server]: serving: C:\Dev\eStoreNextGen\eStore-branch-F2\eStore\Web\eStore\node_modules\karma\static/context.html
17 09 2015 16:18:36.392:DEBUG [middlware:source-files]: Requesting /base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?578a1e5ff14db21b04e2d6db7fd0eda37042440c /
17 09 2015 16:18:36.393:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/Web/eStore/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
17 09 2015 16:18:36.396:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/Web/eStore/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
17 09 2015 16:18:36.400:DEBUG [middlware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/boot.js?4a7da64f416169520c9d5c43b5a7feac6bde9104 /
17 09 2015 16:18:36.401:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/Web/eStore/node_modules/karma-jasmine/lib/boot.js
17 09 2015 16:18:36.402:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/Web/eStore/node_modules/karma-jasmine/lib/boot.js
17 09 2015 16:18:36.403:DEBUG [middlware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/adapter.js?3030709c83121e1b2ca4d1e657306b834fc13350 /
17 09 2015 16:18:36.403:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/Web/eStore/node_modules/karma-jasmine/lib/adapter.js
17 09 2015 16:18:36.404:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/Web/eStore/node_modules/karma-jasmine/lib/adapter.js
17 09 2015 16:18:36.411:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/billingAddressController.spec.js?77fb3fd410364a99aa9b97857e540429cb6c1cdd /
17 09 2015 16:18:36.411:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/billingAddressController.spec.js
17 09 2015 16:18:36.412:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/billingAddressController.spec.js
17 09 2015 16:18:36.417:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/continueCheckoutController.spec.js?d2bf9c9b3c195931ee577cb02376e3bc031b69f5 /
17 09 2015 16:18:36.417:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/continueCheckoutController.spec.js
17 09 2015 16:18:36.418:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/continueCheckoutController.spec.js
17 09 2015 16:18:36.420:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/paymentController.spec.js?7b1a0f34f75d121e380045ebbf27a05a90aa2ef6 /
17 09 2015 16:18:36.420:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/paymentController.spec.js
17 09 2015 16:18:36.421:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/paymentController.spec.js
17 09 2015 16:18:36.426:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewBillingController.spec.js?d1dd4012eb89d012c0624bd3c1edc2d2d7bc8dc4 /
17 09 2015 16:18:36.427:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewBillingController.spec.js
17 09 2015 16:18:36.427:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewBillingController.spec.js
17 09 2015 16:18:36.429:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewCartController.spec.js?8deeec6e6290d578724508625dccfb2db8aa1731 /
17 09 2015 16:18:36.430:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewCartController.spec.js
17 09 2015 16:18:36.431:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewCartController.spec.js
17 09 2015 16:18:36.441:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewShippingController.spec.js?0de14d74b1d27dbb3f2a2e9874885d19f891e229 /
17 09 2015 16:18:36.441:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewShippingController.spec.js
17 09 2015 16:18:36.442:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/reviewShippingController.spec.js
17 09 2015 16:18:36.447:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/shippingAddressController.spec.js?768216b5b1fab88b00382cecc077f75e0b5d63e6 /
17 09 2015 16:18:36.449:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/shippingAddressController.spec.js
17 09 2015 16:18:36.451:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/shippingAddressController.spec.js
17 09 2015 16:18:36.454:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/shippingOptionsController.spec.js?e9833a1fd1cebf78843f35c719f1f34fff75b7cd /
17 09 2015 16:18:36.454:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/shippingOptionsController.spec.js
17 09 2015 16:18:36.456:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/shippingOptionsController.spec.js
17 09 2015 16:18:36.457:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/submitOrderController.spec.js?de0f526507cc7cc74705aec4de7be4e83f0d4e7c /
17 09 2015 16:18:36.457:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/submitOrderController.spec.js
17 09 2015 16:18:36.458:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/submitOrderController.spec.js
17 09 2015 16:18:36.460:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/addressSelectorController.spec.js?3d88eef3c2edbcd652206271c3d7a7debac3d603 /
17 09 2015 16:18:36.460:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/addressSelectorController.spec.js
17 09 2015 16:18:36.463:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/addressSelectorController.spec.js
17 09 2015 16:18:36.466:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/cartController.spec.js?99de5adfa7d042b7621e7fc2abd5cc01df58e8c7 /
17 09 2015 16:18:36.467:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/cartController.spec.js
17 09 2015 16:18:36.467:DEBUG [middlware:source-files]: Requesting /absoluteC:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/departmentListController.spec.js?732b464f4d7a2a2ef8a8e72f03911ed82518e384 /
17 09 2015 16:18:36.468:DEBUG [middlware:source-files]: Fetching C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/departmentListController.spec.js
17 09 2015 16:18:36.468:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/cartController.spec.js
17 09 2015 16:18:36.471:DEBUG [web-server]: serving (cached): C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Common/departmentListController.spec.js
Chrome 45.0.2454 (Windows 7 0.0.0): Executed 0 of 12 SUCCESS (0 secs / 0 secs)
Chrome 45.0.2454 (Windows 7 0.0.0) encountered a declaration exception FAILED
ReferenceError: angular is not defined
at Suite.<anonymous> (C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/billingAddressController.spec.js:5:16)
at C:/Dev/eStoreNextGen/eStore-branch-F2/eStore/eStore.JS.Specs/Checkout/billingAddressController.spec.js:4:1
Chrome 45.0.2454 (Windows 7 0.0.0): Executed 1 of 12 (1 FAILED) (0 secs / 0.008 secs)
Chrome 45.0.2454 (Windows 7 0.0.0) encountered a declaration exception FAILED
And for reference, here is my HTML spec runner (that works):
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="Tools/jasmine-2.3.4/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="Tools/jasmine-2.3.4/jasmine.css">
<script src="Tools/jasmine-2.3.4/jasmine.js"></script>
<script src="Tools/jasmine-2.3.4/jasmine-html.js"></script>
<script src="Tools/jasmine-2.3.4/boot.js"></script>
<script src="Tools/angular.min.js"></script>
<script src="Tools/angular-block-ui.min.js"></script>
<script src="Tools/angular-mocks.js"></script>
<script src="Tools/angular-route.min.js"></script>
<script src="Tools/jquery-1.11.3.min.js"></script>
<script src="Tools/sinon-1.16.1.js"></script>
<script src="Tools/sinon-stub-promise.js"></script>
<script src="Tools/ui-bootstrap-tpls-0.13.4.min.js"></script>
<script src="Tools/underscore.min.js"></script>
<!-- angular modules -->
<script src="../web/estore/Scripts/Common/underscoreApp.js"></script>
<script src="../web/estore/Scripts/Common/directives/dccdirectivesapp.js"></script>
<script src="../web/estore/Scripts/eStoreApp.js"></script>
<script src="../web/estore/Scripts/lib/angular-block-ui.min.js"></script>
<!-- angular app files -->
<script src="../web/estore/Scripts/Checkout/AddressSelector/addressSelectorController.js"></script>
<script src="../web/estore/Scripts/Checkout/BillingAddress/billingAddressController.js"></script>
<script src="../web/estore/Scripts/Checkout/BillingAddress/billingAddressService.js"></script>
<script src="../web/estore/Scripts/Checkout/checkoutData.js"></script>
<script src="../web/estore/Scripts/Checkout/checkoutValidation.js"></script>
<script src="../web/estore/Scripts/Checkout/ContinueCheckout/continueCheckoutController.js"></script>
<script src="../web/estore/Scripts/Checkout/Payment/paymentController.js"></script>
<script src="../web/estore/Scripts/Checkout/ReviewBilling/reviewBillingController.js"></script>
<script src="../web/estore/Scripts/Checkout/ReviewCart/reviewCartController.js"></script>
<script src="../web/estore/Scripts/Checkout/ReviewShipping/reviewShippingController.js"></script>
<script src="../web/estore/Scripts/Checkout/ShippingAddress/shippingAddressController.js"></script>
<script src="../web/estore/Scripts/Checkout/ShippingAddress/shippingAddressService.js"></script>
<script src="../web/estore/Scripts/Checkout/ShippingOptions/shippingOptionsController.js"></script>
<script src="../web/estore/Scripts/Checkout/ShippingOptions/shippingOptionsService.js"></script>
<script src="../web/estore/Scripts/Checkout/SubmitOrder/submitOrderController.js"></script>
<script src="../web/estore/Scripts/Checkout/SubmitOrder/submitOrderService.js"></script>
<script src="../web/estore/Scripts/Common/Directives/cart/cartController.js"></script>
<script src="../web/estore/Scripts/Common/Directives/navigation/departmentListController.js"></script>
<script src="../web/estore/Scripts/Common/Directives/Navigation/departmentService.js"></script>
<script src="../web/estore/Scripts/Common/Directives/navigation/navigationController.js"></script>
<script src="../web/estore/Scripts/Common/Services/addressService.js"></script>
<script src="../web/estore/Scripts/Common/Services/cartservice.js"></script>
<script src="../web/estore/Scripts/Common/Services/dateService.js"></script>
<script src="../web/estore/Scripts/Common/Services/pageContentTranslationService.js"></script>
<script src="../web/estore/Scripts/Common/Services/sessionService.js"></script>
<script src="../web/estore/Scripts/Common/Services/settingsService.js"></script>
<!-- test files -->
<script src="Checkout/billingAddressController.spec.js"></script>
<script src="Checkout/continuecheckoutcontroller.spec.js"></script>
<script src="Checkout/paymentController.spec.js"></script>
<script src="Checkout/reviewBillingController.spec.js"></script>
<script src="Checkout/reviewShippingController.spec.js"></script>
<script src="Checkout/reviewCartController.spec.js"></script>
<script src="Checkout/shippingAddressController.spec.js"></script>
<script src="Checkout/shippingOptionsController.spec.js"></script>
<script src="Checkout/submitOrderController.spec.js"></script>
<script src="Common/addressSelectorController.spec.js"></script>
<script src="Common/cartController.spec.js"></script>
<script src="Common/departmentListController.spec.js"></script>
</head>
<body>
</body>
</html>

In your gulp task, replace:
configFile: './karma.conf.js'
with:
configFile: path.join(__dirname, './karma.conf.js')
This assumes you have:
var path = require('path');

Use server.start in the package 'karma' rather than the 'gulp-karma' package.
var karma = require('karma').server;
karma.start({
configFile: __dirname + '/karma.conf.js',
}, karmaCompleted);
function karmaCompleted(karmaResult) {
log('Karma completed');
if (karmaResult === 1) {
done('karma: tests failed with code ' + karmaResult);
} else {
done();
}
}

Related

elasticdump error while performs export or import

whenever i start to import or export the data, i faced this error from elasticdump...
starting dump
Mon, 07 Oct 2019 06:15:25 GMT | got 5 objects from source file (offset: 0)
Mon, 07 Oct 2019 06:15:26 GMT | Error Emitted => Cannot read property 'body' of undefined
Mon, 07 Oct 2019 06:15:26 GMT | Total Writes: 0
Mon, 07 Oct 2019 06:15:26 GMT | dump ended with error (set phase) => TypeError: Cannot read property 'body' of undefined
any help is highly appreciated

How should I load resources from src/main/resources in Kotlin?

I'm working on a Spring Boot application written in Kotlin (using Maven), and everything works fine but after generating the jar of my application, it throws an Exception because it can't find the folder src/main/resources:
Caused by: java.io.FileNotFoundException: src\main\resources\data\circuits-arrets.json
I read that could be because I use File class, and it doesn't work properly after generating the jar. Here's how I read my file:
var line: String?
val bufferedReader = BufferedReader(FileReader(File(csvLocation)))
do {
line = bufferedReader.readLine()
if (line != null) {
//Do something with 'line'
}
} while (line != null)
I found some solutions using InputStream instead of File in the BufferedReader.
My question is: Does it really change something for the jar? If yes, how should I do then?
Thank you in advance.
EDIT:
Here's the output of the command jar tvf my-jar.jar :
0 Fri Feb 15 10:34:14 CET 2019 META-INF/
552 Fri Feb 15 10:34:14 CET 2019 META-INF/MANIFEST.MF
0 Fri Feb 15 10:34:14 CET 2019 org/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/data/
2688 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/jar/
9736 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarURLConnection.class
1374 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile$JarFileType.class
14915 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile.class
3414 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarEntry.class
345 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/FileHeader.class
3172 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/StringSequence.class
4976 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/AsciiBytes.class
1593 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFileEntries$1.class
1997 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class
10728 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFileEntries.class
540 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryVisitor.class
299 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarEntryFilter.class
5267 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class
3116 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class
4624 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryParser.class
1693 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/ZipInflaterInputStream.class
11509 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/Handler.class
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/archive/
302 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/Archive$Entry.class
437 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/Archive$EntryFilter.class
945 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/Archive.class
1487 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class
3837 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class
5243 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive.class
1484 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class
19737 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher.class
282 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile$1.class
2062 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile$1.class
1233 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile$2.class
3263 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile$FileAccess.class
4015 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile.class
1102 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class
1081 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class
7336 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/JarFileArchive.class
1502 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/MainMethodRunner.class
3608 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/ExecutableArchiveLauncher.class
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/util/
5203 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/util/SystemPropertyUtils.class
485 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessData.class
273 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$1.class
1779 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class
1953 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class
266 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher$1.class
4684 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/Launcher.class
1721 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/WarLauncher.class
1585 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/JarLauncher.class
1527 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/LaunchedURLClassLoader$UseFastConnectionExceptionsEnumeration.class
5687 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/LaunchedURLClassLoader.class
616 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/Bytes.class
702 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarURLConnection$1.class
4306 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class
0 Fri Feb 15 10:34:14 CET 2019 BOOT-INF/
0 Fri Feb 15 10:34:14 CET 2019 BOOT-INF/classes/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/constants/
0 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/entities/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/jsonEntities/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/repositories/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/security/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/services/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/utils/
0 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/
0 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/com.auth0.samples/
0 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/com.auth0.samples/kotlin-spring-boot/
584 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/application.properties
87499 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/circuits-arrets.json
261015 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/tan-arrets.csv
1029 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/Configuration.class
3471 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/ApplicationUserController.class
6013 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/BaseController.class
1701 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/BikeStationController.class
1692 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/BusStationController.class
612 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/FavoriteController$WhenMappings.class
5385 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/FavoriteController.class
1778 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/LineController.class
7389 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/StationController.class
1868 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/jsonEntities/Arret.class
1079 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/jsonEntities/BusLineLibelle.class
3252 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/ApplicationUser.class
2977 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/BikeStation.class
2140 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/Favorite.class
2981 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/Station.class
1195 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/BaseVM.class
3691 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/StationVM.class
1663 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/KotlinSpringBootApplicationKt.class
812 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/repositories/BaseRepository.class
702 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/BusStationRepository.class
672 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/LineRepository.class
5530 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/JWTAuthenticationFilter.class
2578 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/UserDetailsServiceImpl.class
4617 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/BaseService.class
1186 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/LineService.class
5525 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/StartingDataInjector.class
7943 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/utils/ParsersKt.class
121 Fri Feb 15 10:34:08 CET 2019 META-INF/kotlin-spring-boot.kotlin_module
7216 Fri Feb 15 10:31:38 CET 2019 META-INF/maven/com.auth0.samples/kotlin-spring-boot/pom.xml
1693 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/constants/ConstantsKt.class
1805 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/AccessCondition.class
1065 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/BaseEntity.class
3506 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/BusStation.class
1434 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/FavoriteType.class
2945 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/Line.class
2056 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/StationType.class
2081 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/LineVM.class
613 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/KotlinSpringBootApplication.class
1101 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/repositories/ApplicationUserRepository.class
707 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/BikeStationRepository.class
692 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/FavoriteRepository.class
687 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/StationRepository.class
4738 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/JWTAuthorizationFilter.class
6776 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/WebSecurity.class
1235 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/BikeStationService.class
1228 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/BusStationService.class
1207 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/StationService.class
2405 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/utils/FindersKt.class
5205 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/VMUtils.class
114 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/com.auth0.samples/kotlin-spring-boot/pom.properties
29487 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/stations-velos-libre-service-nantes-metropole.csv
0 Fri Feb 15 10:34:14 CET 2019 BOOT-INF/lib/
628 Wed May 09 13:41:28 CEST 2018 BOOT-INF/lib/spring-boot-starter-data-jpa-2.0.2.RELEASE.jar
593 Wed May 09 13:30:56 CEST 2018 BOOT-INF/lib/spring-boot-starter-2.0.2.RELEASE.jar
927496 Wed May 09 13:19:02 CEST 2018 BOOT-INF/lib/spring-boot-2.0.2.RELEASE.jar
1161361 Wed May 09 13:25:34 CEST 2018 BOOT-INF/lib/spring-boot-autoconfigure-2.0.2.RELEASE.jar
613 Wed May 09 13:30:56 CEST 2018 BOOT-INF/lib/spring-boot-starter-logging-2.0.2.RELEASE.jar
290339 Fri Mar 31 21:27:54 CEST 2017 BOOT-INF/lib/logback-classic-1.2.3.jar
471901 Fri Mar 31 21:27:16 CEST 2017 BOOT-INF/lib/logback-core-1.2.3.jar
17519 Sun Nov 19 01:08:44 CET 2017 BOOT-INF/lib/log4j-to-slf4j-2.10.0.jar
255485 Sun Nov 19 00:48:58 CET 2017 BOOT-INF/lib/log4j-api-2.10.0.jar
4596 Thu Mar 16 17:37:48 CET 2017 BOOT-INF/lib/jul-to-slf4j-1.7.25.jar
26586 Wed Feb 21 15:54:16 CET 2018 BOOT-INF/lib/javax.annotation-api-1.3.2.jar
297518 Sat Oct 14 11:44:44 CEST 2017 BOOT-INF/lib/snakeyaml-1.19.jar
600 Wed May 09 13:41:20 CEST 2018 BOOT-INF/lib/spring-boot-starter-aop-2.0.2.RELEASE.jar
1930381 Wed Nov 15 11:26:54 CET 2017 BOOT-INF/lib/aspectjweaver-1.8.13.jar
598 Wed May 09 13:41:22 CEST 2018 BOOT-INF/lib/spring-boot-starter-jdbc-2.0.2.RELEASE.jar
143471 Thu Apr 05 17:30:38 CEST 2018 BOOT-INF/lib/HikariCP-2.7.9.jar
401279 Tue May 08 08:06:44 CEST 2018 BOOT-INF/lib/spring-jdbc-5.0.6.RELEASE.jar
6739203 Thu Apr 26 11:06:04 CEST 2018 BOOT-INF/lib/hibernate-core-5.2.17.Final.jar
66469 Wed Feb 14 13:23:28 CET 2018 BOOT-INF/lib/jboss-logging-3.3.2.Final.jar
113371 Fri Jul 26 12:01:34 CEST 2013 BOOT-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar
739582 Tue Oct 10 18:04:58 CEST 2017 BOOT-INF/lib/javassist-3.22.0-GA.jar
445288 Wed Sep 06 11:15:06 CEST 2006 BOOT-INF/lib/antlr-2.7.7.jar
186741 Tue Aug 02 13:41:56 CEST 2016 BOOT-INF/lib/jandex-2.0.3.Final.jar
65100 Sat Sep 09 14:47:28 CEST 2017 BOOT-INF/lib/classmate-1.3.4.jar
313898 Mon May 16 14:19:12 CEST 2005 BOOT-INF/lib/dom4j-1.6.1.jar
75288 Tue Nov 24 15:03:08 CET 2015 BOOT-INF/lib/hibernate-commons-annotations-5.0.1.Final.jar
30724 Mon May 13 15:11:34 CEST 2013 BOOT-INF/lib/javax.transaction-api-1.2.jar
335660 Tue May 08 14:29:02 CEST 2018 BOOT-INF/lib/spring-data-jpa-2.0.7.RELEASE.jar
1076871 Tue May 08 14:23:50 CEST 2018 BOOT-INF/lib/spring-data-commons-2.0.7.RELEASE.jar
191789 Tue May 08 08:07:28 CEST 2018 BOOT-INF/lib/spring-orm-5.0.6.RELEASE.jar
255201 Tue May 08 08:06:38 CEST 2018 BOOT-INF/lib/spring-tx-5.0.6.RELEASE.jar
41203 Thu Mar 16 17:36:32 CET 2017 BOOT-INF/lib/slf4j-api-1.7.25.jar
46745 Tue May 08 08:08:48 CEST 2018 BOOT-INF/lib/spring-aspects-5.0.6.RELEASE.jar
588 Wed May 09 13:41:32 CEST 2018 BOOT-INF/lib/spring-boot-starter-web-2.0.2.RELEASE.jar
645 Wed May 09 13:41:30 CEST 2018 BOOT-INF/lib/spring-boot-starter-json-2.0.2.RELEASE.jar
33392 Mon Mar 26 15:55:48 CEST 2018 BOOT-INF/lib/jackson-datatype-jdk8-2.9.5.jar
99630 Mon Mar 26 15:56:26 CEST 2018 BOOT-INF/lib/jackson-datatype-jsr310-2.9.5.jar
8646 Mon Mar 26 15:54:04 CEST 2018 BOOT-INF/lib/jackson-module-parameter-names-2.9.5.jar
591 Wed May 09 13:41:32 CEST 2018 BOOT-INF/lib/spring-boot-starter-tomcat-2.0.2.RELEASE.jar
3115994 Fri Apr 27 21:24:52 CEST 2018 BOOT-INF/lib/tomcat-embed-core-8.5.31.jar
240244 Fri Apr 27 21:24:54 CEST 2018 BOOT-INF/lib/tomcat-embed-el-8.5.31.jar
256776 Fri Apr 27 21:24:54 CEST 2018 BOOT-INF/lib/tomcat-embed-websocket-8.5.31.jar
1130724 Tue Mar 27 09:03:18 CEST 2018 BOOT-INF/lib/hibernate-validator-6.0.9.Final.jar
93107 Tue Dec 19 16:23:28 CET 2017 BOOT-INF/lib/validation-api-2.0.1.Final.jar
1254097 Tue May 08 08:07:04 CEST 2018 BOOT-INF/lib/spring-web-5.0.6.RELEASE.jar
789889 Tue May 08 08:07:52 CEST 2018 BOOT-INF/lib/spring-webmvc-5.0.6.RELEASE.jar
604 Wed May 09 13:41:42 CEST 2018 BOOT-INF/lib/spring-boot-starter-security-2.0.2.RELEASE.jar
366299 Tue May 08 08:06:20 CEST 2018 BOOT-INF/lib/spring-aop-5.0.6.RELEASE.jar
691611 Tue May 08 15:25:12 CEST 2018 BOOT-INF/lib/spring-security-config-5.0.5.RELEASE.jar
494788 Tue May 08 15:24:48 CEST 2018 BOOT-INF/lib/spring-security-web-5.0.5.RELEASE.jar
72603 Thu Jan 10 22:41:24 CET 2019 BOOT-INF/lib/spring-security-crypto-5.1.3.RELEASE.jar
433210 Thu Jan 10 22:41:26 CET 2019 BOOT-INF/lib/spring-security-core-5.1.3.RELEASE.jar
660573 Tue May 08 08:06:02 CEST 2018 BOOT-INF/lib/spring-beans-5.0.6.RELEASE.jar
1090735 Tue May 08 08:06:32 CEST 2018 BOOT-INF/lib/spring-context-5.0.6.RELEASE.jar
1226584 Tue May 08 08:05:54 CEST 2018 BOOT-INF/lib/spring-core-5.0.6.RELEASE.jar
21704 Tue May 08 08:05:42 CEST 2018 BOOT-INF/lib/spring-jcl-5.0.6.RELEASE.jar
279878 Tue May 08 08:06:20 CEST 2018 BOOT-INF/lib/spring-expression-5.0.6.RELEASE.jar
13769 Tue Nov 13 13:35:54 CET 2018 BOOT-INF/lib/kotlin-stdlib-jdk8-1.3.10.jar
1181292 Tue Nov 13 13:25:52 CET 2018 BOOT-INF/lib/kotlin-stdlib-1.3.10.jar
151024 Tue Nov 13 13:24:28 CET 2018 BOOT-INF/lib/kotlin-stdlib-common-1.3.10.jar
17536 Tue Dec 17 16:10:34 CET 2013 BOOT-INF/lib/annotations-13.0.jar
3137 Tue Nov 13 13:35:52 CET 2018 BOOT-INF/lib/kotlin-stdlib-jdk7-1.3.10.jar
2645740 Tue Nov 13 13:33:06 CET 2018 BOOT-INF/lib/kotlin-reflect-1.3.10.jar
501860 Wed Aug 15 21:36:52 CEST 2018 BOOT-INF/lib/commons-lang3-3.8.jar
127509 Fri Aug 04 15:17:50 CEST 2017 BOOT-INF/lib/javax.ws.rs-api-2.1.jar
164361 Sun Dec 23 12:30:54 CET 2018 BOOT-INF/lib/klaxon-5.0.1.jar
50732 Thu Jan 03 15:45:18 CET 2019 BOOT-INF/lib/java-jwt-3.5.0.jar
1342410 Mon Mar 26 15:13:56 CEST 2018 BOOT-INF/lib/jackson-databind-2.9.5.jar
66519 Sat Jul 29 20:53:26 CEST 2017 BOOT-INF/lib/jackson-annotations-2.9.0.jar
321590 Mon Mar 26 08:04:00 CEST 2018 BOOT-INF/lib/jackson-core-2.9.5.jar
335042 Tue Oct 17 08:53:20 CEST 2017 BOOT-INF/lib/commons-codec-1.11.jar
1007502 Tue Aug 07 08:59:10 CEST 2018 BOOT-INF/lib/mysql-connector-java-5.1.47.jar
I finally solved the problem. I don't if know using the BufferedReader is still the best practice, but I decided to keep it in my code as everything was done with it already. So I dropped the use of File class, and I used the following to get a resource from src/main/resources:
var line: String?
val bufferedReader = BufferedReader(InputStreamReader(Thread.currentThread().contextClassLoader.getResourceAsStream(csvLocation)))
do {
line = bufferedReader.readLine()
if (line != null) {
//Do something with 'line'
}
} while (line != null)
csvLocation value is "data/myFile.csv". This file is located in src/main/resources/data
Finally this solution works in my IDE and in the generated jar. Problem solved.
The production app will not run in your IDE, right? So that is of lesser importance than finding where the file exists on the classpath.
Essentially, there is no src/main/resources dir in the jar file - that directory is just a Maven convention for holding resources in a project. If you crack the jar and find the files in question, you'll understand better where Maven puts those files at package time and how to access them. Also note, a Maven-aware IDE will put files in src/main/resources on the app classpath, so the app will likely run in the IDE as well once the correct solution is identified.
To access the application.properties file in the example, use getResource or getResourceAsStream as suggested, with path /BOOT-INF/classes/application.properties. Note the first slash.

elasticdump index gives error "Error Emitted => <html>"

I tried to use elasticdump module to copy my production elasticsearch index to local machine by running command
elasticdump \
--input=http://localhost:9200/prod-index \
--output=http://localhost:9200/local-index \
--type=data \
--ignore-errors \
--maxSockets=5
But it only dumped the first 100 objects and then gave error like
Wed, 08 Jun 2016 22:35:30 GMT | starting dump
Wed, 08 Jun 2016 22:35:30 GMT | got 100 objects from source elasticsearch (offset: 0)
Wed, 08 Jun 2016 22:35:30 GMT | sent 100 objects to destination file, wrote 100
Wed, 08 Jun 2016 22:35:31 GMT | Error Emitted => <html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
Wed, 08 Jun 2016 22:35:31 GMT | got 0 objects from source elasticsearch (offset: 100)
Wed, 08 Jun 2016 22:35:31 GMT | Total Writes: 100
Wed, 08 Jun 2016 22:35:31 GMT | dump complete
Searched online for a few solutions such as configure the max sockets. Still not working for me. Any other solutions? Also my npm solution is 0.10.32. Does it matter?

Using ouput numbers to cancel hung printer jobs

I have a script that will check our servers for print jobs that are hung using net/ssh.
Now what I want to do is use the job ID that is output from the script (3rd column with all the numbers) and cancel the jobs (I know how I'm going to do the cancel) Is there a way, in Ruby, to use outputted digits as input?
Source:
#!/usr/local/bin/ruby
require 'rubygems'
require 'net/ssh'
require 'etc'
require 'adfitech/mail'
class PrintJobs
HOST = ARGV[0]
USERNAME = Etc.getlogin
PASSWORD = nil
def scan_for_jobs
check_jobs = Net::SSH.start(HOST, USERNAME, :password => PASSWORD) do |ssh|
cmd = "prt_jobs"
info = ssh.exec!(cmd)
res = info.split("\n").reject {|line| line.match(/\s+2016\s+/)}.join("\n")
puts res
print "Kill jobs: "
input = STDIN.gets.chomp.upcase
if input == "YES"
kill_jobs(check_jobs, res)
else
exit 1
end
end
end
def kill_jobs(check_jobs, res)
puts "Loading jobs in kill que.."
# <= Here output digits
end
end
test = PrintJobs.new
test.scan_for_jobs
output:
#3rd column with the digits is the job ID
laser26-828837 kaj 1042432 Fri 21 Aug 2015 03:59:35 PM CDT
laser26-828982 leb 446464 Fri 21 Aug 2015 04:52:20 PM CDT
laser26-828983 leb 1042432 Fri 21 Aug 2015 04:52:20 PM CDT
laser26-828986 leb 446464 Fri 21 Aug 2015 05:04:39 PM CDT
laser26-828987 leb 1042432 Fri 21 Aug 2015 05:04:39 PM CDT
laser26-828991 leb 446464 Fri 21 Aug 2015 05:15:08 PM CDT
laser26-828992 leb 1042432 Fri 21 Aug 2015 05:15:08 PM CDT
laser26-898419 kaj 430080 Wed 14 Oct 2015 02:01:34 PM CDT
laser26-898420 kaj 1042432 Wed 14 Oct 2015 02:01:34 PM CDT
laser26-898444 kaj 430080 Wed 14 Oct 2015 02:09:08 PM CDT
laser26-898445 kaj 1042432 Wed 14 Oct 2015 02:09:08 PM CDT
laser26-898526 kaj 446464 Wed 14 Oct 2015 02:50:45 PM CDT
laser26-898527 kaj 1042432 Wed 14 Oct 2015 02:50:45 PM CDT
laser26-898577 kaj 446464 Wed 14 Oct 2015 03:09:03 PM CDT
laser26-898578 kaj 1042432 Wed 14 Oct 2015 03:09:04 PM CDT
laser26-898583 kaj 430080 Wed 14 Oct 2015 03:13:27 PM CDT
laser26-898584 kaj 1042432 Wed 14 Oct 2015 03:13:27 PM CDT
laser26-898587 kaj 446464 Wed 14 Oct 2015 03:17:17 PM CDT
laser26-898588 kaj 1042432 Wed 14 Oct 2015 03:17:17 PM CDT
laser26-898596 kaj 446464 Wed 14 Oct 2015 03:25:40 PM CDT
laser26-898597 kaj 1042432 Wed 14 Oct 2015 03:25:40 PM CDT
laser26-898602 kaj 446464 Wed 14 Oct 2015 03:26:13 PM CDT
laser26-898603 kaj 1042432 Wed 14 Oct 2015 03:26:13 PM CDT
laser26-898617 kaj 430080 Wed 14 Oct 2015 03:31:27 PM CDT
laser26-898618 kaj 1042432 Wed 14 Oct 2015 03:31:27 PM CDT
laser26-903874 bja 446464 Tue 20 Oct 2015 09:18:34 AM CDT
laser26-903875 bja 1042432 Tue 20 Oct 2015 09:18:34 AM CDT
laser26-904044 kaj 430080 Tue 20 Oct 2015 10:11:32 AM CDT
laser26-904045 kaj 1042432 Tue 20 Oct 2015 10:11:32 AM CDT
laser26-904171 kaj 446464 Tue 20 Oct 2015 10:34:45 AM CDT
laser26-904172 kaj 1042432 Tue 20 Oct 2015 10:34:45 AM CDT
laser26-904368 bja 430080 Tue 20 Oct 2015 11:33:48 AM CDT
laser26-904369 bja 1042432 Tue 20 Oct 2015 11:33:48 AM CDT
laser26-904479 bja 446464 Tue 20 Oct 2015 12:06:10 PM CDT
laser26-904480 bja 1042432 Tue 20 Oct 2015 12:06:10 PM CDT
laser26-904495 bja 430080 Tue 20 Oct 2015 12:10:26 PM CDT
laser26-904496 bja 1042432 Tue 20 Oct 2015 12:10:26 PM CDT
laser26-966772 ksn 430080 Thu 03 Dec 2015 03:35:28 PM CST
laser26-966773 ksn 1042432 Thu 03 Dec 2015 03:35:28 PM CST
laser26-966861 ksn 446464 Thu 03 Dec 2015 03:50:00 PM CST
laser26-966862 ksn 1042432 Thu 03 Dec 2015 03:50:00 PM CST
laser26-966979 ksn 446464 Thu 03 Dec 2015 04:18:25 PM CST
laser26-966980 ksn 1042432 Thu 03 Dec 2015 04:18:25 PM CST
laser26-966989 ksn 430080 Thu 03 Dec 2015 04:23:05 PM CST
laser26-966990 ksn 1042432 Thu 03 Dec 2015 04:23:05 PM CST
laser32-829104 glt 187392 Sun 23 Aug 2015 07:22:16 PM CDT
laser35-797457 jss 572416 Wed 29 Jul 2015 02:59:20 PM CDT
laser35-806865 kjw 982016 Wed 05 Aug 2015 02:15:55 PM CDT
laser40-898540 rrw 715776 Wed 14 Oct 2015 02:51:30 PM CDT
laser40-898547 rrw 715776 Wed 14 Oct 2015 02:53:05 PM CDT
laser40-904373 rrw 2565120 Tue 20 Oct 2015 11:37:39 AM CDT
mailrm2-829117 lmb 356352 Mon 24 Aug 2015 06:20:59 AM CDT
pref_jet-797185 djl 871424 Wed 29 Jul 2015 01:46:38 PM CDT
pref_jet-797187 aqs 1104896 Wed 29 Jul 2015 01:46:57 PM CDT
pref_jet-829111 djl 117760 Mon 24 Aug 2015 05:38:54 AM CDT
pref_jet-829112 djl 117760 Mon 24 Aug 2015 05:41:05 AM CDT
team_d-797167 kld 144384 Wed 29 Jul 2015 01:39:29 PM CDT
team_d-797168 kld 145408 Wed 29 Jul 2015 01:39:39 PM CDT
team_d-797169 kld 144384 Wed 29 Jul 2015 01:39:48 PM CDT
team_d-797170 kld 145408 Wed 29 Jul 2015 01:39:59 PM CDT
team_d-797171 kld 144384 Wed 29 Jul 2015 01:40:10 PM CDT
team_d-797172 kld 144384 Wed 29 Jul 2015 01:40:23 PM CDT
team_d-797173 kld 144384 Wed 29 Jul 2015 01:40:31 PM CDT
team_d-797174 kld 144384 Wed 29 Jul 2015 01:40:41 PM CDT
team_d-797175 kld 144384 Wed 29 Jul 2015 01:40:50 PM CDT
team_d-797176 kld 144384 Wed 29 Jul 2015 01:41:00 PM CDT
team_d-797177 kld 144384 Wed 29 Jul 2015 01:41:08 PM CDT
team_d-797178 kld 144384 Wed 29 Jul 2015 01:41:16 PM CDT
team_d-797179 kld 144384 Wed 29 Jul 2015 01:41:25 PM CDT
team_d-797180 kld 145408 Wed 29 Jul 2015 01:41:37 PM CDT
team_d-797181 kld 145408 Wed 29 Jul 2015 01:41:45 PM CDT
team_d-797186 kld 144384 Wed 29 Jul 2015 01:46:40 PM CDT
team_d-829108 rdm 429056 Mon 24 Aug 2015 04:55:43 AM CDT
team_d-850252 kld 145408 Wed 09 Sep 2015 12:34:18 PM CDT
team_d-869247 kld 77824 Wed 23 Sep 2015 07:57:35 AM CDT
team_d-869248 kld 81920 Wed 23 Sep 2015 07:57:43 AM CDT
team_d-898621 kld 39936 Wed 14 Oct 2015 03:32:01 PM CDT
team_d-898622 kld 39936 Wed 14 Oct 2015 03:32:12 PM CDT
team_d-898633 kld 36864 Wed 14 Oct 2015 03:33:59 PM CDT
team_d-904046 kmt 16634880 Tue 20 Oct 2015 10:12:04 AM CDT
team_d-904497 kmt 5965824 Tue 20 Oct 2015 12:11:56 PM CDT
team_f-898550 rlr 1070080 Wed 14 Oct 2015 02:55:30 PM CDT
team_t-795252 tud 891904 Tue 28 Jul 2015 01:40:06 PM CDT
team_t-795255 tud 970752 Tue 28 Jul 2015 01:40:41 PM CDT
team_t-795256 tud 1033216 Tue 28 Jul 2015 01:40:55 PM CDT
team_t-795263 dlc 228352 Tue 28 Jul 2015 01:46:07 PM CDT
team_t-795264 alm 1280000 Tue 28 Jul 2015 01:46:30 PM CDT
team_t-797184 slp 154624 Wed 29 Jul 2015 01:46:25 PM CDT
team_t-797188 slp 155648 Wed 29 Jul 2015 01:47:20 PM CDT
team_t-797456 alm 244736 Wed 29 Jul 2015 02:59:17 PM CDT
team_t-828984 slp 16384 Fri 21 Aug 2015 04:53:01 PM CDT
team_t-828985 slp 16384 Fri 21 Aug 2015 04:56:14 PM CDT
team_t-828993 slp 192512 Fri 21 Aug 2015 05:16:37 PM CDT
team_t-829082 dlc 243712 Sun 23 Aug 2015 07:44:47 AM CDT
team_t-829103 glt 187392 Sun 23 Aug 2015 07:20:19 PM CDT
team_t-829114 ddh 17408 Mon 24 Aug 2015 06:03:36 AM CDT
team_t-829115 ddh 16384 Mon 24 Aug 2015 06:04:16 AM CDT
team_t-898551 alh 219136 Wed 14 Oct 2015 02:56:02 PM CDT
team_t-898552 alh 238592 Wed 14 Oct 2015 02:56:21 PM CDT
team_t-898619 ljr 141312 Wed 14 Oct 2015 03:31:28 PM CDT
team_t-898717 ljr 144384 Wed 14 Oct 2015 03:54:16 PM CDT
team_t-898826 dlc 320512 Thu 15 Oct 2015 06:39:42 AM CDT
team_t-898834 alm 367616 Thu 15 Oct 2015 07:05:41 AM CDT
team_t-966858 ljr 1857536 Thu 03 Dec 2015 03:48:23 PM CST
team_t-966863 ljr 555008 Thu 03 Dec 2015 03:50:10 PM CST
thermal12-980170 clw 1024 Fri 11 Dec 2015 02:32:39 PM CST
thermal13-851959 wdp 1024 Thu 10 Sep 2015 11:35:08 AM CDT
thermal13-898422 wdp 1024 Wed 14 Oct 2015 02:01:37 PM CDT
thermal13-967002 wdp 1024 Thu 03 Dec 2015 04:24:59 PM CST
thermal13-967011 wdp 1024 Thu 03 Dec 2015 04:25:49 PM CST
thermal20-870628 czp 1024 Wed 23 Sep 2015 02:08:13 PM CDT
Kill jobs: yes
Loading jobs in kill que..
[tep#coltrane ruby]$ ruby prt_jobs_check davey
closing_2-205137 snb 231424 Wed 29 Jul 2015 01:40:00 PM CDT
closing_2-205138 snb 232448 Wed 29 Jul 2015 01:40:33 PM CDT
closing_2-205139 jiw 242688 Wed 29 Jul 2015 01:40:48 PM CDT
closing_2-205140 jiw 228352 Wed 29 Jul 2015 01:41:06 PM CDT
closing_2-205164 jiw 222208 Wed 29 Jul 2015 02:38:37 PM CDT
laser20-205141 sdj 814080 Wed 29 Jul 2015 01:45:28 PM CDT
laser20-205142 sdj 649216 Wed 29 Jul 2015 01:45:44 PM CDT
laser20-205143 sdj 649216 Wed 29 Jul 2015 01:47:05 PM CDT
laser27-205163 acm 684032 Wed 29 Jul 2015 02:38:20 PM CDT
laser27-209301 acm 14336 Fri 21 Aug 2015 07:43:38 AM CDT
laser27-220263 acm 265216 Thu 15 Oct 2015 06:54:16 AM CDT
laser27-220264 acm 16384 Thu 15 Oct 2015 06:54:17 AM CDT
laser31-220266 jal 1024 Thu 15 Oct 2015 06:56:57 AM CDT
laser32-220265 tep 39936 Thu 15 Oct 2015 06:54:54 AM CDT
npl_3-220245 jrr 176128 Wed 14 Oct 2015 03:32:03 PM CDT
ship_setup2-205177 slf 1193984 Wed 29 Jul 2015 03:02:27 PM CDT
ship_setup2-205178 slf 1571840 Wed 29 Jul 2015 03:02:47 PM CDT
ship_setup2-205180 slf 1571840 Wed 29 Jul 2015 03:03:34 PM CDT
team_d-209530 akn 1393664 Sun 23 Aug 2015 07:09:12 AM CDT
team_d-209533 akn 50176 Sun 23 Aug 2015 12:47:52 PM CDT
team_d-209534 akn 50176 Sun 23 Aug 2015 01:05:16 PM CDT
team_d-209535 akn 50176 Sun 23 Aug 2015 01:07:02 PM CDT
team_f-206217 jlh 1327104 Wed 05 Aug 2015 01:07:12 PM CDT
verif_jet-220261 twk 1369088 Thu 15 Oct 2015 06:51:34 AM CDT
verif_jet-220262 twk 1363968 Thu 15 Oct 2015 06:52:09 AM CDT
verif_jet-220267 twk 1372160 Thu 15 Oct 2015 07:01:45 AM CDT
verif_jet-220268 twk 1374208 Thu 15 Oct 2015 07:02:00 AM CDT
verif_jet-221015 sum 1258496 Tue 20 Oct 2015 11:44:50 AM CDT
verif_jet-221016 sum 1198080 Tue 20 Oct 2015 11:45:32 AM CDT
verif_jet-221017 sum 1227776 Tue 20 Oct 2015 11:46:34 AM CDT
verif_jet-221018 sum 1190912 Tue 20 Oct 2015 11:47:51 AM CDT
verif_jet-221019 sum 1179648 Tue 20 Oct 2015 11:48:08 AM CDT
verif_jet-221030 tad 1681408 Tue 20 Oct 2015 12:11:39 PM CDT
verif_jet-221031 tad 903168 Tue 20 Oct 2015 12:11:44 PM CDT
verif_jet-221032 tad 872448 Tue 20 Oct 2015 12:11:50 PM CDT
verif_jet-221033 tad 1716224 Tue 20 Oct 2015 12:12:56 PM CDT
Kill jobs: yes
Loading jobs in kill que..
You're question is very vague but I think I get it so I'll take a stab at it. I think you want to parse that output and get the Job IDs, right? I'm assuming the Job ID is in the 3rd column in that output, let's take an excerpt:
output = <<-HEREDOC
laser26-828837 kaj 1042432 Fri 21 Aug 2015 03:59:35 PM CDT
laser26-828982 leb 446464 Fri 21 Aug 2015 04:52:20 PM CDT
laser26-828983 leb 1042432 Fri 21 Aug 2015 04:52:20 PM CDT
HEREDOC
To get all the Job IDS from that string, we can map over each line, split the line up by spaces and get the 3rd item:
column = 2 # 3rd column
job_ids = output.lines.map { |line| line.split(/\s+/)[2] }
# => ["1042432", "446464", "1042432"]
Hope that helps.

extract data date wise and do average calculation

How to extract data date wise and do average calculation per date from the below shown output. last column is average.
Sun Jul 5 00:00:02 IST 2015, 97
Sun Jul 5 00:02:01 IST 2015, 97
Sun Jul 5 00:04:02 IST 2015, 97
Mon Jul 6 00:00:01 IST 2015, 73
Mon Jul 6 00:02:02 IST 2015, 93
Mon Jul 6 00:04:02 IST 2015, 97
Tue Jul 7 00:00:02 IST 2015, 97
Tue Jul 7 00:02:02 IST 2015, 97
Tue Jul 7 00:04:01 IST 2015, 97
Wed Jul 8 00:00:01 IST 2015, 98
Wed Jul 8 00:02:02 IST 2015, 98
Wed Jul 8 00:04:01 IST 2015, 98
Thu Jul 9 00:00:02 IST 2015, 100
Thu Jul 9 00:02:01 IST 2015, 100
Thu Jul 9 00:04:01 IST 2015, 100
Fri Jul 10 00:00:01 IST 2015, 100
Fri Jul 10 00:02:02 IST 2015, 100
Fri Jul 10 00:04:02 IST 2015, 100
Sat Jul 11 00:00:01 IST 2015, 73
Sat Jul 11 00:02:01 IST 2015, 73
Sat Jul 11 00:04:02 IST 2015, 73
want output as
Jun 6 - 97
Jun 7 - 86.66
...
You can use this awk:
awk -F ', ' '{
split($1, a, " ");
k=a[2] OFS a[3];
if(!(k in c))
b[++n]=k;
c[k]++;
sum[k]+=$2
}
END{
for(i=1; i<=n; i++)
printf "%s - %.2f\n", b[i], (sum[b[i]]/c[b[i]])
}' file
Jul 5 - 97.00
Jul 6 - 87.67
Jul 7 - 97.00
Jul 8 - 98.00
Jul 9 - 100.00
Jul 10 - 100.00
Jul 11 - 73.00

Resources