sqlj runtime error - java

Could somebody tell me what is causing this error when using sqlj in Oracle 11g. I am using Solaris 8 and I have tried changing JDK versions (tried both 1.5 and 1.6).
bash-2.03$ ~/11.2.0.2/bin/sqlj -compile=false -classpath '~/11.2.0.2/sqlj/lib/translator.jar:~/11.2.0.2/sqlj/lib/runtime12.jar'
Exception in thread "main" java.lang.NoClassDefFoundError: sqlj/runtime/profile/DefaultLoader
at sqlj.tools.Sqlj.resetStaticVariables(Sqlj.java:2905)
at sqlj.tools.Sqlj.statusMain(Sqlj.java:189)
at sqlj.tools.Sqlj.main(Sqlj.java:150)
The same command works fine with Oracle 10g:
bash-2.03$ ~/10.2.0.3/bin/sqlj -compile=false -classpath '~/10.2.0.3/sqlj/lib/translator.jar::~/10.2.0.3/sqlj/lib/runtime12.jar'
Error: This SQLJ runtime must be run under an Oracle JDBC driver.
Thanks,
Raj

According to this site the runtime12.jar should contain this class - so the question is - did you try running ls ~/11.2.0.2/sqlj/lib/runtime12.jar to verify the path exists?

Related

Java EE Glassfish - NullPointerException because "dcs" not found

Whent trying to run asadmin im getting this error:
/opt/glassfish5/bin $ ./asadmin start-domain
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.glassfish.hk2.api.DynamicConfigurationService.createDynamicConfiguration()" because "dcs" is null
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)
My Java JDK:
$ readlink -f $(which java)
/usr/lib/jvm/java-17-openjdk-amd64/bin/java
I've tried adding AS_JAVA="/usr/lib/jvm/java-17-openjdk-amd64" to the asenv.conf file but the error persists. Any help?
Oh yeah, and it doesn't matter if im in /opt/glassfish5/glassfish/bin or /opt/glassfish5/bin the error is the same
GlassFish 5 doesn’t support JDK 17, but the latest versions of GlassFish 6 do. If possible, try to upgrade to GlassFish 6.2.4, which is the current version at the time of writing.
Okay, you need to use Java SDK 1.8 only.

Error linking JNA library on AdoptOpenJDK on MacOS

I am trying to run some JUnit tests over cassandra. But I get the following error:
[08/12/19 10:48:40:411](main)([]) INFO - c.h.c.c.e.EmbeddedCassandra - Starting embedded Cassandra server.
8/12/19 10:48:41:497](main)([]) ERROR - o.a.c.u.NativeLibraryDarwin - Failed to link the C library against JNA. Native methods will be unavailable.
java.lang.UnsatisfiedLinkError: /private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: dlopen(/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp, 1): no suitable image found. Did find:
/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: code signature in (/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
It was running well until I changed to mac mojave and re-setup everything. I think it is an issue related to permissions may be or JNA?
IDE: IntelliJ
Java: AdoptOpenJDK 11.0.4
JNA: 4.2.2
Any kind of help will be highly appreciated!
This is the result of a bug in AdoptOpenJDK jdk-11.0.4+11 on macOS, persisting through 11.2.
It will be fixed in the jdk-11.0.4+11.3 release.
If you can't wait for the new release you can temporarily resolve by downgrading to 11.0.3+7
What version of cassandra unit? Support for java 11 (https://issues.apache.org/jira/browse/CASSANDRA-9608) isn't in until cassandra 4 and I dont think embedded cassandra is setup for that yet

oracle sql developer connection error

I can't get the connection to work for Oracle WebLogic 12c using SQL Developer. Here is the error that I get when I click connect:
An error was encountered performing the requested operation:
/usr/lib/java/libocijdbc11.dylib: dlopen(/usr/lib/java/libocijdbc11.dylib, 1): Library not loaded: /ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1
Referenced from: /usr/lib/java/libocijdbc11.dylib
Reason: image not found
Vendor code 0
When I click Test in the Settings of SQL Developer I get the following log:
Testing the Instant Client located at /usr/lib/java
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
Driver version: 11.2.0.3.0
Testing testing native OCI library load ... Failed:
Error loading the native OCI library
The native OCI driver could not be loaded. The system propertyjava.library.path
contains the entries from the environment variable DYLD_LIBRARY_PATH.
Check it to verify that the expected native library
directory /usr/lib/java is present and precedes any other client installations.
java.library.path = /Users/gasim/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Here is an outline of my setup:
Operating system: OSX Mavericks (10.9.4 to be specific)
The Java SE Runtime version: "1.8.0" (build "1.8.0_11-b12")
Oracle Instant is located under /usr/lib/java. The directory is set in the SQL Developer (through Database > Advanced)
The Oracle server is up and running with default parameters (localhost:7001) and I can access the web admin console.
Oracle Instant Client version: 11.2.0.4.0
java.library.path = /Users/gasim/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
The directory listing of /usr/lib/java:
BASIC_README
adrci
genezi
libclntsh.dylib.11.1
libnnz11.dylib
libocci.dylib.11.1
libociei.dylib
libocijdbc11.dylib
ojdbc5.jar
ojdbc6.jar
uidrvci
xstreams.jar
The thing is, libocijdbc11.dylib does exist in /usr/lib/java and that directory is in the library path of java. I just don't get it. Am I missing something here? What else can I try for solving this problem or at least debugging deeper?
I'll tell you how I solved, finally...
I'm running OSX 10.9.4, with jboss 7.1.1.Final installed through brew, and an env variable JBOSS_HOME=/usr/local/opt/jboss-as/libexec.
I already had an ojdbc.jar in $JBOSS_HOME/modules/com/oracle/main, version 11.2.0.3, so I downloaded Instant Client version 11.2.0.3.
I commented any JAVA_OPTS that was populating java.library.path with instantclient libraries, like this:
#JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$JBOSS_HOME/instantclient_11_2"
I copied, for being comfortable, instantclient_11_2 inside $JBOSS_HOME.
It's just a matter of doing:
export DYLD_LIBRARY_PATH=$JBOSS_HOME/instantclient_11_2
$JBOSS_HOME/bin/standalone.sh
It now works. Now I have another problem to solve:
Native Library /usr/local/Cellar/jboss-as/7.1.1.Final/libexec/instantclient_11_2/libocijdbc11.dylib already loaded in another classloader

Not able to use schemacrawler.

I have followed this link, http://schemacrawler.sourceforge.net/bundled.html
I am using Oracle 11g database,
As per the doc I have downloaded the bundle for Oracle and downloaded the ojdbc driver for it (ojdbc.6.jar) and placed it in the lib folder,
then fired the command:-
-host=xxx -port=xxx -database=xxx -user=xxx -password=xxx
But its not working.
For unix its throwing error:-
-bash: -host=xxx: command not found
When I fire the command:-
java -classpath lib/*:. schemacrawler.tools.oracle.Main $* -host=xxx -port=xxx -database=xxx -user=xxx -password=xxx
It throws the error:-
schemacrawler.schemacrawler.SchemaCrawlerException: No command specified
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.<init>(SchemaCrawlerCommandLine.java:88)
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.<init>(SchemaCrawlerCommandLine.java:62)
at schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:76)
at schemacrawler.tools.oracle.Main.main(Main.java:44)
Please help to resolve
To get help on how to use SchemaCrawler for Oracle, please use the following command:
java -classpath lib/*:. schemacrawler.tools.oracle.Main
Sualeh Fatehi, SchemaCrawler

getting NoSuchMethodError for getNamespaceContext() when running with jdk 1.5 but not with 1.6

I'm running a program written in java, deployed on an Oracle application Server, running 1.5 JVM.following is the stack trace:
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.getNamespaceContext()Lcom/sun/org/apache/xerces/internal/xni/NamespaceContext;
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:99)
at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:264)
at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:136)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Zephyr.newInstance(XMLStreamReaderFactory.java:251)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.<clinit>(XMLStreamReaderFactory.java:84)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:805)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:262)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:129)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:265)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:228)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:176)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104)
at javax.xml.ws.Service.<init>(Service.java:56)
at com.earthport.bind.MerchantAPIService.<init>(MerchantAPIService.java:50)
at com.earthport.client.service.stub.MerchantAPIClientImpl$1CustomMerchantAPIService. <init>(MerchantAPIClientImpl.java:107)
at com.earthport.client.service.stub.MerchantAPIClientImpl.createMerchantAPIService(MerchantAPI ClientImpl.java:111)
at com.earthport.client.service.stub.MerchantAPIClientImpl.<init> (MerchantAPIClientImpl.java:84)
at com.earthport.client.service.ServiceProxyFactoryImpl.createServiceProxy(ServiceProxyFactoryI mpl.java:25)
at utils.AmxEPAccCre.<init>(AmxEPAccCre.java:79)
at utils.WService.<init>(WService.java:95)
at utils.WService.main(WService.java:795)
Process exited.
If i run the exact same program with jdk 1.6 though, the program runs perfectly. Is this a specific issue with a library reference? anyone see this exception before?
cheers.
I bet you are having a conflict between the Xerces implementation that comes with your app or the Oracle AppServer, and the one that comes with the JDK.
It works with the one that comes in JDK6, but is not compatible with the one in JDK 5.

Categories

Resources