Hi Chandan,
and did you deploy a bundle providing org.tmatesoft.svn package ?
Can you check that the packages are available with:
packages:exports|grep -i org.tmatesoft.svn
Thanks,
Regards
JB
On 10/29/2015 06:26 AM, Chandan wrote:
Hello JB,
I am not using maven-bundle-plugin.
We are building jar and making it compatible with OSGI
Here how it looks
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SvnCheckoutService
Created-By: 1.7.0_40 (Oracle Corporation)
Bundle-SymbolicName: com.xyz.svncheckout
Bundle-Version: 1.0.3
Bundle-Activator: com. xyz.svncheckout.Activator
Bundle-Vendor: Abhilash
Bundle-Localization: plugin
Import-Package: org.osgi.framework,org.apache.camel,
org.apache.camel.impl,org.apache.camel.builder,org.apache.camel.builder.xml,org.apache.camel.model,org.apache.camel.component,org.apache.camel.component.http,org.apache.camel.core.osgi,org.apache.camel.spi,javax.xml.bind.annotation,javax.xml.bind,com.sun.xml.bind,javax.xml.namespace,
org.tmatesoft.svn
Best regards
Chandan Mysore Balakrishna
RBEI/ETC
Tel. +91(80)6657-5027
From: jbonofre [via Karaf] [mailto:[email protected]]
Sent: Thursday, October 29, 2015 10:35 AM
To: Chandan Mysore Balakrishna (RBEI/ETC3)
<[email protected]>
Subject: Re: Svn functionality on Karaf
Hi Chandan,
it's not in the code, it's in the Import-Package statement in the MANIFEST.
How do you create your bundle packaging ? using the maven-bundle-plugin ?
Regards
JB
On 10/29/2015 04:10 AM, Chandan wrote:
Thanks JB.
My code looks something like below
I tried org.tmatesoft.svn,org.tmatesoft.svn.* and also
org.tmatesoft.svn.core. Nothing worked
import java.io.File;
import java.io.FilenameFilter;
import java.util.UUID;
import org.bson.types.ObjectId;
import org.jongo.Jongo;
import org.jongo.MongoCollection;
import org.osgi.framework.BundleContext;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import com.bosch.camelroute.MCamelManager;
import com.bosch.camelroute.MProducerCallback;
import com.bosch.exception.MExceptions;
import com.bosch.manager.MManagerCallback;
import com.bosch.servicedata.MServiceRcvData;
import com.bosch.servicedata.MServiceSndData;
import com.bosch.store.MGeneralDefine;
import com.bosch.utils.JsonUtils;
import com.bosch.utils.MongoUtil;
final String svnurl = "https://welcome/tools/XYZ/trunk/ExcelAdapter";
String[] bits = svnurl.split("/");
String folderName = bits[bits.length-1];
System.out.println("Folder------------"+folderName);
final String destPath = "D:\\svnfiles\\"+folderName;
final String svnUserName = "xyz123";
final String svnPassword = "xyz123";
System.out.println("—————————————-");
System.out.println("Repository URL " + svnurl);
System.out.println("Checkout destination path: " + destPath);
try {
SVNRepository repository = null;
DAVRepositoryFactory.setup();
// initiate the reporitory from the svnurl
repository = SVNRepositoryFactory.create(SVNURL
.parseURIEncoded(svnurl));
// create authentication data
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(svnUserName,
svnPassword);
repository.setAuthenticationManager(authManager);
// output some data to verify connection
System.out.println("Repository Root: "
+ repository.getRepositoryRoot(true));
System.out.println("Repository UUID: "
+ repository.getRepositoryUUID(true));
// need to identify latest revision
long latestRevision = repository.getLatestRevision();
System.out.println("Repository Latest Revision: " + latestRevision);
// create client manager and set authentication
SVNClientManager ourClientManager = SVNClientManager.newInstance();
ourClientManager.setAuthenticationManager(authManager);
// use SVNUpdateClient to do the export
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
System.out.println("Location--"+repository.getLocation());
updateClient.doExport(repository.getLocation(), new File(destPath),
SVNRevision.create(latestRevision),
SVNRevision.create(latestRevision),null, true, SVNDepth.INFINITY);
updateClient.setIgnoreExternals(false);
System.out.println("Checkout file/folder successfully !");
} catch (SVNException e) {
e.printStackTrace();
System.out.println("Error message :” + e.getMessage()");
System.exit(1);
}
Regards,
Chandan
--
View this message in context:
http://karaf.922171.n3.nabble.com/Svn-functionality-on-Karaf-tp4043197p4043211.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
[hidden email]</user/SendEmail.jtp?type=node&node=4043214&i=0>
http://blog.nanthrax.net
Talend - http://www.talend.com
________________________________
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Svn-functionality-on-Karaf-tp4043197p4043214.html
To unsubscribe from Svn functionality on Karaf, click
here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4043197&code=Y2hhbmRhbi5teXNvcmViYWxha3Jpc2huYUBpbi5ib3NjaC5jb218NDA0MzE5N3wtMTA0MDE4ODQ2MQ==>.
NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
View this message in context:
http://karaf.922171.n3.nabble.com/Svn-functionality-on-Karaf-tp4043197p4043218.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com