java.net.MalformedURLException: no protocol: and]

Had a problem with injecting JMSFactory for JBoss MQ using spring(for Camel :)). The problem had the next StackTrace: Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: and] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:780) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) I was sure I configured it right as I have <jee:jndi-lookup id="JBossMQ" jndi-name="XAConnectionFactory" proxy-interface="javax.jms.ConnectionFactory" environment-ref="jndiProps" resource-ref="true"/> <util:properties id="jndiProps" location="META-INF/spring/jndi....

09/06/2011 · 1 min · Viktor Halitsyn

j2ee sdk install hanging fix.

Spent about 3 hours trying to install the latest java ee sdk on my natty narwhal with no luck. It usually hang with 45% and 5seconds left forever. Might be I’m a bad googler but turned out that there is a bug in the installer which prevents the installation from continuing. The workaround is to disable the network connections before the installation begins(disabling while it is hanging did not work for me)....

06/01/2011 · 1 min · Viktor Halitsyn

Java to BlazeDS NAN in double values.

Internet is basically full of subj but vice-versa(BlazeDS to java). So the problem I had was that when the object is “translated” from java via BlazeDS to flex application it had NAN’s in the double fields. The transfer object was a simple POJO I passed via the interface. First thing I checked were the getters – all present and valid. I took quite a lot of time till we figured out that it was the missing setters which made the code malfunction....

04/22/2011 · 1 min · Viktor Halitsyn

String.split() VS String.startsWith() VS Regex simple performance comparison.

Now really, what would be faster/more reliable for a typical not so complicated and not over-simple case? Yes the one we tend to deal with in our day-to-day work? For those impatient benchmarks are here.Reading a 100/1000-line file is not fun and I really think you shouldn’t bother choosing if you’re dealing with such volumes of data. But if you have to parse 320k-500k records lines, which, in fact, is not that large – 320k of CSV data is ~ 12MB performance is considerable....

04/19/2011 · 6 min · Viktor Halitsyn

org.springframework.oxm.jaxb.Jaxb2Marshaller

There is a nice tutorial here on how to create spring web services using jax-b. Works just fine but it’s hell lots of issues you would run into while making it actually work. The most frustrating for me as of today was the absence of Jaxb2Marshaller. in the std “spring-ws-core” artifact package. It’s just not there and noone would tell you. Only _**Jaxb1Marshaller **_is. After an hour googling found this (BTW very simple and straightforward) post where spotted the “spring-oxm-tiger” artifact....

09/29/2010 · 1 min · Viktor Halitsyn

Switching to container based datasource…

Quite a time ago had to do this but had no time for posting a complete solution. Read a few articles on that so that I got the idea. Although it looks quite simple you might run into several configuration issues firing weird and long stacktraces. To get rid of those I&#8217;ll describe the way it worked for me with some additional comments. First of all lets assume we use JBoss app server....

01/11/2010 · 2 min · Viktor Halitsyn

BlackBerry invokeLater and Multimedia.

Recently had an issue in the BlackBerry Java application: it was reported to crash if the sounds were on and played often. However it didn’t crash if sounds were played once in a while. After some investigation it turned out that there are no memory leaks but some thing blocked the event dispatch queue. I asked for help on Stack Overflow and BlackBerry developer forums but that didn’t lead me anywhere except that I thought that something definitely gets locked....

09/23/2009 · 2 min · Viktor Halitsyn

Java sdk is hacking Window… :)

Everybody knows of such a nice tool developed by our precious Google as Google Search. Recently I conducted a search on my computer for a simple word ‘Hack’. I was impressed by the results: the word is mostly used in … !!!Java sdk!!! – try it out. I saw also some Visusal Studio files and some more but… I the Sun guys need to hack Windows in orde to get things done… no fursther comments…...

04/12/2009 · 4 min · Viktor Halitsyn

J2ME radio lists trouble

Recently I needed to do a simple task – implement a radio button list with choices under J2ME MIDP 2.0. I started with creating an new view of type javax.microedition.lcdui.List, keeping in mind that I can just construct it with List.EXCLUSIVE and add whatever items i want and everything should work fine. Well almost… All looked nice and the items showed up very attractively, having transparency and current font set up by default, which looked quite impressive....

03/19/2009 · 2 min · Viktor Halitsyn

Trying out Google base

Subj is only at beta but is really nice! Though not very complicated and lots of info on google sites i found it still quite time consuming to write a single posting app… But when finished everything looked very nice! class Program { const string GOOGLE_LOGIN_SECTION = "googleLogin"; const string BATCH_COUNT_SETTING = "batchCount"; const string CHECK_EXISTANCE_SETTING = "checkExistance"; const string MyItem_ITEMTYPE_SETTING = "MyItemItemType"; const string MyDB_CONNECTION_STRING = "MyDBConnectionString"; static void Main(string[] args) { string appNameG = Utils....

06/10/2008 · 3 min · Viktor Halitsyn