Wednesday, October 24, 2012

XXX Type not resolved in JSP

When trying to import a package or a class file to a jsp page, some time the jsp compiler generates a starange error like ..... "XXX type not resolved ..." blah blah,. To solve this import the package till the class and or include the class.

To endorse  a library in tomcat, just add in endorsed directory of tomcat and in the configuration add the url. 

Friday, October 19, 2012

Problem in TinyOS and TOSSIM


I got the following error while I am using TOSSIM. I googled it, but didn't get a solution.

alemnew@alemnew-RV520:/opt/tinyos-2.0.2/apps/Blink$ make micaz sim
mkdir -p build/micaz
  placing object files in build/micaz
  writing XML schema to app.xml
  compiling BlinkAppC to object file sim.o
ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\)   -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DIDENT_APPNAME=\"BlinkAppC\" -DIDENT_USERNAME=\"alemnew\" -DIDENT_HOSTNAME=\"alemnew-RV520\" -DIDENT_USERHASH=0xfb2a96e0L -DIDENT_TIMESTAMP=0x50813f91L -DIDENT_UIDHASH=0x1f0ae3cfL -Wno-nesc-data-race BlinkAppC.nc   -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
two source files specified (PLATFORM_MICAZ and BOARD_MICASB)
make: *** [sim-exe] Error 1
alemnew@alemnew-RV520:/opt/tinyos-2.0.2/apps/Blink$ 

I think this is a problem of compatibility between ncc and gcc-4.6 (that you
probably have installed).

Upgrading ncc to ncc-1.3.3 should solve the problem[1]

The second problem is: 
....
/opt/tinyos-2.0.2/tos/lib/tossim/tossim_wrap.cxx:247:20: fatal error: Python.h: No such file or directory
compilation terminated.
make: *** [sim-exe] Error 1

Check the the manual here[2] and then modify manaully the "tossim_wrap.cxx" by adding the absolute  location of the Python.h file. 


Tuesday, September 18, 2012

Installing Windows 7 from USB

To install Windows 7, 8, Vista from USB Key using command line
  1. Open Command line (cmd) Start -->run --> type "cmd" -->hit enter
  2. write the following commands in the opened command windows
    1. diskpart
    2. list disk
    3. selct Disk <number>
    4. clean
    5. create partition primary
    6. select partition 1
    7. active 
    8. format fs=NTFS
    9. assign
    10. exite
  3. Now the USB is bootable and ready to be used. Then copy the Windows file in to the USB either manually or using copy command. copy <sources> <destination> 
  4. Then restart the computer and boot from the usb by pressing the booting key. 
  5. Enjoy! 
Source:- Internet :-)

Thursday, September 13, 2012

Web Architecture

Project Over view

C4CE is a project that for the fulfillment of Web Architecture course.  The name C4CE stands for Cloud for Civil Engineering.
The aim of the Application is to enable civil engineers and Architects to use cloud infrastructures in their career, mainly for 3D rendering.  They use lux render engine for creating the 3D images from the auto sketch or google sketch plugins. This consume a large amount of resources of computation like memory, CPU, storage, etc. This can be easily handled using cloud computing.

I will be back on the detailed documentation. 

Sunday, August 19, 2012

Linux Giks

How to change the permission of a disk or a directory?

chown -R <user> <Directory>

eg: chown -R alemnew /media/ change the permission of  /media/ to alemnew.

Tuesday, June 19, 2012

Events I Attended

SAT'12 Trento - Italy June 19, 2012
Speaker:- Professor Donald E. Knuth from Stanford University
Topic:- SAT  and The Art of Computer Programming
He is a retired famous professor from Stanford University. Nevertheless, he is still writing books and papers in Computer Science. 

Thursday, April 26, 2012

java.lang.OutOfMemoryError

To solve this problem set the environment variable as export CATALINA_OPTS=”-Xms256m -Xmx512m” or export JAVA_OPTS=”-Xms256m -Xmx512m”

Search key word: OutOfMemoryError

More information: 
http://confluence.atlassian.com/display/DOC/Configuring+System+Properties
http://mhashem.wordpress.com/2008/08/25/set-tomcat-memory-heap-size/
http://stackoverflow.com/questions/3583757/how-to-make-sure-that-tomcat6-reads-catalina-opts-on-windows

Thursday, April 19, 2012

Setting Environment Variable in Linux

To set the environment variable for java, and other do the following

  • open /etc/bash.bashrc as root privileged 
  • put the executable application to /usr/local/bin/<appName> and copy here /install here. Also it's possible to refer the directory where ever.
  • Add the location to the opened file as follow; Examle for java: PATH=$PATH:/usr/local/java/<jdk...> and export PATH then save and exit.
Enjoy With ....

@SPIN: LTL- Formal Verification

To install Spin: download spin from the official website (http://spinroot.com) then do accordingly. Then install iSpin as well, as described in the web site.

Then to make spin working in any directory create set it to the PATH environment variable, as follow: create some directory like /usr/local/bin/spin/ copy the executable spin from the Src* directory to here, and open /etc/bash.bashrc and add to the env't variable as PATH=$PATH:/usr/local/bin/spin then save restart the terminal.
Also iSpin may not work, displaying the error " exec: 3: wish:  not found ". In this case download and install tcl in this way: sudo apt-get install libtcltk-ruby , The n should work. Enjoy with Spin ....


ispin spin <file_name.pml>

Wednesday, April 18, 2012

java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String

This is the problem occurred while I am developing the jsp application to consume web service. I used tomcat 7.0.14 and java 1.6.0_22.

Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
[java] at com.sun.xml.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1162)  
     [java]     at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:898)  
     [java]     at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:666)  
     [java]     at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:420)  
     [java]     at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel


The solution is:
 - use endorsed mechanism for tomcat. (add the webservices-api.jar file in the catalina_home/endorsed/) directory. then add some configuration in the tomcat. in windows we can click on configure and follow the steps.
some few links talks about it.
http://dev-answers.blogspot.it/2010/02/configure-endorsed-libraries-in-tomcat.html
http://brightdadson.blogspot.it/2010/03/javalangnosuchmethoderror.html
http://www.fromdev.com/2010/01/trying-to-run-jax-ws-sample-application.html

Unable to create JAXBContext


While I am trying to invoke web service from my java application in the command line I have face the following error.

root@collaboratorio LUXClientFTP]# java -jar -Djava.endorsed.dirs=lib LUXClient.jar
Apr 12, 2012 12:24:53 PM [com.sun.xml.ws.policy.jaxws.PolicyConfigParser]  parse
INFO: WSP5018: Loaded WSIT configuration from file: jar:file:/home/java/LUXClientFTP/lib/venusc-api.jar!/META-INF/wsit-client.xml.
Apr 12, 2012 12:24:54 PM [com.sun.xml.ws.policy.jaxws.PolicyConfigParser]  parse
INFO: WSP5018: Loaded WSIT configuration from file: jar:file:/home/java/LUXClientFTP/lib/venusc-api.jar!/META-INF/wsit-client.xml.
javax.xml.ws.WebServiceException: Unable to create JAXBContext
        at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:166)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
        at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
        at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:661)
        at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:649)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:343)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:308)
        at javax.xml.ws.Service.getPort(Service.java:99)
        at com.bsc.venusbes.venusclient.BESFactoryPortTypeImplService.getBESFactoryPortTypePort(BESFactoryPortTypeImplService.java:82)
        at com.bsc.venusbes.venusclient.VENUSClient.createActivity(VENUSClient.java:88)
        at LUXClient.submitRender(LUXClient.java:165)
        at LUXClient.main(LUXClient.java:104)
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
        this problem is related to the following location:
                at java.lang.StackTraceElement
                at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
                at java.lang.Throwable
                at public java.lang.Throwable[] com.bsc.venusbes.types.bes.jaxws.CantApplyOperationToCurrentStateFaultBean.suppressed
                at com.bsc.venusbes.types.bes.jaxws.CantApplyOperationToCurrentStateFaultBean
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
        ... 12 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
        this problem is related to the following location:
                at java.lang.StackTraceElement
                at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
                at java.lang.Throwable
                at public java.lang.Throwable[] com.bsc.venusbes.types.bes.jaxws.CantApplyOperationToCurrentStateFaultBean.suppressed
                at com.bsc.venusbes.types.bes.jaxws.CantApplyOperationToCurrentStateFaultBean
        at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
        at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:106)
        at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:109)
        at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:161)
        at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:154)
        ... 14 more
==============
null
[root@XXX LUXClientFTP]#

Of course,  I spent more time to solve the problem this problem by searching blogs and google. Mosst of the developers encounter the same problem like mine, but they didn't put the short solution.
Firstly I used jdk 7 for developing and running the client application, and the problem occurred here.

After long time, I change my JDK to version 1.6.0_22 and it works.  But, saying there is application that can run on oldest version but not in latest one is strange for me.  Anyways, the problem is solved. ;)

Thursday, April 5, 2012

Welcome to My Blogig

This is Alemnew Sheferaw's Academic blog. In this blog, technological related stuffs will be added.

...........More on the future...