Hi guys i m getting following exception: java.lang.IllegalStateException: The repository is not available. Please check RepositoryAccessServlet configuration in web.xml.
I m new to Jackrabbit and I have deployed jackrabbit-webapp-2.4.3 on my websphere7 but how can I configure my custom repository.xml in this webapp web.xml. I have read the webapp web.xml and tried to change it accordingly but i am unable to. If you have any sample config and code snippet please share, I am quite stuck here. thank you in advance.
Here is a sample repository.xml. Hope this will help:
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE Repository
PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
"http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
<!-- Example Repository Configuration File
Used by
- org.apache.jackrabbit.core.config.RepositoryConfigTest.java
-
-->
<Repository>
<!--
virtual file system where the repository stores global state
(e.g. registered namespaces, custom node types, etc.)
-->
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/repository"/>
</FileSystem>
<!--
data store configuration
-->
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
<!--
security configuration
-->
<Security appName="Jackrabbit">
<!--
security manager:
class: FQN of class implementing the JackrabbitSecurityManager interface
-->
<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
<!--
workspace access:
class: FQN of class implementing the WorkspaceAccessManager interface
-->
<!-- <WorkspaceAccessManager class="..."/> -->
<!-- <param name="config" value="${rep.home}/security.xml"/> -->
</SecurityManager>
<!--
access manager:
class: FQN of class implementing the AccessManager interface
-->
<AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
<!-- <param name="config" value="${rep.home}/access.xml"/> -->
</AccessManager>
<LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
<!--
anonymous user name ('anonymous' is the default value)
-->
<param name="anonymousId" value="anonymous"/>
<!--
administrator user id (default value if param is missing is 'admin')
-->
<param name="adminId" value="admin"/>
</LoginModule>
</Security>
<!--
location of workspaces root directory and name of default workspace
-->
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
<!--
workspace configuration template:
used to create the initial workspace if there's no workspace yet
-->
<Workspace name="${wsp.name}">
<!--
virtual file system of the workspace:
class: FQN of class implementing the FileSystem interface
-->
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}"/>
</FileSystem>
<!--
persistence manager of the workspace:
class: FQN of class implementing the PersistenceManager interface
-->
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
</PersistenceManager>
<!--
Search index and the file system it uses.
class: FQN of class implementing the QueryHandler interface
-->
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
<param name="supportHighlighting" value="true"/>
</SearchIndex>
</Workspace>
<!--
Configures the versioning
-->
<Versioning rootPath="${rep.home}/version">
<!--
Configures the filesystem to use for versioning for the respective
persistence manager
-->
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/version" />
</FileSystem>
<!--
Configures the persistence manager to be used for persisting version state.
Please note that the current versioning implementation is based on
a 'normal' persistence manager, but this could change in future
implementations.
-->
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
<param name="schemaObjectPrefix" value=`enter code here`"version_"/>
</PersistenceManager>
</Versioning>
<!--
Search index for content that is shared repository wide
(/jcr:system tree, contains mainly versions)
-->
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${rep.home}/repository/index"/>
<param name="supportHighlighting" value="true"/>
</SearchIndex>
<!--
Run with a cluster journal
-->
<Cluster id="node1">
<Journal class="org.apache.jackrabbit.core.journal.MemoryJournal"/>
</Cluster>
</Repository>
Related
I am brand new to Repast and am interested in eventually creating a marine traffic simulation in the Arctic. I am going through the "Import Repast Examples" and none of the models I go through display the maps in the simulation display. For example this shot of the Geotracks demo shows the blue marble map is clearly not loading.
In the Geography demo a small thumbnail of Chicago is visible but none of the surrounding map.
I couldn't find any documentation to fix this issue. When I go to the GIS display setup it appears the files are enabled so I do not known what else to do to troubleshoot.
Here is a picture of the console errors that I am receiving.
I installed Repast using the default installation settings for Windows.
I am able to replicate the issue. The background map layers are provided by the NASA WorldWind service and it appears that the servers are sometimes slow or unresponsive. This data is served by third parties and the Repast team does not have direct control over providing the background map layers. There does appear to be a solution as posted by one of their developers here: https://github.com/NASAWorldWind/WorldWindJava/issues/219 in which they describe how to improve some of the WorldWind network properties to help with the slow servers, and I have tested that this does work.
You will need to copy the below into a file named "worldwind.xml" in your project:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2006-2009, 2017, 2020 United States Government, as represented by the
~ Administrator of the National Aeronautics and Space Administration.
~ All rights reserved.
~
~ The NASA World Wind Java (WWJ) platform is licensed under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software distributed
~ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
~ CONDITIONS OF ANY KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations under the License.
~
~ NASA World Wind Java (WWJ) also contains the following 3rd party Open Source
~ software:
~
~ Jackson Parser – Licensed under Apache 2.0
~ GDAL – Licensed under MIT
~ JOGL – Licensed under Berkeley Software Distribution (BSD)
~ Gluegen – Licensed under Berkeley Software Distribution (BSD)
~
~ A complete listing of 3rd Party software notices and licenses included in
~ NASA World Wind Java (WWJ) can be found in the WorldWindJava-v2.2 3rd-party
~ notices and licenses PDF found in code directory.
-->
<!--$Id: worldwind.xml 2348 2014-09-25 23:35:46Z dcollins $-->
<!--Default WorldWind configuration values-->
<!--Any of these can be overridden by specifying an application configuration document-->
<!--An alternate document to this one can also be specified-->
<!--See the javadoc for the Configuration class for details-->
<WorldWindConfiguration version="1">
<!--The initial layer list can be embedded here or linked as below. To change the set of initial layers,-->
<!--modify the file identified by the href or replace the link with your own-->
<LayerList href="config/worldwind.layers.xml"/>
<!--Most configuration information is defined in attribute-value pairs-->
<Property name="gov.nasa.worldwind.avkey.ModelClassName" value="gov.nasa.worldwind.BasicModel"/>
<Property name="gov.nasa.worldwind.avkey.GlobeClassName"
value="gov.nasa.worldwind.globes.Earth"/>
<Property name="gov.nasa.worldwind.avkey.EarthElevationModelConfigFile"
value="config/Earth/EarthElevations2.xml"/>
<Property name="gov.nasa.worldwind.globes.GeographicProjectionClassName"
value="gov.nasa.worldwind.globes.projections.ProjectionEquirectangular"/>
<Property name="gov.nasa.worldwind.avkey.InitialLatitude" value="38"/>
<Property name="gov.nasa.worldwind.avkey.InitialAltitude" value="19.07e6"/>
<Property name="gov.nasa.worldwind.avkey.ViewClassName" value="gov.nasa.worldwind.view.orbit.BasicOrbitView"/>
<Property name="gov.nasa.worldwind.avkey.ViewInputHandlerClassName"
value="gov.nasa.worldwind.view.orbit.OrbitViewInputHandler"/>
<Property name="gov.nasa.worldwind.avkey.InputHandlerClassName" value="gov.nasa.worldwind.awt.AWTInputHandler"/>
<Property name="gov.nasa.worldwind.avkey.LoggerName" value="gov.nasa.worldwind"/>
<Property name="gov.nasa.worldwind.avkey.WorldWindowClassName"
value="gov.nasa.worldwind.WorldWindowGLAutoDrawable"/>
<Property name="gov.nasa.worldwind.avkey.ElevationModelFactory"
value="gov.nasa.worldwind.terrain.BasicElevationModelFactory"/>
<Property name="gov.nasa.worldwind.avkey.LayerFactory" value="gov.nasa.worldwind.layers.BasicLayerFactory"/>
<Property name="gov.nasa.worldwind.avkey.ShapefileLayerFactory"
value="gov.nasa.worldwind.formats.shapefile.ShapefileLayerFactory"/>
<Property name="gov.nasa.worldwind.avkey.WebViewFactory"
value="gov.nasa.worldwind.util.webview.BasicWebViewFactory"/>
<Property name="gov.nasa.worldwind.avkey.TessellatorClassName"
value="gov.nasa.worldwind.terrain.RectangularTessellator"/>
<Property name="gov.nasa.worldwind.avkey.MemoryCacheSetClassName"
value="gov.nasa.worldwind.cache.BasicMemoryCacheSet"/>
<Property name="gov.nasa.worldwind.avkey.SessionCacheClassName" value="gov.nasa.worldwind.cache.BasicSessionCache"/>
<Property name="gov.nasa.worldwind.avkey.RetrievalServiceClassName"
value="gov.nasa.worldwind.retrieve.BasicRetrievalService"/>
<Property name="gov.nasa.worldwind.avkey.SceneControllerClassName"
value="gov.nasa.worldwind.StereoOptionSceneController"/>
<Property name="gov.nasa.worldwind.avkey.NetworkStatusClassName"
value="gov.nasa.worldwind.util.BasicNetworkStatus"/>
<Property name="gov.nasa.worldwind.render.PointPlacemarkAttributes.DefaultImagePath"
value="images/pushpins/plain-yellow.png"/>
<Property name="gov.nasa.worldwind.render.PointPlacemarkAttributes.DefaultLabelFont"
value="Arial-BOLD-14"/>
<!-- The following lists the sites to test for public network access. Specify an empty string, "", for no sites.-->
<!-- Don't specify the property at all to use the default list. -->
<Property name="gov.nasa.worldwind.avkey.NetworkStatusTestSites"
value="www.nasa.gov, worldwind.arc.nasa.gov, google.com, microsoft.com, yahoo.com"/>
<Property name="gov.nasa.worldwind.avkey.TaskServiceClassName" value="gov.nasa.worldwind.util.ThreadedTaskService"/>
<Property name="gov.nasa.worldwind.avkey.DataFileStoreClassName"
value="gov.nasa.worldwind.cache.BasicDataFileStore"/>
<Property name="gov.nasa.worldwind.avkey.DataRasterReaderFactoryClassName"
value="gov.nasa.worldwind.data.BasicDataRasterReaderFactory"/>
<Property name="gov.nasa.worldwind.avkey.DataFileStoreConfigurationFileName" value="config/DataFileStore.xml"/>
<Property name="gov.nasa.worldwind.avkey.WorldMapImagePath" value="images/earth-map-512x256.dds"/>
<Property name="gov.nasa.worldwind.StarsLayer.StarsFileName" value="config/Hipparcos_Stars_Mag6x5044.dat"/>
<!--The following are tuning parameters for various WorldWind internals-->
<Property name="gov.nasa.worldwind.avkey.RetrievalPoolSize" value="32"/>
<Property name="gov.nasa.worldwind.avkey.RetrievalQueueSize" value="400"/>
<Property name="gov.nasa.worldwind.avkey.RetrievalStaleRequestLimit" value="60000"/>
<Property name="gov.nasa.worldwind.avkey.TaskPoolSize" value="32"/>
<Property name="gov.nasa.worldwind.avkey.TaskQueueSize" value="60"/>
<Property name="gov.nasa.worldwind.avkey.ScheduledTaskPoolSize" value="1"/>
<Property name="gov.nasa.worldwind.avkey.VerticalExaggeration" value="1"/>
<Property name="gov.nasa.worldwind.avkey.URLConnectTimeout" value="8000"/>
<Property name="gov.nasa.worldwind.avkey.URLReadTimeout" value="10000"/>
<Property name="gov.nasa.worldwind.avkey.TextureCacheSize" value="500000000"/>
<Property name="gov.nasa.worldwind.avkey.ElevationTileCacheSize" value="20000000"/>
<Property name="gov.nasa.worldwind.avkey.ElevationExtremesLookupCacheSize" value="20000000"/>
<Property name="gov.nasa.worldwind.avkey.SectorGeometryCacheSize" value="10000000"/>
<Property name="gov.nasa.worldwind.avkey.TextureTileCacheSize" value="10000000"/>
<Property name="gov.nasa.worldwind.avkey.PlacenameLayerCacheSize" value="4000000"/>
<Property name="gov.nasa.worldwind.avkey.AirspaceGeometryCacheSize" value="32000000"/>
<Property name="gov.nasa.worldwind.avkey.VBOUsage" value="true"/>
<Property name="gov.nasa.worldwind.avkey.VBOThreshold" value="30"/>
<Property name="gov.nasa.worldwind.avkey.OfflineMode" value="false"/>
<Property name="gov.nasa.worldwind.avkey.RectangularTessellatorMaxLevel" value="30"/>
<Property name="gov.nasa.worldwind.StereoFocusAngle" value="1.6"/>
<Property name="gov.nasa.worldwind.avkey.ForceRedrawOnMousePressed" value="f"/>
<!-- Here's one way to specify proxy settings -->
<!--<Property name="gov.nasa.worldwind.avkey.UrlProxyHost" value="100.215.10.20"/>-->
<!--<Property name="gov.nasa.worldwind.avkey.UrlProxyPort" value="8080"/>-->
<!--<Property name="gov.nasa.worldwind.avkey.UrlProxyType" value="Proxy.Type.Http"/>-->
<!-- Location of icons for MIL-STD-2525C symbol set. This can be a URL to a web server, to a local zip or jar archive.
See https://goworldwind.org/developers-guide/symbology/tactical-symbols/#offline-use for more information on how
to configure a local symbol repository.
Examples: http://myserver.com/milstd2525/ (web server)
jar:file:milstd2525-symbols.zip! (local zip archive) -->
<Property name="gov.nasa.worldwind.avkey.MilStd2525IconRetrieverPath"
value="https://worldwind.arc.nasa.gov/milstd2525c/rev1/"/>
</WorldWindConfiguration>
For testing with the Repast Geography demo, I placed the worldwind.xml file in the geograph.styles folder. And then in the ContextCreator.java add the following:
static
{
System.setProperty("gov.nasa.worldwind.app.config.document",
"geography/styles/worldwind.xml");
}
This will tell WorldWind where to find the modified worldwind.xml file. You will need to repeat this process for any other Repast model that uses the background NASA layers. Apologies for this clunky workaround. We will fix this in the next Repast release so that you don't need to manually perform these changes.
I'm using this guide to working with maps in Xamarin.
It says I should use different values of the key
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AbCdEfGhIjKlMnOpQrStUvWValueGoesHere" />
for debug and release builds; the debug version should use an API key that contains SHA-1 certificates from debug.keystore, which has well-known default passwords.
In live mode, I should use SHA-1 certificates from my custom keystore files, whose passwords only I know. The live API key and SHA-1 certificate work in the live APK, but not in the debug build. This makes sense, I guess. I should have one Google Android API key for debugging, and one for production.
What I don't want to do is have this in my AndroidManifest.xml file:
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="<My Debug API Key>" />
<!--<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="<My Release API Key>" />-->
...changing the commented out section depending on whether I'm doing a debug or release build. Is there a more efficient way to do this (something like config transforms in ASP.NET applications)?
I've done some searching, and there are some automatically applied debug overrides, but it doesn't seem like I have a great deal of control over the process.
You can use assembly level MetaData attributes to define tags within the Manifest's Application element and by using conditional compilation:
#if DEBUG
[assembly: MetaData("com.google.android.maps.v2.API_KEY", Value = "DebugKEYValue")]
#else
[assembly: MetaData("com.google.android.maps.v2.API_KEY", Value = "ReleaseKEYValue")]
#endif
Depending upon build type, this will result in:
<application android:allowBackup="true" android:icon="#mipmap/icon" android:label="#string/app_name" android:name="android.app.Application" android:debuggable="true">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="DebugValue" />
Or:
<application android:allowBackup="true" android:icon="#mipmap/icon" android:label="#string/app_name" android:name="android.app.Application">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="ReleaseKEYValue" />
I am new to Logback, I am trying to add file path dynamically, with a property file, for both windows and Linux.
Here is the code sinppet I have, how can I get the value to ${MY_HOME}
<appender name="SERVER_FILE" class="ch.qos.logback.core.FileAppender">
<file>${MY_HOME}/server.log</file>
<append>true</append>
<encoder>
<pattern>%d [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
Typically this is a system property, there are some answers that touch on this but only provide one part of the answer. These are:
Logback.xml configuration
logback how to set destination folder for log files
But the manual on configuration shows that the mechanism is quite flexible
As in many scripting languages, logback configuration files support definition and substitution of variables. Variables can be defined within the configuration file itself, in an external file, in an external resource or even computed and defined on the fly.
In summary you have a number of options for defining the value of MY_HOME:
In the file
You are able to define the value in the file itself with:
<property name="MY_HOME" value="/home/myhome"/>
In the system properties
You can arrange for it to be set as a system property, most likely when you start the JVM.
java -DMY_HOME="/home/myhome" ...
From a property file on your system
You can arrange for logback to read a property file:
<property file="/opt/example/instance_1/properties/system.properties" />
From the classpath
You can write a properties file into a resources directory or into a jar and read it out as a resource, using the classpath.
<property resource="prod.properties" />
Using the property definer
You can arrange to call into your code, by using a property definer. For example:
<define name="MY_HOME" class="biz.nowhere.HomePropertyDefiner">
<application>app</application>
</define>
Where that class is something like (as an example):
public class HomePropertyDefiner extends PropertyDefinerBase {
private String application;
#Override
public String getPropertyValue() {
return String.format("/opt/%s/%s", application, MyInstanceManager.instancePath());
}
public void setApplication(String application) {
this.application = application;
}
}
I was reading Scott Gu's blog on ASP.NET 5.0 features and one of the new feature mentioned in the blog is to use json file as configuration and elimination of Web.config file.
I have few questions around that feature.
Assume I have following log4net configuration which was previously added to Web.Config in previous version of ASP.NET
Config file
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\\TestProj\\TestLog.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
How would one add sections in config.json ?
How would one convert above xml and add it to config.json?
Does 3rd Party library ( In my example log4net ) or users of the library have to add some type of custom conversion api to support json based configuration, in order to take advantage of new configuration feature provided in ASP.NET 5.0?
Recently I had the same problem with log4net. I managed to do it working as following:
Create log4net.xml file containing the configuration section for log4net
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
...
</log4net>
You can put the file in the project root folder.
And in the Startup.Startup() method you can configure the log4net providing the xml as a configuration:
public Startup(IApplicationEnvironment appEnv)
{
// ...
XmlConfigurator.Configure(new FileInfo(Path.Combine(appEnv.ApplicationBasePath, "log4net.xml")));
}
I hope this helps.
Current versions of log4net don't support Json projects, so the config needs to be in a separate xml file.
I have one file which contains rules for the project.
I want my unit tests methods to be allowed to have underscore in their names.
Like myMethod_should_call_someClass_someMehod. Currently I have one configuration, which is applied to all files in the project.
My question is it possible to somehow configure checkstyle, so, for example I specify specific rules for all files that are ending with *Test.java.
Currently the only solution I found is to provide SuppressionFilter and exclude all files ending with *Test.java. But is there a way I could provide a different MethodNameCheck module with different format for test files?
You must define the MethodName check twice, with one instance checking the regular methods, and the other checking the test methods. Note the id property, which we will use to restrict the checks to their respective domains:
<module name="MethodName">
<property name="id" value="MethodNameRegular"/>
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="MethodName">
<property name="id" value="MethodNameTest"/>
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
Next, the regular check must be suppressed for test methods and vice versa. This works only if you have a criterion by which to distinguish between the two kinds of classes. I use the Maven directory convention, which puts regular classes under src/main and test classes under src/test. Here is the suppression filter file:
<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files="[\\/]src[\\/]test[\\/].*" id="MethodNameRegular" />
<suppress files="[\\/]src[\\/]main[\\/].*" id="MethodNameTest" />
</suppressions>
Building on barfuin's answer, I preferred not to have (yet) another XML file floating around. However, it is possible to configure suppressions directly in the CheckStyle XML config file:
<module name="SuppressionSingleFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Suppress MethodNameRegular check on unit tests"/>
<property name="files" value=".*[\\/]src[\\/]test[\\/]"/>
<property name="id" value="MethodNameRegular"/>
</module>
<module name="SuppressionSingleFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Suppress MethodNameTest check except on unit tests"/>
<property name="files" value=".*[\\/]src[\\/](?!test[\\/])"/>
<property name="id" value="MethodNameTest"/>
</module>
(This would be in addition to the two MethodName checks.)