Tuesday 4 November 2014

Eclipse debugger waiting to connect when running through remote application.


Many a time happen that you are trying to connect your eclipse debugger through remote application server like JBOSS and it always shows waiting to connect.
This happens because the port you are trying to connect is bind to some another application.


Find and listening port


1. Go to run
2. Type cmd
3. Write this command ----------- 


netstat -ano | find "<port>"

*<port> you are trying to listen in my case this is 8080
you will get a list of process listening to that port





4. Kill all the task 


write this command 


taskkill /F /PID 7820


7820-- This is the Id which you can see in the last coloumn


That's it your port is free to use now.

Monday 1 September 2014

Error when starting JBoss 5.1.0.GA :- wrong arguments. new for taget java.land.reflect.Constructor expected=[java.net.URI]

JBoss Error : Error when starting JBoss 5.1.0.GA

"Failed to boot JBoss:java.lang.IllegalStateException: Incompletely deployed.


Deployment "AttachmentStore" is in error 
due to: java.lang.IllegalArgumentException: 
wrong arguments. new for taget java.land.reflect.Constructor 
expected=[java.net.URI] actual=[java.io.File]"




Solutions :-
  • Error mainly occurred due to upgrade java 6 to java 7 or 8. Previously I used jdk 6u10 and it is changed to jdk 7u45.
  • Run the projects using java release of jdk 6u10 or Sun JDK 1.6.0_13. JBOSS runs with these JDK version successfully.
  • Open the file profile.xml in jboss-5.1.0.GA\server\default\conf\bootstrap
  • find the "The attachment store" block and


Replace this statement:

<constructor>
<parameter><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter>
</constructor>


With this statement:


<constructor>
<parameter class="java.io.File"><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter>
</constructor>


Thursday 20 February 2014

java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType

Problem:

Hibernate Tool While reverse engineering

Reason for this problem: In one of my table there was a field named version. Which Hibernate tool treated as field version and try to cast the same and it throws an exception because the type of the field was not what hibernate tool was expecting.

Solution: 

Open the hbm configuration file for corresponding table and change the configuration of that field from <version> to <property> .

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...