# Failed to load /usr/share/logstash/postgresql.jar

**URL:** <https://discuss.elastic.co/t/failed-to-load-usr-share-logstash-postgresql-jar/175514>\
**Category:** Logstash\
**Created:** [April 5, 2019, 5:06am UTC](https://discuss.elastic.co/t/failed-to-load-usr-share-logstash-postgresql-jar/175514 "2019-04-05T05:06:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![skowron-line](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skowron-line/32/43528_2.png) [@skowron-line](https://discuss.elastic.co/u/skowron-line)\
**Post date:** [April 5, 2019, 5:06am UTC](https://discuss.elastic.co/t/failed-to-load-usr-share-logstash-postgresql-jar/175514/1 "2019-04-05T05:06:03Z")

</div>

I havaing trouble with running logstash on redhat 7.6  
Im using logstash 6.4.3 with Jdbc plugin

I have created startup file like  
[Unit]  
Description=logstash

```
[Service]
Type=simple
User=logstash
Group=logstash
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
EnvironmentFile=-/etc/default/logstash
EnvironmentFile=-/etc/sysconfig/logstash
ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash" -f /usr/share/logstash/jdb-plugin.conf
Restart=always
WorkingDirectory=/
Nice=19
LimitNOFILE=16384

[Install]
WantedBy=multi-user.target

```

and my jdbc-plugin.conf is looking like  
jdbc\_driver\_library =\> "/usr/share/logstash/postgresql.jar"  
jdbc\_driver\_class =\> "org.postgresql.Driver"

I have downloaded postgresql.jar file  
`wget https://jdbc.postgresql.org/download/postgresql-42.2.5.jar -P /usr/share/logstash/ -O postgresql.jar`

But after starting logstash Im getting

> [2019-04-05T07:05:00,139][ERROR][logstash.inputs.jdbc] Failed to load /usr/share/logstash/postgresql.jar {:exception=\>#\<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader\>}

I have changed permissions to postgresql.jar to 777 and made it executaable but still Im getting such error

---

<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:** [May 3, 2019, 5:06am UTC](https://discuss.elastic.co/t/failed-to-load-usr-share-logstash-postgresql-jar/175514/2 "2019-05-03T05:06:11Z")

</div>

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