# Beginners question - error while loading data from SQL to Elasticsearch

**URL:** <https://discuss.elastic.co/t/beginners-question-error-while-loading-data-from-sql-to-elasticsearch/232557>\
**Category:** Logstash\
**Created:** [May 14, 2020, 6:25am UTC](https://discuss.elastic.co/t/beginners-question-error-while-loading-data-from-sql-to-elasticsearch/232557 "2020-05-14T06:25:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oshritbu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oshritbu/32/68299_2.png) [@oshritbu](https://discuss.elastic.co/u/oshritbu)\
**Post date:** [May 14, 2020, 6:25am UTC](https://discuss.elastic.co/t/beginners-question-error-while-loading-data-from-sql-to-elasticsearch/232557/1 "2020-05-14T06:25:31Z")

</div>

Hi,

I am using the following config file to upload a simple table to Elasticsearch:  
input {  
jdbc {  
jdbc\_driver\_library =\> "C:/Users/michaeos/Desktop/ELK/logstash-7.6.2/sqljdbc\_4.2/enu/jre8/sqljdbc42.jar"  
jdbc\_connection\_string =\> "jdbc:sqlserver://iibdspdev.inr.rd.hpicorp.net;databaseName=impact21;integratedSecurity=true;”  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_user =\> "xxx"

```
statement => "SELECT * FROM Users"

```

}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "cs\_users"  
}  
}

when I run it I get an exception:  
'Exception in thread "main" java.lang.ExceptionInInitializerError  
at org.apache.logging.log4j.core.util.WatchManager.(WatchManager.java:53)  
at org.apache.logging.log4j.core.config.AbstractConfiguration.(AbstractConfiguration.java:135)  
at org.apache.logging.log4j.core.config.NullConfiguration.(NullConfiguration.java:32)  
at org.apache.logging.log4j.core.LoggerContext.(LoggerContext.java:85)  
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.createContext(ClassLoaderContextSelector.java:179)  
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:153)  
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:78)  
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:65)  
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:148)  
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)  
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)  
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:581)  
at org.logstash.Logstash.(Logstash.java:22)  
Caused by: java.lang.ArrayIndexOutOfBoundsException  
at java.lang.System.arraycopy(Native Method)  
at org.apache.logging.log4j.core.util.UuidUtil.(UuidUtil.java:81)  
... 13 more'

Appreciate any help...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 14, 2020, 11:36pm UTC](https://discuss.elastic.co/t/beginners-question-error-while-loading-data-from-sql-to-elasticsearch/232557/2 "2020-05-14T23:36:37Z")

</div>

Welcome! 😃  
Please remember to format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you.

Are you able to post more of the log/exception output?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 11, 2020, 11:36pm UTC](https://discuss.elastic.co/t/beginners-question-error-while-loading-data-from-sql-to-elasticsearch/232557/3 "2020-06-11T23:36:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
