Saturday, February 23, 2013

Setup Subversion 1.7 into JDeveloper 11R2

I do not know for what reason Oracle JDeveloper R2 still does not support Subversion 1.7, but I've managed to make it to support it. I've done it n Linux, but you can apply it for Windows too.
So.
That is what I have:
- Ubuntu 11.20 Linux 3.5.0-24-generic SMP x86_64
- JDeveloper Studio Edition 11.1.2.3.0

1. Check what Subversion is installed in JDeveloper.
Start JDeveloper and open menu Tools -> Preferences, select Versioning/Subversion: see
SVNKit/1.3.5 Client installed. JNA disabled.

2. Close JDeveloper.

3. This step is optional. Install linsvn-java package if you think you will need some fancy ways to login to Subversion using system security.

sudo apt-get install libsvn-java

4. Download SVNKit Standalone Version 1.7 from http://svnkit.com/download.php
cd /download/svn/
wget http://www.svnkit.com/org.tmatesoft.svn_1.7.8.standalone.zip
unzip  org.tmatesoft.svn_1.7.8.standalone.zip


/download/svn/svnkit-1.7.8 directory is created

5. Download Subclipse 1.8 from http://subclipse.tigris.org
cd /download/subclipse/
wget http://subclipse.tigris.org/files/documents/906/49260/site-1.8.18.zip
unzip site-1.8.18.zip 

later we will need only files from /download/subclipse/plugins

5. Go to JDeveloper extension directory (my JDev is installed in /opt/oracle/) and do following:
cd /opt/oracle/middleware-11.1.2.3/jdeveloper/jdev/extensions
mv oracle.jdeveloper.subversion oracle.jdeveloper.subversion-1.3
mkdir oracle.jdeveloper.subversion-1.7
ln -s oracle.jdeveloper.subversion-1.7 oracle.jdeveloper.subversion

6. Copy required SVNKit files here and link them as "versionless" names
cd oracle.jdeveloper.subversion
cp /download/svn/svnkit-1.7.8/lib/antlr-runtime-3.4.jar .
cp /download/svn/svnkit-1.7.8/lib/svnkit-1.7.8.jar .
cp /download/svn/svnkit-1.7.8/lib/sqljet-1.1.6.jar .
cp /download/svn/svnkit-1.7.8/lib/sequence-library-1.0.2.jar .
cp /download/svn/svnkit-1.7.8/svnkit-javahl16-1.7.8.jar .
cp /download/svn/svnkit-1.7.8/trilead-ssh2-1.0.0-build215.jar .

ln -s antlr-runtime-3.4.jar antlr-runtime.jar
ln -s svnkit-1.7.8.jar svnkit.jar
ln -s sqljet-1.1.6.jar sqljet.jar
ln -s sequence-library-1.0.2.jar sequence-library.jar
ln -s svnkit-javahl16-1.7.8.jar svnkit-javahl.jar
ln -s trilead-ssh2-1.0.0-build215.jar trilead.jar


7. Copy required Subclipse files here and link them as "versionless" names

cp /download/subclipse/plugins/net.java.dev.jna_3.4.0.t20120117_1605.jar .
cp /download/subclipse/plugins/org.tigris.subversion.clientadapter_1.8.3.jar .

cp /download/subclipse/plugins/org.tigris.subversion.clientadapter.javahl_1.7.8.1.jar .
cp /download/subclipse/plugins /org.tigris.subversion.clientadapter.svnkit_1.7.8.1.jar . 

ln -s net.java.dev.jna_3.4.0.t20120117_1605.jar jna.jar
ln -s org.tigris.subversion.clientadapter_1.8.3.jar svnClientAdapter.jar 
ln -s org.tigris.subversion.clientadapter.javahl_1.7.8.1.jar svnjavahl.jar
ln -s org.tigris.subversion.clientadapter.svnkit_1.7.8.1.jar casvnkit.jar

5. Go to JDeveloper jdev/bin directory and open jdev.conf file in your favorite text editor:
cd /opt/oracle/middleware-11.1.2.3/jdeveloper/jdev/bin
gedit jdev.conf

6. Add following to the end
#
# Needed for Subversion 1.7
#
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/antlr-runtime.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/svnkit.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/casvnkit.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/sqljet.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/svnClientAdapter.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/svnjavahl.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/trilead.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/svnkit-javahl.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/sequence-library.jar

# If you want to use JNA
#AddNativeCodePath /usr/lib/x86_64-linux-gnu/jni/libsvnjavahl-1.so
#AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/jna.jar

# for debug
#AddVMOption -Djava.util.logging.config.file=../extensions/oracle.jdeveloper.subversion/svnkit-logging.conf
#AddVMOption -verbose


7. Check what Subversion is now installed in JDeveloper.
Start JDeveloper and open menu Tools -> Preferences, select Versioning/Subversion: see
SVNKit/1.7.8 Client installed. JNA Disabled.

Done!
Now you can connect to your Subversion 1.7 repository and use Versioning Navigator, commit files in Application Navigator etc.


Some additional notes!

I had issues when I wanted to add a project or an application to Versioning (using JDK 1.6 (i386) and 1.7 (amd64) ). SVNKit returned exception
 java.lang.NullPointerException at org.tmatesoft.svn.core.internal.wc.SVNClassLoader.loadProperties(SVNClassLoader.java:193)

I've filed the bug to SVNKit issues tracker http://issues.tmatesoft.com/issue/SVNKIT-352 .
However if you do not want to wait for official update that includes the fix, you can fix it yourself.
1. unzip sources
cd /download/svn/svnkit-1.7.8-nojna/src
mkdir svnkit
cd svnkit
unzip ../svnkit-1.7.8-sources.jar 

2. unzip classes
cd /opt/oracle/middleware-11.1.2.3/jdeveloper/jdev/extensions/oracle.jdeveloper.subversion
mkdir svnkit
cd svnkit
unzip ../svnkit.jar

3. copy source to classes
cd org/tmatesoft/svn/core/internal/wc/ 
cp /download/svn/svnkit-1.7.8-nojna/src/svnkit/org/tmatesoft/svn/core/internal/wc/SVNClassLoader.java .


4. modify code to fix the bug
Open for edit SVNClassLoader.java
go to line 193

resourceStream = SVNClassLoader.class.getClassLoader().getResourceAsStream(svnkitPropertiesResource);
delete it

insert here the following

ClassLoader cl = SVNClassLoader.class.getClassLoader();
if (cl == null) cl = ClassLoader.getSystemClassLoader();
resourceStream = cl.getResourceAsStream(svnkitPropertiesResource);

save, exit from editor


5. compile the file
/opt/oracle/jdk1.7.0_15-amd64/bin/javac -g:source,lines,vars -source 1.5 -target 1.5 -cp /opt/oracle/middleware-11.1.2.3/jdeveloper/jdev/extensions/oracle.jdeveloper.subversion/sequence-library.jar:/opt/oracle/middleware-11.1.2.3/jdeveloper/jdev/extensions/oracle.jdeveloper.subversion/svnkit.jar SVNClassLoader.java

6. modify jdev.conf to use svnkit dir instead of svnkit.jar
AddVMOption -Xbootclasspath/a:../extensions/oracle.jdeveloper.subversion/svnkit

If you need that SVNKit to generate a detailed output create file
../extensions/oracle.jdeveloper.subversion/svnkit-logging.conf and populate it with something like
svnkit.level=FINEST
svnkit-network.level=FINEST
svnkit-fsfs.level=FINEST
svnkit-wc.level=FINEST
svnkit-cli.level=FINEST


----------
Note. By some reason History in JDeveloper does not work with SVN. Though you can see change log in Version Navigator or other ways.











10 Comments:

Blogger mmesh said...

Hi!

I'm just starting with Jdeveloper v11.1.2.3 on Ubuntu 12.04 64bit and I wanted to upgrade svnkit so I could use CLI subversion client as an alternative to the GUI one in Jdeveloper. I followed Your tutorial and after starting Jdeveloper with the new svnkit I wanted to checkout a project from a subversion server on my local network. But I get this error when I try to traverse through the tree in "Versioning Navigator" Window:

java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
j.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
j.util.concurrent.FutureTask.get(FutureTask.java:83)
...
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
j.a.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by:
java.lang.ExceptionInInitializerError
org.tmatesoft.svn.core.internal.io.svn.SVNPlainConnector.open(SVNPlainConnector.java:53)
org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77)
...
j.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
j.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
j.lang.Thread.run(Thread.java:662)
Caused by:
java.lang.NullPointerException
org.tmatesoft.svn.core.internal.wc.SVNClassLoader.loadProperties(SVNClassLoader.java:193)
org.tmatesoft.svn.core.internal.wc.SVNClassLoader.getAllClasses(SVNClassLoader.java:149)
org.tmatesoft.svn.core.internal.wc.SVNClassLoader.getThreadPool(SVNClassLoader.java:57)
...
jx.s.SwingWorker.run(SwingWorker.java:316)
j.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
j.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
j.lang.Thread.run(Thread.java:662)


Can You please help me with this problem?

5:43 AM  
Blogger mmesh said...

Just to get an e-mail about this...

5:44 AM  
Blogger Mark Malakanov said...

Have you delete/commented line 193
of SVNClassLoader.java

resourceStream = SVNClassLoader.class.getClassLoader().getResourceAsStream(svnkitPropertiesResource);

???
This line should be deleted/commented and replaced with code I've provided in step 4.

2:46 PM  
Blogger Jon-Eric said...

I tried but was unsuccessful with these steps in JDev 11.1.1.7. Any experience making a similar change (SVN 1.7) in JDev 11.1.1?

3:23 PM  
Blogger ljzforever said...

hi,
windows 2008 R2
jdk 1.7.24 X64
jdeveloper 11.1.1.6
site-1.8.22
org.tmatesoft.svn_1.7.9.standalone

after follow your step,when i check out, it say:

Performing action Check Out...[ from oracle.jdevimpl.help.HelpTopicEditor ]
Invoking command: [ from oracle.jdevimpl.help.HelpTopicEditor ]

java.lang.NullPointerException
org.tmatesoft.svn.core.internal.util.SVNSocketFactory.connect(SVNSocketFactory.java:151)
org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createPlainSocket(SVNSocketFactory.java:73)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:272)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:423)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:366)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:354)
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:708)
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:628)
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:103)
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1016)
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:180)
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118)
org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:148)
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45)
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.checkout(SvnNgAbstractUpdate.java:706)
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:14)
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:9)
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1238)
org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
org.tmatesoft.svn.core.javahl17.SVNClientImpl.checkout(SVNClientImpl.java:366)
org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.checkout(AbstractJhlClientAdapter.java:291)
o.ji.vcs.svn.op.SVNOperationCheckout$CheckoutThread.executeCheckout(SVNOperationCheckout.java:593)
o.ji.vcs.svn.op.SVNOperationCheckout$CheckoutThread.executeCheckoutWithProgress(SVNOperationCheckout.java:548)
o.ji.vcs.svn.op.SVNOperationCheckout$CheckoutThread.run(SVNOperationCheckout.java:394)

any suggest?

6:06 AM  
Blogger Shiva said...

Hi,

Jdev IDE, Hangs everytime when i go to Application Module, Data Model Tab. I tried re-installing. We’er using SVN Subversion for Server. We’re not able to process further because of this issue.

10:09 PM  
Blogger Felipe said...

Based on Mark's work, I've adapted the how to for SVN 1.8 and JDeveloper 12c versions. It solves the Nullpointer at the "connect" method like ljzforever mentioned.

http://blog.monst3rdev.com.br/index.php/how-to-use-svn-1-8-in-jdeveloper-12c/

3:12 PM  
Blogger for IT the said...

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

8:17 PM  
Blogger for IT the said...

Java Training Institutes Java Training Institutes Java EE Training in Chennai Java EE Training in Chennai Java Spring Hibernate Training Institutes in Chennai J2EE Training Institutes in Chennai J2EE Training Institutes in Chennai Core Java Training Institutes in Chennai Core Java Training Institutes in Chennai

8:22 PM  
Blogger for IT the said...

Hibernate Online Training Hibernate Online Training Hibernate Training in Chennai Hibernate Training in Chennai Java Online Training Java Online Training

Hibernate Training Institutes in ChennaiHibernate Training Institutes in Chennai Java Online Training Java Online Training Java Online Training Java Online Training

8:23 PM  

Post a Comment

<< Home