Main BLOGGER
Google
WWW THIS BLOG
Tuesday, August 30, 2005
 
APEA/MCWS implementation
1. porting JWSDP web service to Sun AppServer
2. Useing JAXRPC document/literal WSDL
http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index.html
3. Translation Service by Java
4. Keep .NET solution and test
5. Add gSOAP MCWS
- C++ reflection
6. X# schema
7. C-- gramma

Wednesday, August 24, 2005
 
versioning HLD
1. Design IDL for version functions which are used by SD, SSM, SIM to check version compatibility.

2. Use callgen to generate marshal and un-marshal code with the version class. see ssm frontend for how to use user defined class as parameters in IDL functions.

3. Augment SSM, SIM, SI to check version before registration.
SIM-->SSM, SI-->SIM

4. Definition of Class Version
{
}

function checkVersion(Version versionInfo);

5. Single entry for version stuff, i.e., version info is hard coded for SD, SSM, SIM, SI. For windows, we have resource file to display version info. Version checking needs the version info. Ideally, they could be handled in one single place.

Wednesday, August 17, 2005
 
A trivial log4cxx tutorial
1. Create a new win32 VC++ project
2. "Property Pages" -- "C/C++" -- "General" --
"Additional Include Directories"="..\log4cxx-0.9.7\include;"
3. "Property Pages" -- "Linker" -- "General" --
"Additional Library Directories"="..\log4cxx-0.9.7\msvc\lib\debug;"
3. "Property Pages" -- "Linker" -- "Input" --
"Additional Dependencies"="log4cxx.lib"


-----------------------------------------------
Change log4j properties on the fly

#include <stdlib.h>
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/ndc.h>
#include <log4cxx/consoleappender.h>
#include <log4cxx/patternlayout.h>

using namespace log4cxx;
using namespace log4cxx::helpers;
int main()
{
int result = EXIT_SUCCESS;
try
{
PatternLayoutPtr myLayoutPtr = new PatternLayout("%r [%t] %-5p %c- %m%n %x");
//%x means to print context info stored in NDC
ConsoleAppenderPtr myAppenderPtr = new ConsoleAppender(myLayoutPtr);
BasicConfigurator::configure(myAppenderPtr);
LoggerPtr rootLogger = Logger::getRootLogger();

NDC::push(_T("context\n"));
LOG4CXX_DEBUG(rootLogger,_T("debug "));
LOG4CXX_INFO(rootLogger,_T("info "));
LOG4CXX_WARN(rootLogger,_T("warn "));
LOG4CXX_ERROR(rootLogger,_T("error "));
LOG4CXX_FATAL(rootLogger,_T("fatal "));
NDC::pop();

myLayoutPtr->setConversionPattern("%-5p [%t]: %m %n");
//change the pattern
rootLogger->setLevel(log4cxx::Level::ERROR);
//change the log level
LOG4CXX_DEBUG(rootLogger,_T("debug "));
LOG4CXX_INFO(rootLogger,_T("info "));
LOG4CXX_WARN(rootLogger,_T("warn "));
LOG4CXX_ERROR(rootLogger,_T("error "));
LOG4CXX_FATAL(rootLogger,_T("fatal "));

}
catch(Exception&)
{
result = EXIT_FAILURE;
}

return result;
}

Sample output:

50 [804] DEBUG root- debug
context
50 [804] INFO root- info
context
50 [804] WARN root- warn
context
50 [804] ERROR root- error
context
50 [804] FATAL root- fatal
context
ERROR [804]: error
FATAL [804]: fatal


-----------------------------------------------


#include < stdlib.h>

#include <log4cxx/logger.h>

#include <log4cxx/basicconfigurator.h>

#include <log4cxx/helpers/exception.h>

#include <log4cxx/helpers/exception.h>

#include <log4cxx/helpers/stringhelper.h>

#include <log4cxx/propertyconfigurator.h>

#include <log4cxx/helpers/exception.h>

#include <log4cxx/ndc.h>

#include <log4cxx/level.h>



using namespace log4cxx;
using namespace log4cxx::helpers;

int main()
{
int result = EXIT_SUCCESS;
enum {LOG4CXX_POLL_INTERVAL = 60, };
const char* LOG4CXX_PROPERTY_FILE =
"C://3rd//log4cxx-0.9.7//msvc//examples//sd.log4j.properties";
try
{
// if we do not specify the log4j properties file, we must use
// BasicConfigurator::configure();
// else we pass in the file name with path and watch time

//
log4cxx::PropertyConfigurator::configureAndWatch(
LOG4CXX_PROPERTY_FILE,
LOG4CXX_POLL_INTERVAL);
// a thread will be created that will periodically
// check if the LOG4CXX_PROPERTY_FILE has been created or
// modified. The period is determined by the LOG4CXX_POLL_INTERVAL
// argument in seconds. If a change or file creation is detected, then
// LOG4CXX_PROPERTY_FILE is read to configure log4j.

LoggerPtr rootLogger = Logger::getLogger("sd");

// get the logger setting by name "sd"

NDC::push(_T("trivial context"));
// NDC (nested diagnostic context) for multithread logging purpose

while(1==1)
{
rootLogger->debug(_T("debug message"));
rootLogger->info(_T("info message"));
rootLogger->warn(_T("warn message"));
rootLogger->error(_T("error message"));
rootLogger->fatal(_T("fatal message"));
}
}
catch(Exception&)
{
result = EXIT_FAILURE;
}

return result;
}
-------------sample sd.log4j.properties file ---------------

log4j.rootLogger=INFO, stdout, SD
^^^^
change here to [ALL| OFF|DEBUG|INFO|WARN|ERROR|FATAL]

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] (%F:%L) - %m%n

log4j.appender.SD=org.apache.log4j.RollingFileAppender

#specify log file
log4j.appender.SD.File=../logs/sd.log
log4j.appender.SD.MaxFileSize=100000KB

# Keep one backup file
log4j.appender.SD.MaxBackupIndex=1
log4j.appender.SD.layout=org.apache.log4j.PatternLayout
log4j.appender.SD.layout.ConversionPattern=%d %p [%t] %c - %m%n

Monday, August 15, 2005
 
Tutorial for J2EE tutorial 1.4
1. Download the tutorial from http://java.sun.com/j2ee/1.4/download-docs.html

2. Unzip it to C:\Sun (already install Sun Application Server to C:\Sun)

3. modifty "C:\Sun\j2eetutorial14\examples\common\build.property"
-----------------------------------------
j2ee.home=C:/Sun/AppServer
j2ee.tutorial.home=C:/Sun/j2eetutorial14
...
-----------------------------------------

4. modify "C:\Sun\j2eetutorial14\examples\common\admin-password.txt"
-----------------------------------------
AS_ADMIN_PASSWORD=
88888888
-----------------------------------------

5. modify "C:\Sun\j2eetutorial14\examples\jaxrpc\helloservice\build.property"
-----------------------------------------
example=helloservice
wsdl.file=MyHelloService.wsdl
war.file=hello-jaxrpc.war
config.interface.file=config-interface.xml
mapping.file=mapping.xml
context.path=hello-jaxrpc
-----------------------------------------

6. run "asant build; asant create-war; asant deploy" in "C:\Sun\j2eetutorial14\examples\jaxrpc\helloservice\"

7. modifty ""C:\Sun\j2eetutorial14\examples\jaxrpc\staticstub\build.property"
--------------------------------------
example=staticstub
client.class=${example}.HelloClient
endpoint.address=${hello.endpoint}
client.jar=client.jar
context.path=hello-jaxrpc
url.pattern=/hello
config.wsdl.file=config-wsdl.xml
--------------------------------------

8. run "asant build; asant run" in
"C:\Sun\j2eetutorial14\examples\jaxrpc\staticstub\"

9. create .NET web service client

9.1 New a C# console application, add "web reference" JWSHello with URL
http://localhost:8080/hello-jaxrpc/hello?WSDL
9.2 in main, add
JWSHello.MyHelloService service=new JWSHello.MyHelloService();
System.Console.Write(service.sayHello("Pop"));
9.3 build and run


Note:
run "asant listprops; asant listprops-jaxrpc;" to check if the environment is set properly

Wednesday, August 10, 2005
 
SOAM building environment
Official build machine
1. Linux 2.6 (kernel) glibc 2.3
ibm02
[puliu@ibm02 ~]$ rpm -q glibc
glibc-2.3.4-2
[puliu@ibm02 ~]$ cat /proc/version
Linux version 2.6.9-5.ELsmp (bhcompile@decompose.build.redhat.com) (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 5 19:30:39 EST 2005

In Make.def
-----------------
LINK_LIBC = /lib/libgcc_s.so.1
LINK_LIBS = /usr/lib/libstdc++.so.6
CRYPTLIB = /usr/lib/libcrypt.a
----------------------

For SuSE9, using rms0 (zero)

2. Linux 2.4 (kernel) glibc 2.2
caro
[puliu@caro ~]$ rpm -q glibc
glibc-2.2.4-13
[puliu@caro ~]$ cat /proc/version
Linux version 2.4.7-10 (bhcompile@stripples.devel.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)) #1 Thu Sep 6 17:27:27 EDT 2001
In Make.def
-----------------
LINK_LIBC = /opt/redhat/comp-tools-3.2/lib/libgcc_s.so.1
LINK_LIBS = /opt/redhat/comp-tools-3.2/lib/libstdc++.so.5
-----------------


Machines
4 dedicated window/linux hosts
ib04b11(RHEL 4.0/W2K03) dual-cpu,
ib04b13(RHEL 4.0/W2K03) single-cpu,
ib04b06(RHEL 4.0/W2K03) dual-cpu,
ib04b14(RHEL 4.0/W2K03) dual-cpu,

share 13 Linux machines with other Sym DEV teams
qa1 (RH 7.2),
qa2(RH 7.2) ,
qa3(RHEL AS2.1),
qa4(RHEL AS2.1),
qa5(RHEL 3.0),
qa6(RH 3.0),
qa11(RHEL AS2.1),
qa12(RHEL AS2.1),
u55(RHEL AS2.1)
hb01b20(RHEL 3.0),
hb01b19(RHEL 3.0),
hb01b18(RHEL 3.0),
hb01b17(RHEL 3.0)

Sunday, August 07, 2005
 
IBM 2005 North American Grid Scholars Challenge
URL

The judges John Hurley of Boeing, David Snelling of Fujitsu and Jean Pierre Prost and David Kra of IBM selected three winners from the 20 entries. There were more than 100 registered participants, including 17 student teams across 45 universities in the United States and Canada.

1 st place : Pu Liu, SUNY Binghamton, proposed the enablement of Web Service containers to accept new mobile code on the fly, and to run it within the containers, providing direct local access to the containers' other services.

Liu describes the idea: "This solves the problem rooted in the fact that different Web Services containers are implemented in different programming languages, with different constraints and requirements placed on the programmer; and client side programmers must use the Web Service interface specified by the service developer. Therefore, the kinds of applications and uses for a Web Service are unnecessarily restrictive, constrained by the granularity of access defined by the interface and by the characteristics of the service functions".

"Clients will be able to customize Web Services by our mobile code enabled Web Services. It brings more flexible, more efficient Web Services. We can expect simple and complete interfaces in mobile code enabled Web Services, which are desirable in system design. Due to the flexibility, it will also release theburden of designing ne for all' interfaces from services providers. Via customization, services providers can deliver Web Services with different QoS to meet variable clients' requirements." [ Read the full essay ]

Liu will receive a ThinkPad T Series laptop and his university will receive an IBM eServer Cluster 1350.

"The winning entry was creative and thought through; it had POTENTIAL RELEVANCE and APPLICABILITY to a real world problem. It spoke of issues that are real issues for those of us in the trenches. Its proposal was relevant and thought-provoking," explained Hurley.



Powered by Blogger

Google
WWW THIS BLOG