Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Fatal Error: Could not initialize class sun.security.util.SecurityConstants #69

Closed sameer-shelavale closed 8 years ago

sameer-shelavale commented 8 years ago
<br />
<b>Fatal error</b>:  Uncaught exception 'PhpOrient\Exceptions\PhpOrientException' with message 'java.lang.NoClassDefFoundError: Could not initialize class sun.security.util.SecurityConstants' in /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php:412
Stack trace:
#0 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php(142): PhpOrient\Protocols\Binary\Abstracts\Operation-&gt;_readError()
#1 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php(217): PhpOrient\Protocols\Binary\Abstracts\Operation-&gt;_readHeader()
#2 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/SocketTransport.php(154): PhpOrient\Protocols\Binary\Abstracts\Operation-&gt;getResponse()
#3 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/PhpOrient.php(287): PhpOrient\Protocols\Binary\SocketTransport-&gt;execute('command', Array)
#4  in <b>/home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php</b> on line <b>412</b><br />

I am getting above error on my production server. However same code runs fine on dev server. production server: phporient: 1.1.8 Orientdb: 2.1.0 java version "1.7.0_99" OpenJDK Runtime Environment (rhel-2.6.5.0.el6_7-x86_64 u99-b00) OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

dev server: phporient: 1.1.8 Orientdb: 2.1.0 java version "1.7.0_85" OpenJDK Runtime Environment (rhel-2.6.1.3.el6_7-x86_64 u85-b01) OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)

How do I solve this bug?

andreyvk commented 8 years ago

Hi,

Doesnt look like PhpOrient error to me. Maybe something to do with JRE? How about moving to Oracle JRE instead?

On Tue, Apr 19, 2016 at 7:22 PM, Sameer Shelavale notifications@github.com wrote:


Fatal error: Uncaught exception 'PhpOrient\Exceptions\PhpOrientException' with message 'java.lang.NoClassDefFoundError: Could not initialize class sun.security.util.SecurityConstants' in /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php:412 Stack trace:

0 /home/snipbo/production/snipbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php(142): PhpOrient\Protocols\Binary\Abstracts\Operation->_readError()

1 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php(217): PhpOrient\Protocols\Binary\Abstracts\Operation->_readHeader()

2 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/SocketTransport.php(154): PhpOrient\Protocols\Binary\Abstracts\Operation->getResponse()

3 /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/PhpOrient.php(287): PhpOrient\Protocols\Binary\SocketTransport->execute('command', Array)

4 in /home/snbo/production/snbo.com/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php on line 412

I am getting above error on my production server. However same code runs fine on dev server. production: Orientdb: 2.1.0 java version "1.7.0_99" OpenJDK Runtime Environment (rhel-2.6.5.0.el6_7-x86_64 u99-b00) OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

dev: Orientdb: 2.1.0 java version "1.7.0_85" OpenJDK Runtime Environment (rhel-2.6.1.3.el6_7-x86_64 u85-b01) OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)

How do I solve this bug?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/Ostico/PhpOrient/issues/69

Ostico commented 8 years ago

Hi @sameer-shelavale ,

this is an error inside OrientDB dued to a Class Not Found Exception:

java.lang.NoClassDefFoundError  sun.security.util.SecurityConstants

I think like @andreyvk that this is not directly related to the PHP Client.

You should try to update your java version or switch to the Oracle Java version.

Anyway, can you show the query you executed?

sameer-shelavale commented 8 years ago

This was happening as I was using old version(1.1.8) of PhpOrient The error vanished after i upgraded to latest version