Let's discuss how to setup the Java adapter for replication.
Using Java Adapter to Deliver to JMS Queue
First, check and make sure you have the right java version installed with: java -version command.
[user01@EDLVC3AR5P5 configs]$ java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode) [user01@EDLVC3AR5P5 configs]$ which java /usr/java/jdk1.7.0_09/bin/java
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib:/usr/java/jdk1.7.0_09/jre/ lib/amd64:/home/user01/oracle/ggs_trg:/usr/java/jdk1.7.0_09/jre/lib/amd64/server export LD_LIBRARY_PATH JAVA_HOME=/usr/java/jdk1.7.0_09 export JAVA_HOME
### exjava.properties (GoldenGate Java Extract properties file) gg.handlerlist=advjms java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory java.naming.provider.url=tcp://localhost:61616 gg.handler.advjms.type=jms gg.handler.advjms.destination=dynamicQueues/oggjmsQueue gg.handler.advjms.connectionFactory=ConnectionFactory gg.handler.advjms.format=xml ### native library config ### goldengate.userexit.nochkpt=TRUE goldengate.userexit.timestamp=utc goldengate.log.logname=cuserexit goldengate.log.level=INFO goldengate.log.tofile=true goldengate.userexit.writers=javawriter #javawriter.stats.time=3600 #javawriter.stats.numrecs=10000 javawriter.stats.full=TRUE javawriter.stats.display=TRUE javawriter.bootoptions=-Xmx1024m -Xms512m -Djava.class.path=ggjava/ggjava.jar:dirprm:/opt/apache-activemq-5.5.1/activemq-all-5.5.1.jar:/opt/apache-activemq-5.5.1/lib/optional/log4j-1.2.14.jar:/opt/apache-activemq-5.5.1/lib/optional/slf4j-log4j12-1.5.11.jar -Dlog4j.configuration=log4j.properties
Extract exjava setEnv ( GGS_USEREXIT_CONF = "./dirprm/exjava.properties" ) GetEnv (JAVA_HOME) GetEnv (PATH) GetEnv (LD_LIBRARY_PATH) GetEnv (LIBPATH) CUserExit libggjava_ue.so CUSEREXIT PASSTHRU INCLUDEUPDATEBEFORES Sourcedefs ./dirdef/custdb.def getupdatebefores TABLE user01.customer;
GGSCI> ADD extract exjava, extTrailSource ./dirdat/ps
1. Why I get the "2015-07-16 11:48:07 ERROR OGG-01122 Error opening module libggjava_ue.so - libggjava_ue.so: cannot open shared object file: No such file or directory]." error?
Answer: To check this issue, go to the GoldenGate home directory and check if the libggjava_ue.so libary is in the directory. If not, re-install the Oracle GoldenGate for Java Adapter package. If yes, then check the LD_LIBRARY_PATH setup, you can check the report file when including the GetEnv (LD_LIBRARY_PATH) in the extract parameter file. If there is anything wrong, reset the environment variable (with setevn.sh) and restart the manager so the vairable is picked up by Oracle GoldenGate.
2. Why I get the "Could not create UserExitMain object" error?
Answer: Make sure the JMS queue is up and running and the setup in the *.properties files for the JMS repository is correct.
- Oracle GoldenGate JMS Adapter Handbook (Doc ID 1927481.1)