Monday, October 6, 2008

http://localhost:8080/WebContent/messagebroker/amf


[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:218]
at mx.rpc::Responder/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at mx.messaging::ChannelSet/faultPendingSends()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
at mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\Channel.as:997]
at mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:354]
at mx.messaging.channels::AMFChannel/statusHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:390]


Solution:

To resolve, change the serverContextRoot to point to your Project name instead of WebContent folder.

Here how it is done in .flexProperties file created by eclipse

serverContextRoot="/WebContent"

change this to

serverContextRoot="/your project name"

Thursday, May 15, 2008

Java Design Patterns

Some good web sites about Java Design patterns:

http://www.fluffycat.com/Java-Design-Patterns/

http://www.javacamp.org/designPattern/

Tuesday, May 6, 2008

Currently doing research on oBIX & Tridium

Currently doing some research into oBIX and how it could be implemented in Tridium Niagara Framework.


oBIX (Open Building Information Xchange) is a focused effort by industry leaders and associations working toward creating a standard XML and Web Services guideline to facilitate the exchange of information between intelligent buildings, enable enterprise application integration and bring forth true systems integration. Based on Standards widely used by the IT Industry, the oBIX guideline will improve operational effectiveness giving facility managers and building owners increased knowledge and control of their properties. Comprised of representatives from the entire spectrum of the buildings systems industry, oBIX includes professionals from the security, HVAC, building automation, open protocol and IT disciplines.

Resources:
http://www.obix.org/

A Beginner's Guide to oBIX (even if you're not a developer!)
http://www.niagara-central.com/ord?portal:/blog/Blog/17
This is 6 parts series explaining how oBIX can be used in Tridium Niagara Framework.

http://www.tridium.com/

Monday, April 21, 2008

Tuesday, April 15, 2008

Useful Javascript functions

#function to check a field is empty or not.

function isEmpty(fieldName){
/*
* This method will return true if the field is empty and return
* false if it is not empty.
*/
emptyFlag = true;
if (fieldName.value == ''){ //to check the given value is empty or not
return true;
}
else{
for(i=0;i<(fieldName.value).length;i++)
{
if((fieldName.value).charAt(i)!=''){
emptyFlag = false;
break;
}
}
return emptyFlag;
}
}



#Today's date


var date = new Date();
var d = date.getDate();
var m = date.getMonth() + 1;
var yy = date.getYear();

var day = (d < 10) ? '0' + d : d;
var month = (m < 10) ? '0' + m : m;
var year = (yy < 1000) ? yy + 1900 : yy;

//put the day, month and year in whatever format you require.

var todayDt = year+"-"+month+"-"+day

document.write(todayDt);

Friday, April 11, 2008

Retrieving website content with Java

A simple program to retrieve any website content to a file.


import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class WebContent
{
URL url = null;
URLConnection urlConn = null;
BufferedReader br = null;

public WebContent(String urlStr)
{
try
{

if (urlStr != null)
{
url = new URL(urlStr);
urlConn = url.openConnection();
br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String line = null;
StringBuffer sbf = new StringBuffer();
File outFile = new File("out.txt");
FileWriter fw = new FileWriter(outFile);
while ((line = br.readLine()) != null)
{
fw.write(line);
fw.write("\n");

}
}
}
catch (MalformedURLException mue)
{
System.out.println("mue = " + mue.getMessage());
}
catch (IOException ioe)
{
System.out.println("ioe = " + ioe.getMessage());
}
finally
{
if (br != null)
{
try
{
br.close();
}
catch (IOException ioe)
{

}
}
}
}
public static void main(String args[])
{

try
{

WebContent webObj = new WebContent("http://www.yahoo.com");
}
catch (Exception e)
{
e.printStackTrace();
}
}

}

Nothing to say ..

Nothing to start with, still thinking on to what to publish..