私はGitblitを試しています。これは、Git の Web-UI として非常に優れているようです。war ファイルによるインストールは非常に簡単で、すぐに使用できます。しかし、私は奇妙な問題に直面しています。
標準のフォルダー構造を持つ Maven プロジェクトを共有しています
project
pom.xml
src
src/test-file.txt (I added this file to verify the issue)
src/java
src/java/main
src/java/main/package
src/java/main/package/File.java
最初のレベル (そう、pom.xml
およびsrc
) をナビゲートしようとする限り、すべて問題なく、ファイルを開いて正しく読み取ることができます。java
ただし、下のフォルダを開こうとするとsrc
、リンクがレンダリングされlocalhost:8080/gitblit/tree/project/commit-id/src%2Fjava
、白いページが表示されます。リクエストはサーバーに転送されず(Tomcat 7.0.32が役立つ場合)、firebugは単に私に伝えますError 400: Bad Request
.
変%2F
に見えるので、手動で のリンクを修正しようとしましたlocalhost:8080/gitblit/tree/project/commit-id/src/java
が、内部サーバー エラーが発生しました。ログを見て、私は読んだ
INFO Found more URL path parts then expected, these will be ignored. Url: 'http://localhost:8080/gitblit/tree/project/commit-id/src/java', mountpath: 'blob', urlPath: 'project/commit-id/src/java', expected 3 parameters was 4
それから、私はそれを追加しましたtest-file.txt
。に移動しsrc
て開こうとするとtest-file.txt
、まずリンクが を開こうlocalhost:8080/gitblit/blob/project/commit-id/src%2Ftest-file.txt
とし、ファイルが見つからないことを示す html ページが表示されます。以前と同じトリック ( %2F
to /
) を試みると、次の例外が発生します。
INFO Found more URL path parts then expected, these will be ignored. Url: 'http://localhost:8080/gitblit/blob/project/commit-id/src/test-file.txt', mountpath: 'blob', urlPath: 'project/commit-id/src/test-file.txt', expected 3 parameters was 4
ERROR /path/to/project/.git cant find {1} in tree {2}
org.eclipse.jgit.errors.IncorrectObjectTypeException: Object commit-id is not a blob.
at org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:130)
at org.eclipse.jgit.lib.ObjectDatabase.open(ObjectDatabase.java:176)
at org.eclipse.jgit.lib.Repository.open(Repository.java:278)
at com.gitblit.utils.JGitUtils.getByteContent(JGitUtils.java:563)
at com.gitblit.utils.JGitUtils.getStringContent(JGitUtils.java:596)
at com.gitblit.wicket.pages.BlobPage.<init>(BlobPage.java:133)
at sun.reflect.GeneratedConstructorAccessor22.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:89)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:305)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
ERROR Can't instantiate page using constructor public com.gitblit.wicket.pages.BlobPage(org.apache.wicket.PageParameters) and argument r = "project" h = "commit-id" f = "src"
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public com.gitblit.wicket.pages.BlobPage(org.apache.wicket.PageParameters) and argument r = "project" h = "commit-id" f = "src"
at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:89)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:305)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor22.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
... 27 more
Caused by: java.lang.NullPointerException
at com.gitblit.wicket.pages.BlobPage.generateSourceView(BlobPage.java:142)
at com.gitblit.wicket.pages.BlobPage.<init>(BlobPage.java:134)
... 31 more
私は基本的に gitblit 自体を構成していません (変更はありませんgitblit.properties
)。ヒントはありますか?