a cup of java

Here’s your cup of hot java & web 2.0 cookies. Enjoy it.

Archive for the ‘Hug the bug !’ Category

A JBoss 5.1.0 Exception !

without comments

jbosscorp_logo

This is about another exception you may get while playing around with JBoss, Transactions, Remote EJBs etc. And the exception is:

org.jboss.resource.JBossResourceException:
Could not enlist in transaction on entering meta-aware object!

My friend Venu had a post in his blog on why this exception happens and how to fix it in JBoss 5.0. You can read it here. But if we are using JBoss 5.1.0 this solution cannot help us. Because there are a couple of changes in the configuration in this new version of JBoss. In fact if you can take a look at the JBoss 5.1.0 GA release notes we can see a lot of changes in configuration especially if we are migrating from JBoss 5.0 to 5.1.

And here is the solution.

Open the JBOSS_HOME/server/JBOSS_CONFIGURATION/conf/jbossts-properties.xml. Set the following.

<!-- Support subtransactions in the JTA layer? Default is NO. -->
<property name="com.arjuna.ats.jta.supportSubtransactions" value="YES"/>

Hope this helps.

P.S. If you have any more details in this issue, please feel free to share it. Thank you.

Written by Subinkrishna G

June 18, 2009 at 11:55 am

Today’s read: Web usabilty

without comments

Smashing Magazine

I have always been a big fan of web design & web usability. I found a nice article in Smashing Magazine by Dmitry Fadeyev. Its all about some common usability mistake we do.

By now, all good designers and developers realize the importance of usability for their work. Usable websites offer great user experiences, and great user experiences lead to happy customers. Delight and satisfy your visitors, rather than frustrate and annoy them, with smart design decisions. Here are 9 usability problems that websites commonly face, and some recommended solutions for each of them.

Read the article (9 Common Usability Mistakes)

Related links on usability
10 Usability Nightmaters That You Should Avoid
30 Usability Issues To Be Aware Of
12 Useful Techniques For Good Interface Design

About the author

usabilitypost_smallDmitry Fadeyev is the founder of the Usability Post blog, where you can read his thoughts on good design and usability.

Follow Dmitry on Twitter @usabilitypost.

Have a nice read.

Written by Subinkrishna G

February 19, 2009 at 10:27 am

Tip: How to handle broken images in HTML

with 2 comments

I found this small but very good article in phpied.com by Stoyan StefanovTwitter page. The article tells about handling broken images in a web page, especially when we dont have control over what we load in our page.

I know, you don’t have broken images on your site, it’s unprofessional and ugly. But sometimes you may be loading images that you don’t control and you never know what’s going on on the other server you’re expecting to serve, but it may not feel up to the task.

One nice and simple strategy to deal with this uncertainty is to hide the images that fail to load. Browsers sent an “error” event when the worst happens and an image fails for whatever reason. Subscribe to this event using your favorite event-listener-attaching approach or library and hide the image.

The solution is very simple.

<img src="broken.png"
  onerror="this.style.display='none'"
/>

Read the article here

Written by Subinkrishna G

February 16, 2009 at 3:28 pm

Another JBoss 5 hack by Venu

without comments

jbosscorp_logo

Venu had another JBoss hack and he was able to fix one more issue that may bubble up during the migration from JBoss 4.x to 5. This time found out how solve “Adding multiple last resources is disallowed. Current resource is ….” exception which happens while trying to access an EJB from a different EAR with in a transaction and trying to commit that transaction.

Read the article here

Written by Subinkrishna G

February 11, 2009 at 4:22 pm

A Jboss 5 issue

with 2 comments

jbosscorp_logo

Me and my colleague Venu were working on some Jboss 5 stuff  (infact migrating from Jboss 4 to 5) when we got the following exception.

Exception:

ERROR [my.package.name] doSomething() Ex: javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = -3758782076801249473, local class serialVersionUID = 337700910587744646]

javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = -3758782076801249473, local class serialVersionUID = 337700910587744646]

at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:725)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:590)
at javax.naming.InitialContext.lookup(InitialContext.java:351)

.. .. ..

Caused by: java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = -3758782076801249473, local class serialVersionUID = 337700910587744646

at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)

We are trying to connect to another server which is running on Jboss 4 and trying to access a remote EJB (session bean). Till now I’ve no clear idea about this whole issue. If any of you can put some light to this issue, please.

I will update this place once we tackle the issue.

Update 1:
I found some useful information here: https://jira.jboss.org/jira/browse/EJBTHREE-749

The problem seems to be mismatching SerialVersionUID in org.jboss.ejb3.remoting.IsLocalInterceptor of  jboss-ejb3-client.jar.

Update 2: 28-Jan-2009
This issue has been fixed from Jboss-4.2.2 GA onwards. So all those who are using versions lesser than 4.2.2 are more likely to get this issue.

Find the JIRA post by Venu here: https://jira.jboss.org/jira/browse/EJBTHREE-1696

Written by Subinkrishna G

January 22, 2009 at 5:02 pm