On Mon, Jun 24, 2019 at 7:19 AM jimy page <[email protected]> wrote:
>
> I have jackrabbit runnig with repo /users/xyz/repo1
> Inside this I have repository.xml
>
>
> I want to call org.apache.jackrabbit.servlet.jackrabbit.StatisticsServlet
> to show different metrices.
>
>
> *But the problem I am facing here is: --> In order to create
> RepositoryConfig, I need to pass in the repo folder path, but Jackrabbit
> process is already kept it locked. What is the alternative here ?*
>
> *I can copy over "/Users/xyz/repository/", to some other folder and use
> that, but my question is in that case will I get all the repository
> information ?*
I don't think so.
If you copy the data such as directories and *recreate* a. new
repository instance, it will show new statistics of the new running
repository.
I think you should just configure the StatisticsServlet on the same
web application which initializes the repository.
Regards,
Woonsan
>
> ----> Here is my sample code
>
> HttpServletRequest request, HttpServletResponse response)
> throws ServletException, IOException {
> String klass = RepositoryContext.class.getName();
> String name = getServletConfig().getInitParameter(klass);
> if (name == null) {
> name = klass;
> }
>
> // RepositoryContext context = (RepositoryContext)
> // getServletContext().getAttribute(name);
> RepositoryConfig config = null;
> try {
> config = RepositoryConfig.create(new File("/Users/xyz/repository/"));
> //**some try
> // **some try ends here
> } catch (ConfigurationException e) {
> e.printStackTrace();
> }
> RepositoryContext context = null;
> try {
> context = RepositoryContext.create(config);