public inbox for [email protected]  
help / color / mirror / Atom feed
[Pljava-dev] install_jar error
3+ messages / 3 participants
[nested] [flat]

* [Pljava-dev] install_jar error
@ 2017-05-30 05:27 Antonio Giuzio <[email protected]>
  2017-05-30 13:39 ` Re: [Pljava-dev] install_jar error Achilleas Mantzios <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Antonio Giuzio @ 2017-05-30 05:27 UTC (permalink / raw)

Hi,
i’m trying to install a jar but i get the follow errors:

select sqlj.install_jar('file:///Users/antonio/GitHub/distanceJavaSQL/dist/distanceJavaSQL.jar', 'distance', true);
WARNING:  java.lang.NoClassDefFoundError: org/postgresql/pljava/internal/Backend
WARNING:  Unable to load class org/postgresql/pljava/internal/Backend using CLASSPATH '-Djava.class.path=/Users/antonio/Library/Application Support/Postgres/var-9.5/pljava-pg9.5-x86_64-MacOSX-gpp.jar'
WARNING:  failed to load initial PL/Java classes
HINT:  The most common reason is that "pljava.classpath" needs to be set, naming the proper "pljava.jar" file.
WARNING:  failed to create Java virtual machine
DETAIL:  JNI_CreateJavaVM returned an error code: -1
HINT:  Because an earlier attempt during this session did start a VM before failing, this probably means your Java runtime environment does not support more than one VM creation per session.  You may need to exit this session and start a new one.
ERROR:  cannot use PL/Java before successfully completing its setup


In postgresql.conf, I added this rows

PLJAVA.CLASSPATH='/Users/antonio/Library/Application Support/Postgres/var-9.5/pljava-pg9.5-x86_64-MacOSX-gpp.jar'
PLJAVA.VMOPTIONS='-Xms512m -Xmx1064m -Xshare:off -XX:ParallelGCThreads=2'
PLJAVA.LIBJVM_LOCATION='/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/jli/libjli.dylib’


how can i solve?
Thanks

_______________________________________________
Pljava-dev mailing list
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [Pljava-dev] install_jar error
  2017-05-30 05:27 [Pljava-dev] install_jar error Antonio Giuzio <[email protected]>
@ 2017-05-30 13:39 ` Achilleas Mantzios <[email protected]>
  2017-05-30 14:27   ` Re: [Pljava-dev] install_jar error Chapman Flack <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Achilleas Mantzios @ 2017-05-30 13:39 UTC (permalink / raw)

On 30/05/2017 08:27, Antonio Giuzio wrote:
> Hi,
> i’m trying to install a jar but i get the follow errors:
>
> select sqlj.install_jar('file:///Users/antonio/GitHub/distanceJavaSQL/dist/distanceJavaSQL.jar', 'distance', true);
> WARNING:  java.lang.NoClassDefFoundError: org/postgresql/pljava/internal/Backend
> WARNING:  Unable to load class org/postgresql/pljava/internal/Backend using CLASSPATH '-Djava.class.path=/Users/antonio/Library/Application Support/Postgres/var-9.5/pljava-pg9.5-x86_64-MacOSX-gpp.jar'
> WARNING:  failed to load initial PL/Java classes
> HINT:  The most common reason is that "pljava.classpath" needs to be set, naming the proper "pljava.jar" file.
> WARNING:  failed to create Java virtual machine
> DETAIL:  JNI_CreateJavaVM returned an error code: -1
> HINT:  Because an earlier attempt during this session did start a VM before failing, this probably means your Java runtime environment does not support more than one VM creation per session.  You 
> may need to exit this session and start a new one.
> ERROR:  cannot use PL/Java before successfully completing its setup
>
>
> In postgresql.conf, I added this rows
>
> PLJAVA.CLASSPATH='/Users/antonio/Library/Application Support/Postgres/var-9.5/pljava-pg9.5-x86_64-MacOSX-gpp.jar'
> PLJAVA.VMOPTIONS='-Xms512m -Xmx1064m -Xshare:off -XX:ParallelGCThreads=2'
> PLJAVA.LIBJVM_LOCATION='/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/jli/libjli.dylib’
>
In 1.6 the old pljava postgresql.conf settings were removed. pljava.libjvm_location is what you need and this should point to your libjvm shared object.
What version of pljava do you use? Did you use the extension ?
>
> how can i solve?
> Thanks
>
>
> _______________________________________________
> Pljava-dev mailing list
> [email protected]
> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt


_______________________________________________
Pljava-dev mailing list
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [Pljava-dev] install_jar error
  2017-05-30 05:27 [Pljava-dev] install_jar error Antonio Giuzio <[email protected]>
  2017-05-30 13:39 ` Re: [Pljava-dev] install_jar error Achilleas Mantzios <[email protected]>
@ 2017-05-30 14:27   ` Chapman Flack <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Chapman Flack @ 2017-05-30 14:27 UTC (permalink / raw)

On 05/30/2017 09:39 AM, Achilleas Mantzios wrote:
> On 30/05/2017 08:27, Antonio Giuzio wrote:

>> WARNING:  java.lang.NoClassDefFoundError:
>> org/postgresql/pljava/internal/Backend
>> WARNING:  Unable to load class org/postgresql/pljava/internal/Backend
>> using CLASSPATH '-Djava.class.path=/Users/antonio/Library/Application
>> Support/Postgres/var-9.5/pljava-pg9.5-x86_64-MacOSX-gpp.jar'
>> WARNING:  failed to load initial PL/Java classes
>> HINT:  The most common reason is that "pljava.classpath" needs to be
>> set, naming the proper "pljava.jar" file.
>> ...
>> PLJAVA.CLASSPATH='/Users/antonio/Library/Application
>> Support/Postgres/var-9.5/pljava-pg9.5-x86_64-MacOSX-gpp.jar'

> In 1.6 the old pljava postgresql.conf settings were removed.
> pljava.libjvm_location is what you need and this should point to your
> libjvm shared object.
> What version of pljava do you use? Did you use the extension ?

It looks like he's using 1.5 (earlier releases didn't give such
error messages, and 1.6 isn't close to release yet, though 1.5.1
will be beta soon).

It also looks in this case as if libjvm_location is set correctly
(it wouldn't get this far if not). The messages are clearly about
an inability to load the Backend class using the setting of
pljava.classpath.

It looks to me like pljava.classpath is simply pointing at
the wrong jar file. Looking at the name, that's just the
self-extracting jar that you run to install PL/Java. That should
have installed the actual PL/Java runtime jar in the customary
place.

Also, pljava.classpath defaults to the customary place, so
it doesn't need to be set at all unless the files needed to be
installed some other place for some reason. Typically,
pljava.libjvm_location is the only thing that will need to be
set, as there is less cross-platform agreement on where that lives.

After a successful installation with
java -jar pljava-pg9.5-x86_64-MacOSX-gpp.jar
and making sure pljava.libjvm_location is correctly set,
a simple CREATE EXTENSION pljava; should work fine in PG 9.5.

There are also some troubleshooting ideas in the installation
instructions, http://tada.github.io/pljava/install/install.html

Cheers,
-Chap
_______________________________________________
Pljava-dev mailing list
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-05-30 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-30 05:27 [Pljava-dev] install_jar error Antonio Giuzio <[email protected]>
2017-05-30 13:39 ` Achilleas Mantzios <[email protected]>
2017-05-30 14:27   ` Chapman Flack <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox