Marketplace for Content, Tests and Assessment
 
 

Archive

Archive for the ‘Programming / tutorials’ Category

Cloud computing with Google App Engine and Amazon EC2

September 2nd, 2010 Vinay No comments

Courtesy NEJUG and Oracle, on 9th Sep Rohit Bhardwaj is presenting on Cloud computing deep dive for Google App Engine and Amazon EC2 at Oracle technology Center, Burlington , MA

Presentation Overview:

In this session users will take a deep dive at few cloud computing examples and participants will be able to know how to use cloud computing for Google App Engine and Amazon EC2.

The Google App Engine is a platform for developing and hosting web applications in Google-managed data centers. The Google App Engine is an example of cloud computing technology as it virtualizes applications across multiple servers and data centers. It is, at its heart, a powerful cloud computing platform designed to help you more easily create and manage scalable, JVM-based web applications. If you’re developing a Java application on App Engine you probably already know that you can use JPA and JDO Java persistence APIs to interact with the data store. Now learn how to take full advantage of these powerful APIs. We will explore few examples from Amazon EC2 like how to deploy groovy on grails application. We will also look at development tools to make your life easier while working with Amazon EC2, Amazon S3 and Simple db.

Button not disabled in Firefox and Chrome

August 29th, 2010 Vinay 2 comments

When you try to disable any button in your web application using this javascript function

document.getElementById(‘buttonId’).disabled=true;

You may find that it will work in IE but on Firefox and Chrome.

Reason:

From W3Scholl,

“Enabled” Property isn’t standard property of XHTML 4(It’s Microsoft standard.).

So the solution would be to add this piece of code

var obj = document.getElementById(‘buttonId”);
getLabel = function(elem){
if (elem.id && elem.id==”label”) {
elem.id = “disabledLabel”;
}
};
Dom.getElementsBy(getLabel ,’td’, obj);

When to use saveOrUpdate in hibernate

August 25th, 2010 Vinay No comments

In our earlier post we had covered what exactly saveorUpdate in hibernate does.

Developers that are new to Hibernate constantly calling the saveOrUpdate method whenever a set of changes have been made to a POJO. This isn’t necessary. You only have to associate an instance with the Hibernate Session once within the scope of a transaction. From that point on, you can do whatever you want to your JavaBean instances. Hibernate will persist the final state of your instance when the current transaction is finally committed.

The following piece of code needlessly calls the saveOrUpdate method after instance variables have been updated. This is totally unnecessary, as the User instance was already associated with the Hibernate Session through the original call to saveOrUpdate. Read more…

How do you compare static and Dynamic Queue in EMS

August 24th, 2010 jaya No comments

Configuration information for static queues and topics is stored in configuration files for the TIBCO Enterprise Message Service server. Changes to the configuration information can be made in a variety of ways. To manage static destinations, you can edit the configuration files using a text editor, you can use the administration tool, or you can use the administration APIs. Static queues and topics are administered by the server. Clients retrieve the destination using JNDI.

Dynamic queues and topics are created on-the-fly by applications using QueueSession.createQueue() and TopicSession.createTopic(). Dynamic queues and topics do not appear in the configuration files, and exist as long as there are messages or consumers on the destination. A client cannot use JNDI to lookup dynamic queues and topics.

Categories: Programming / tutorials Tags:

IE7 ignores table width

August 23rd, 2010 Vinay No comments

There has been a problem in using table width in IE7.

The pre tags in IE 7 do wrap the text but the table width will remain wider and scrollbar appears, as if the text is taking full space. This problem doesn’t come in Firefox and Chrome. Can anyone help me out defining proper style for IE 7 for pre tags. for eg of you look at this code

<html>
 <style type="text/css">
<!--

pre {
 overflow:wrap;
width: 600px;
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
 display: block;
}
-->
</style>
<body>
<table width="70%" border="1">
 <tr> <td width="100%">
<pre> This is sample long text only to test IE 7 table width and it should be wrapping around but that does not happen . So we will have to find a solution </pte>
</td> </tr> </table>
</body>
</html>

You would not face this problem in Firefox or IE8.  It only happens with IE.

Solution : Use  table-layout: fixed;

If you apply the table-layout:fixed style for the inner table, where the data is in different columns, all columns get same area irrespective of their defined width.  But if applied it to the outer table, and it works fine.

Categories: Programming / tutorials Tags: , ,

What is TIBCO hawk

August 22nd, 2010 jaya No comments

TIBCO Hawk is a sophisticated tool for enterprise-wide monitoring and managing of all distributed applications and systems. System administrators can use it to monitor adapters in a wide area network of any size. TIBCO Hawk can be configured to monitor system and adapter parameters and to take actions when predefined conditions occur. These actions include: sending alarms that are graphically displayed in the TIBCO Hawk display, sending email, paging, running executables, or modifying the behavior of a managed adapter.

Unlike other monitoring applications, TIBCO Hawk relies on a purely distributed intelligent agent architecture using publish or subscribe to distribute alerts. TIBCO Hawk uses TIBCO Rendezvous for all messaging and thus gains the benefits and scalability from the TIBCO Rendezvous features of publish/subscribe, subject name addressing, interest-based routing, and reliable multicast. Read more…

Categories: Programming / tutorials Tags:

Tomcat 6.0.26 shutdown reports “A web application created a ThreadLocal …. ThreadLocal has been forcibly removed”

August 22nd, 2010 Vinay No comments

This problem happened with an JSF , Hibernate and rich faces application which was running on tomcat 6.0.14 version and Jdk1.6.0 . When upgraded to Tomcat 6.0.26 and JDK 1.6.0-19, it started behaving strangely.

The jsf messages were displayed as html  and looked as the servver was not parsing them.

for eg {userbean.errorMessage} started showing on pages.

After much analysis it was found that this problem is because of tomcat upgrade.  Why is this problem ?

From the documentation

For the #{} expressions to be recognized in Tomcat 6, your web application must adhere to the Servlet 2.5 specification. Make sure, that version and xsi:schemaLocation attributes of element in your WEB-INF/web.xml file have the correct values. You can look into conf/web.xml or into the examples application for an example.
In the versions 6.0.24 and earlier the deferred expressions were processed regardless of the specification version specified in web.xml. That was changed/fixed in 6.0.26.

Below is solution

Changed

<?xml version=’1.0′ encoding=’UTF-8′?>
<!DOCTYPE web-app PUBLIC
“-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”
“http://java.sun.com/dtd/web-app_2_3.dtd”>
<web-app>

……………..

to

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns=”http://java.sun.com/xml/ns/javaee”
xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
id=”WebApp_ID”
version=”2.5″>

…………………

remove these if they exist in your web.xml

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/jsf_core.tld</taglib-uri>
<taglib-location>/WEB-INF/jsf_core.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/html_basic.tld</taglib-uri>
<taglib-location>/WEB-INF/html_basic.tld</taglib-location>
</taglib>

If this was helpful , please add comment below

Categories: Programming / tutorials Tags: ,

What is TIBCO ?

August 19th, 2010 jaya No comments

TIBCO provides a common framework for integrating incompatible and distributed systems – making it faster and easier to tie together applications and Web Services so you can integrate them into business processes that span your organization. TIBCO reduces the complexity of your IT infrastructure and dramatically improves its reliability, flexibility and scalability – giving you the ability to focus on improving how your business runs instead of worrying about whether or not your infrastructure will be scalable or flexible enough to support new initiatives or capitalize on perpetual shifts in the market.

TIBCO’s EAI(Enterprise application integration) software lets your applications, databases and mainframes communicate and interact with each other by automatically routing and transforming information so it gets where it needs to be, when it needs to be there, and in the proper format. TIBCO’s EAI software lets you integrate your business using the best available approach for your specific situation – whether that is an industry-standard technology such as Java, XML, or Web

TIBCO Software Inc. is a global software company, with headquarters in Palo Alto, California. They provide business integration software to integrate, manage, and monitor enterprise applications and information delivery. Their software products include applications for coordinating business process and activites, securely exchanging information with trading partners, creating and maintaining XML documents, and managing distributed systems. Their software products is also called by the name TIBCO, which include a set of products. It may be defined as below   Read more…

Categories: Programming / tutorials Tags:
Get Adobe Flash playerPlugin by wpburn.com wordpress themes