• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

JGIT in servlet?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can  we use Jgit git version control library  in servlet doPOst() method?Actually i want to clone github repostory from servlets?any help please
 
Saloon Keeper
Posts: 5802
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The doPost method is part of the HTTP request/response cycle, and as such should not be used to execute long-running processes. But a servlet container is just another environment for running Java code, so it should be able to use any Java library. Maybe the POST request can kick off a background job that executes the git command.
 
srikanth nedamanuri
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for your reply i am getting below error message when it is calling clone command of jgit?can you please suggest me

</pre></p><p><b>root cause</b> <pre>java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.FS
org.eclipse.jgit.lib.BaseRepositoryBuilder.setupWorkTree(BaseRepositoryBuilder.java:622)
org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:556)
org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:579)
org.eclipse.jgit.api.InitCommand.call(InitCommand.java:113)
org.eclipse.jgit.api.CloneCommand.init(CloneCommand.java:168)
org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:133)
com.rest.RepoClass.cloneRepository(RepoClass.java:94)
com.rest.RepoUtil.CheckOut(RepoUtil.java:56)
com.rest.Payload.doPost(Payload.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 
Tim Moores
Saloon Keeper
Posts: 5802
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like that class is not in the classpath of the web app. Where is it?
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!