Not able to read Japanese File Name inside the Spring Controller - spring

Not able to read the file if the filename contains Japanese Characters inside Spring Controller and it is deployed in tomcat7 server and have the printed the path in print statement shows Quest Mark[enter image description here][1].
Added the URI Encoding="UTF-8" in tomcat server.xml and specified in the catalina.sh file
[enter image description here][2] change also done web.xml file character encoding filter has been set in that still have the same issue.
Note :
But able to read the Japanese Filename in normal core Java Application it is working.

The issue exists with Tomcat7.0.54.
It got fixed in Tomcat7.0.109

Related

How to upload to SFTP user's Home directory using Spring Integration

I'm trying to upload a file via SFTP using Spring Integration (version 4.1.2).
Does anyone know how to configure the sftp:outbound-channel-adapter so that the file gets uploaded automatically to user's home directory without indicating the full directory path in the remote-directory's attribute (ex: remote-directory="/home/sftp_user")?
The solution is that the remote-directory must be set as an empty string.
Please note that the following won't work as it fails the XML model validation:
<sftp:outbound-channel-adapter
...
remote-directory=""
...
/>
I ended up reading the remote-directory from a configuration property which I set as an empty string.

Loading multiple config file from spring cloud config server

Hey I got to know how to check properties in config server i.e. http://{Config server URL}:{Port}/{ServiceID}/{Profile}
Right now I am facing a problem where I've to read multiple properties file from cloud config server. Ex: Right now I've to read properties file(huge file) from a single property file i.e. employee.properties
I don't want huge list of properties file in single folder. like
employee-dev.properties
employee-dit.properties
employee-sit.properties
employee-uat.properties
employee-preprod.properties
employee-prod.properties
customers-dev.properties
customers-dit.properties
customers-sit.properties
customers-uat.properties
customers-preprod.properties
customers-prod.properties
.
.
.
and soo on.
My requirement is I need to maitain a list of properties file and config server will provide me these values. like :
**{env}/employee.properties**
**{env}/customers.properties**
Here env could be any environment like dit, sit, prod etc.
Hope I'll get answer here.
If you don't want to have all properties files in an only folder, so you need to add this configuration on config server properties file.
1. Match all options
spring.cloud.config.server.native.searchLocations = [classpath:/, classpath:/config, classpath:/config/{application}, classpath:/config/{application}/{profile}]
2. Match only /application-name/application-name-profile.properties
spring.cloud.config.server.native.searchLocations = classpath:config/{application}
Then you'll have matched based on application name folder for example.
resources/config/application-name/application-name-properties.

NXlog will not start - AlienVault Config

I am trying to configure NXlog to work with AlienVault based on the guide here
I installed the custom config file from AlienVault and modified the destination IP only. When I did this I could not get the NXlog service to start - Then I reinstalled the default config but I still cannot get it to open.
I edited the file in notepad which I thing should be safe, however I have read here that it is possibly the UTF-8 BOM - I am not sure how to check if there is one but I do not believe there is because I only used notepad.
The first line in the config file looks like so:
define ROOT C:\Program Files (x86)\nxlog
The NXlog Log file with the errors is only displaying this error:
nxlog failed to start: Invalid keyword: define at C:\Program Files (x86)\nxlog\conf\nxlog.conf:1
Not very helpful - Seems to be choking on the very first word - Anyone seen this before???
I'm pretty sure that's caused by the UTF-8 BOM in your config file. I suggest using and checking with an editor that can handle this. In HEX mode you can confirm whether the file has a BOM or not.
The NXLog EE v4.0 can cope with the BOM properly BTW.
As B0ti mentioned, my problem was caused by the BOM - I couldn't figure out how to fix this on windows so I downloaded the file into a Linux environment and fixed it there. To do so follow these steps -
First I verified there was a BOM in place with the file command:
ex: file filename.txt -This will print information about the file - if there is a BOM you will see that.
Next I followed the answer here for removing the BOM:
Basically just do this in the Linux box - sed '1s/^\xEF\xBB\xBF//' < orig.txt > new.txt
Then I transferred the new file back to the Windows box and all was right with the world!

Sketchup ruby definitionlist load method error: Invalid component file

When I create a script file and load it from the console with:
load '//192.168.0.0/Mağaza/script.rb'
I get 'Invalid component file' error for:
someModel = Sketchup.active_model.definitions.load '//192.168.0.0/Mağaza/Definitions/model.skp'
But when running the code directly in console, it works.
Any idea why?
DefinitionList.load is a completely different method from Ruby's load.
To load a component from a URL you need to use model.definitions.load_from_url:
http://www.sketchup.com/intl/en/developer/docs/ourdoc/definitionlist#load_from_url
After two days, I figured out that the problem was the encoding of 'ğ' in the folder name (mağaza). I tried ANSI and UTF-8 encoding in my script file but nothing changed. But when print the path name in the console, it turned out that the character was not encoding properly.

Where should jpos.xml be located for JavaPos Tomcat app.?

I am trying to add in a new driver to our system running under Tomcat. The vendor has provided a JavaPos driver, my question is where to put the jpos.xml file so Tomcat can find it?
I tried putting it in tomcat\common\classes but still get a JPOSException
"Service does not exist in loaded JCL registry" when I try to open it. Help!
Yes correct, JavaPOS. I'm integrating JavaPos into an existing client side Tomcat app., and would like to know the correct place (in the expanded war file) to put jpos.xml and also jpos.properties.
Thanks a lot, fred.
I Don't know if this would help a five year old question!
/*
* If you want to place the jpos.xml file elsewhere on your local file
* system then uncomment the following line and specify the full path to
* jpos.xml.
*
* If you want to place the jpos.xml file on a webserver for access over the
* internet then uncomment the second System.setProperty line below and
* specify the full URL to jpos.xml.
*/
System.setProperty( JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME, "jpos.xml" );
//System.setProperty(JposPropertiesConst.JPOS_POPULATOR_FILE_URL_PROP_NAME, "http://some-where-remote.com/jpos.xml");
System.setProperty("jpos.loader.serviceManagerClass", "jpos.loader.simple.SimpleServiceManager");
System.setProperty("jpos.util.tracing.TurnOnNamedTracers", "JposServiceLoader,SimpleEntryRegistry,SimpleRegPopulator,XercesRegPopulator");
System.setProperty("jpos.util.tracing.TurnOnAllNamedTracers", "ON");
I think you are talking about JavaPOS, not jPOS?

Resources