Wednesday, 15 June 2016

Jersey java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer

Jersey java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer


solution : In eclipse 
go to  project -> properties -> development assembly -> add -> java build path entries.

src/main/java not visible in project folder eclipse

src/main/java not visible in project folder eclipse

steps :
1) right click on project.
2) click on build path.
3) select configure buildpath.
4) select order and export
5) click and select.
a) jre system lib.
b) maven dependency 

creating a maven web project from commandline

1)
a. creating a maven project from commandline

mvn archetype:generate -DgroupId={project-packaging}
-DartifactId={project-name}
-DarchetypeArtifactId=maven-archetype-webapp
-DinteractiveMode=false

ref : maven

b) need to create sample web application

ex : mvn archetype:generate -DarchetypeGroupId=com.sample.voice -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion= voice


mvn archetype:generate -DgroupId=com.voice -DartifactId=sample -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Tuesday, 14 June 2016

Previously created MySQL Schema ` ` was found. Statement ignored. ERROR: Previously created MySQL Table

Previously created MySQL Schema ` ` was found. Statement ignored. ERROR: Previously created MySQL Table

scenario : When performing reverse engineering in workbench. If there are multiple instance of DB created in workbench we get the error.
solution :  Make sure workbench dashboard only have one connection in open, to communicate with DB.

Wednesday, 8 June 2016

not-null property references a null or transient value

org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value : entity.VoiceProfile.email; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value : entity.voiceProfile.email

 conclustion :
 While persisting into the DB get the users VoicePofile by id or check if any user exist for the voiceprofile or not.
 if exist get and then store in db.

Tuesday, 7 June 2016

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ' ' cannot be null

Let us check scenario of hibernate.
solution :
1.check entity  mapping with table.
2. check the primary key and foreign key relationship.
3. primary key cannot be "not null" in table, it can be null in other table. 

Monday, 6 June 2016

com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException

com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException

SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries

Ex :
error :
{
"name" : "voice"
"email" : "voice@gmail.com"

}
corrected :
{
"name" : "voice" ,
"email" : "voice@gmail.com"

}

Solution :  In the corrected solution put a comma.