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...