load xml files from jars when wildcards in spring - spring-3

Overview of Scenario
we are in a application(Spring && REST) where there are large number of module in the form of JARs and each module has its context loader && classpath. So here I want to load some XMLs from sub module but what is happening, I am not able to load any xml from JAR.
What I am doing?
I am using the below code to fetch the xmls from sub module JAR but it is not reading context loader from submodule. According to my understanding it should load all the xmls from with the the application but the same is not happening.
Code Snippet
<bean id="mapper" class="org.dozer.spring.DozerBeanMapperFactoryBean">
<property name="mappingFiles">
<list>
<value>classpath*:*mappings.xml</value>
</list>
</property>
</bean>
What is the expectation?
I want to load all the xmls from sub module in a single go, so that I need not explicitly call each and every mapping file in root context loader.
Thanks in advanced.

Related

Xamarin.iOS versioning during build

I've been trying to get an automatic versioning system going for builds (mainly due to external crash analytics picking up each build as the same until I change the version manually). The format is simple, I take the CFBundleShortVersionString from the Info.plist, and append the current date and time (in yyyyMMddmmss format) as subversion.
The task I've put together for this:
<Project>
<Target Name="BeforeBuild">
<XmlPeek XmlInputPath="$(ProjectDir)Info.plist" Query="//dict/key[. = 'CFBundleShortVersionString']/following-sibling::string[1]">
<Output TaskParameter="Result" ItemName="VersionNumber" />
</XmlPeek>
<PropertyGroup>
<BuildNumber>$([System.DateTime]::Now.ToString(yyyyMMddmmss))</BuildNumber>
</PropertyGroup>
<XmlPoke XmlInputPath="$(ProjectDir)Info.plist" Query="//dict/key[. = 'CFBundleVersion']/following-sibling::string[1]" Value="$(VersionNumber).$(BuildNumber)" />
</Target>
</Project>
However it fails with the following error:
Target BeforeBuild:
[...]/[...].csproj(1069,5): error MSB3733: Input file "[...]/Info.plist" cannot be opened. For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.
Done building target "BeforeBuild" in project "[...].csproj" -- FAILED.
What am I doing wrong? There's not much info about this error, at least not much that I could find and would help fixing it.

Spring Integration Zip - .gz files

I'm trying spring-integration-zip - useful stuff - and was wondering if it (somehow) can also uzip .gz files apart from zip ones?
Moreover, I wanted to change workDirectory ("java.io.tmpdir") for unzip transformer - is there a way to change UnZipTransformer class in xml config, I do not see such possibility or maybe I'm missing something (I know I can use Java Config) - as it is in case of int:splitter for example?
Hm. We don't expose work-directory into the XML configuration.
Please, raise a GH issue on the matter.
Meanwhile you can use:
<int:transformer>
<bean id="unZipTransformer" class="org.springframework.integration.zip.transformer.UnZipTransformer">
<property name="workDirectory" value="D:\tmp"/>
</bean>
</int:transformer>
And no we don't support GZIP format for (un)compression.
The project has been built on top of zt-zip library. So, this Spring Integration Zip extension really provides functionality only for ZIP archives.
Feel free to fill out an issue on the matter as well.

Getting following Error in Sphinx 4.0- 'helloLinguist' property:'grammar' - mandatory property is not set

I am using sphinx 4.0 recognizer.While am running my application for swapping two statically defined grammars at runtime, i am getting the error in ecllipse as " 'helloLinguist' property:'grammar' - mandatory property is not set! ". I am using the cofiguration xml file provided on the link http://cmusphinx.sourceforge.net/wiki/sphinx4:swappinggrammars. Please help.
You must have accidentally edited the configuration and removed/commented the entry, or you are removing the grammar element during runtime. In the configuration you linked the property is set:
<component name="helloLinguist"
type="edu.cmu.sphinx.linguist.flat.FlatLinguist">
<property name="grammar" value="helloGrammar"/>
</component>

Reusing stopwords and other files in Solr multicore

I have a multicore setup for solr, the directory structure of which goes like
-multicore
|-core0
|--conf
|---schema.xml
|---solrconfig.xml
|---stopwords
|---synonyms
|-core1
|--conf
|---schema.xml
|---solrconfig.xml
|---stopwords
|---synonyms
Both of these cores essentially use the same stop words and synonyms file. Is there a way, both these files could be located at a common place and both the cores read it from there?
According to the CoreAdmin documentation, you can
specify properties in solr.xml which can be used in the solrconfig.xml and schema.xml files.
So as an example you could create something similar to the following:
<solr persistent="true" sharedLib="lib">
<property name="synonymns" value="<your path here>/synonyms.txt" />
<property name="stopwords" value="<your path here>/stopwords.txt" />
<cores adminPath="/admin/cores">
<core name="core0" instanceDir="core0"/>
<core name="core1" instanceDir="core1" />
</cores>
</solr>
Hopefully this should get you started, you will obviously want/need to modify the solr.xml settings to meet your specific needs. Also there are a few other options for how the properties can be defined and the use of defaults. Please refer to the documentation for more details.
Not sure if there is any elegant way with the latest releases.
You can check using the absolute path of the stopwords file.
We have just created a symbolic link to a common shared files which are updated avoiding duplicates.

CruiseControl.NET and Clearcase configuration

I'm having problems simply configuring the server for CruiseControl.NET. I am using the source block that is given by ThoughtWorks to set it up, but I cannot seem to get it to be error-free. I am pretty new to all this and some sort of direction would be fantastic.
Does anyone use this combination?
Do you have a ccnet.config file I can look at?
This is what does not work for me:
<cruisecontrol>
<project name="test">
<sourcecontrol type="clearCase">
<exec>batch file</exec>
<viewPath>path_name</viewPath>
<branch>main</branch>
<autoGetSource>false</autoGetSource>
<useLabel>true</useLabel>
<useBaseline>false</useBaseline>
<projectVobName>vob_name</projectVobName>
<viewName>projecy_name</viewName>
<executable>cleartool.exe</executable>
<timeout>50000</timeout>
</sourcecontrol>
</project>
</cruisecontrol>
Thank you.
I have no direct experience with this kind of setup, but if you are using the <projectVobName> tag, that means:
you are declaring a pvob (project vob used only in UCM to store project, stream, activities and components, all UCM data)
your view (with the root directory referenced in <viewPath>) must be an UCM view.
All the other path elements (like 'executable') should reference an absolute path (and not just "cleartool.exe")

Resources