Friday, October 27, 2006

create complex (semantic web) web service that use library - in IBM websphere

make sure required application library jars (jena's for example) are made available in the following place
web project -> WebContent -> lib

otherwise, exception may happen at server side during server start up

In IBM websphere, it seems that the server do NOT use pre-set external JDK, as can be noticed from the server's prompt below:

** Starting the server ***
************ Start Display Current Environment ************
WebSphere Platform 5.1 [BASE 5.1.0.3 cf30412.02] [JDK 1.4.1 b0344.02] running with process name localhost\localhost\server1 and process id 5276
Host Operating System is Windows XP, version 5.1
Java version = J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
was.install.root = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
user.install.root = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
Java Home = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre
ws.ext.dirs = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/lib;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/classes;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/classes;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/ext;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/web/help;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime;C:/Program Files/IBM/SQLLIB/java/db2java.zip;C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.webservice_5.1.2.3/runtime/worf.jar
Classpath = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/properties;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/properties;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/bootstrap.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/j2ee.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/lmproxy.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/urlprotocols.jar;C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.1.1/runtime/wteServers.jar;C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.1.1/runtime/wasToolsCommon.jar
Java Library path = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/bin;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/bin;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/jre/bin;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;.;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;c:\ruby\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Symantec\pcAnywhere\;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Rational\common;C:\Program Files\Rational\ClearCase\bin;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\CVSNT\;C:\java\jdk1.5.0_04\bin

Solution to solve the following error:
java.lang.NoSuchFieldError: actualValueType at com.hp.hpl.jena.datatypes.xsd.XSDDatatype.convertValidatedDataValue(XSDDatatype.java:370)
This is caused by the system's not using jena's xercesImpl.jar and maybe also other xerces jars.
therefore, because we can see from the prompt that the system is using the following jre
JavaHome = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre
We therefore copy all the jars in D:\APIs\Jena-2.4\lib\*.* to JavaHome\lib\endorsed\



Client problem solution:
WS Client generated from WSDL, when run the client, it may report the following error:

java.lang.ExceptionInInitializerErrorat java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Unknown Source)at com.ibm.ws.webservices.engine.encoding.DefaultTypeMappingImpl

I would like to add that when you generate a web service from a WSDL in WSAD 5.1.2 you must also see this problem. This time, it was because the classpath is set to use WAS_50_PLUGINDIR/lib/webservices.jar which translates to D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5_stub\lib\webservices.jar in both the webapp and the client java app. I corrected this by changing webservices.jar to be picked up from D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\lib\webservices.jar and the problem vanished. I used IBM Java 1.4 successfully (maybe because I am using WSAD5.1.2).



Deploy EAR Web service application in IBM Websphere Application Server:
install the IBM WAS 5.1 - when asking for user ID and password (to start WAS as a service), it means the one that you use to login the windows OS.

Servers --> Application Servers --> server1 --> Process Definition --> Java Virtual Machine --> Generic JVM arguments = -Djava.endorsed.dirs=C:\Progra~1\WebSphere\AppServer\java\jre\lib\endorsed
This is the place that all jars in D:\APIs\Jena-2.4\lib\*.* should be copied into! to override the xercesImpl. Otherwise the following error would be raised at server side when the semantic web service is called:
java.lang.NoSuchFieldError: actualValueType at com.hp.hpl.jena.datatypes.xsd.XSDDatatype.convertValidatedDataValue(XSDDatatype.java:370)

Server configuration bakup:
C:\Program Files\WebSphere\AppServer\bin\backupConfig.bat
C:\Program Files\WebSphere\AppServer\bin\restoreConfig.bat

if can not deploy as Web Service or generate WDSL from the java file, prompting IWAB0398E error in generating WSDL file from java com.ibm.ws.webservices.wsdl.fromJava.Emitter then you need to uninstall Websphere studio application developer , then delete C:\Program Files\IBM\WebSphere Studio, then re-install the WSAD.

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

Note that OntRegistry uses protege owl api, which requires jdk 1.5. Make sure you are not using jdk 1.4, otherwise expect the following error:


java.lang.UnsupportedClassVersionError: edu/stanford/smi/protegex/owl/model/impl/DefaultRDFIndividual (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
Exception in thread "main"

Friday, August 04, 2006

204698814
GET: http://www.flickr.com:80/services/rest/?method=flickr.photos.getExif&api_key=8cb51a9e1b0a137ffefaa2c39c3c40b5&photo_id=204698814&secret=04a2410fe49b0df3
Exif of 204698814
Make FUJIFILM
Model FinePix A310
X-Resolution 72/1
Y-Resolution 72/1
Resolution Unit 2
Software Digital Camera FinePix A310 Ver1.00
Date and Time 2003:03:14 22:06:45
YCbCr Positioning 2
Exposure 10/280
Aperture 280/100
Exposure Program 2
ISO Speed 400
Date and Time (Original) 2003:03:14 22:06:45
Date and Time (Digitized) 2003:03:14 22:06:45
Compressed Bits per Pixel 20/10
Shutter Speed 490/100
Aperture 300/100
Brightness 99/100
Exposure Bias 0/100
Maximum Lens Aperture 300/100
Metering Mode 5
Flash 16
Focal Length 570/100
Color Space 65535
Pixel X-Dimension 1024
Pixel Y-Dimension 771
Focal Plane X-Resolution 5263/1
Focal Plane Y-Resolution 5263/1
Focal Plane Resolution Unit 3
Sensing Method 2
Compression 6
Quality NORMAL
Sharpness 3
Flash Mode 2
Flash Strength 0/10
Tag::Fujifilm::0x1023 1405,
1060
Tag::Fujifilm::0x1032 1
Blur Warning 1
By-Line (Author) Picasa 2.0
Tag::IPTC::0x0275
0-0-7fffffff-0
0-0-0-0
0
0
0

Contact
204230634
GET: http://www.flickr.com:80/services/rest/?method=flickr.photos.getExif&api_key=8cb51a9e1b0a137ffefaa2c39c3c40b5&photo_id=204230634&secret=04a2410fe49b0df3
Exif of 204230634
Make Canon
Model Canon EOS 350D DIGITAL
X-Resolution 72/1
Y-Resolution 72/1
Resolution Unit 2
Date and Time 2006:08:01 21:00:19
YCbCr Positioning 2
Exposure 30/1
Aperture 16/1
Exposure Program 4
ISO Speed 100
Date and Time (Original) 2006:08:01 21:00:19
Date and Time (Digitized) 2006:08:01 21:00:19
Shutter Speed -686294017/256
Aperture 524288/65536
Exposure Bias 0/33554432
Metering Mode 5
Flash 16
Focal Length 55/1
Color Space 65535
Pixel X-Dimension 1024
Pixel Y-Dimension 683
Focal Plane X-Resolution 1728000/874
Focal Plane Y-Resolution 1152000/582
Focal Plane Resolution Unit 2
Compression 6
By-Line (Author) Picasa 2.0
Tag::IPTC::0x0275
0-0-7fffffff-0
0-0-0-0
0
0
0

Contact

Thursday, July 13, 2006

some good recorded presentation

Semantic Scholarly Publishing and Discourse: Tools for Modelling Contested Knowledge Domains. Stanford University HCI Program, April 2004 [1 hr webcast] [PPT] [12 min. summary]

Monday, June 19, 2006

paper references on learning

p.p. 9
collaborative learning fosters the development of critical thinking through discussion, clarification of ideas, and evaluation of others’ ideas.

p.p.9
The instructor’s role is not to transmit information, but to serve as a facilitator for learning.


Critical-thinking Items: Items that involve analysis, synthesis, and
evaluation of the concepts.

Drill-and-Practice Items: Items that pertain to factual knowledge and
comprehension of the concepts.


Anuradha A. Gokhale, Collaborative Learning Enhances Critical Thinking, Journal of Technology Education Vol. 7 No. 1, Fall 1995

Monday, June 12, 2006

Eclipse WTP Tomcat axis Web Service

in eclipse
. create a server instance
. switch to J2EE perspective
. create dynamic web project
. "web Content" --> import the wsdl file
. file->new->web service -> top down from wsdl
. make sure the an instance of the server is created and started in eclipse with the web service running
. check the following in web browser
http://localhost:8080/WebServiceTest/services , it should display something as below:

And now... Some Services
AdminService (wsdl)
AdminService
Version (wsdl)
getVersion

. windows->preference->java->Installed JRE->JDK1.5->add External JARs to inlcude activations.jar and mail.jar from jaf and javamail. (this will remove the attachment not supported warning)


P.S. it is not http://localhost:8080/WebServiceTest/ which only returns HTTP Status 404 - /WebServiceTest/


Ref: http://www.eclipse.org/webtools/jst/components/ws/1.5M6/tutorials/TopDownWebService/TopDownWebService.html

Monday, June 05, 2006

create eventSearch Web service and portal client

(lb p32)
WS-I WSDL first approach is used. accordingly the following steps are attmepted for this task.
1. Service specification for WSDL design - Specify service interface.
2. Use Axis tool to generate service code template
H:\>java org.apache.axis.wsdl.WSDL2Java --server-side --skeletonDeploy true http://www.ecs.soton.ac.uk/~ft/ontology/EventSearch.wsdl
this generate the following server side skeleton (client side is called stub):
Event.java ArrayOfEvent.javaEventSearchIn.java EventSearchOut.javaEventSearchPort.java EventSearchBindingStub.javaEventSearchBindingSkeleton.java EventSearchBindingImpl.javaEventSearchService.java EventSearchServiceLocator.javadeploy.wsdd undeploy.wsdd
3.

Monday, March 13, 2006

Research Activity Profile Management

log research activities in a semantic web way.

Thursday, February 09, 2006

linux commands

# mount and unmount cdrom
as root, eject /dev/hdc will eject the cd-rom
mount /dev/hdc will mount the cd-rom

# how to automate sftp sessions without having to type in the password
http://www.atmos.albany.edu/facstaff/rmctc/ssh2/

# string replacement using comand line stream editor
sed -e 's/35934/39690/g' index.html >index1.html

#command line web browsing and retrivel
-r for recursive, -x for retain directory structure
wget -r -x http://www.google.com

# vncserver setup
vncserver :1 geometry 1280x1024

Tuesday, January 31, 2006

semantic web and p2p reference

the follow paper describes the benifit of p2p and RDF that fit into the democratic network philosophy!
Semantic Web Meta-data for e-Learning – Some Architectural Guidelines

"However, the web has developed into a predominantly client-server based system,
which mainly relies on centralized information handling, something that really
defeats the purpose of Internet technology. Peer-to-peer networks is a way out of
that trap. RDF is also deliberately designed as a peer-to-peer architecture, where
anyone can say anything about anything [5], so it naturally fits into the democratic
network philosophy. In a democratic network, objectivity is defined by consensus,
not by authority. Meta-data needs to be a part of that consensus building process"