Tuesday, 11 April 2017

Monday, 28 November 2016

java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin

java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin

if you create a Debug configuration from your product file, in my case CDOServer.product, then
1. you go an select the Plug-ins tab in the Debug Configuration
2. then click "Add Required plug-ins"

it may build a dependency that just does not work.

It seems you have do step 1 above, then
2. "Deselect All"
3. Select your own package
4. Click "Add Required plug-ins" a few times until the number of required plugins stop increasing, see the display "x out of y selected"





ref : Eclipse

Could not resolve archetype

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.

Go to your Maven installation folder C:\apache-maven-3.1.0\conf\ ( For example: here we have installed maven in c:\ drive)
Copy settings.xml to C:\Users\[UserFolder]\.m2 (Your local repository)
Modify the proxy in settings.xml based on the info that you get from the above link.

or delete the repository folder from .m2 folder

and restart the eclipse with default maven setting

Ref : javahonk, Git



your install of php does not have the 'php_curl.dll' extension enabled

your install of php does not have the 'php_curl.dll' extension enabled


Open your php.ini file and set the following setting to a Windows file path:

extension_dir = "X:/path/to/your/php/ext"




Java was started but returned exit code = 1

“Java was started but returned exit code = 1”

go to the eclipse dir and edit eclipse.ini

just before -vmargs paste the following path of the jvm

ex :
...
-vm
C:\path to installed direc \Java\jre1.8.0_40\bin\server\jvm.dll


-vmargs

Wednesday, 16 November 2016

Getting started Jersey.

1. Project build and management configuration is described in the pom.xml located in the project root
directory.
REF : pom elements
2. Project sources are located under src/main/java.
3. Project resources are located under src/main/resources.
4. Project web application files are located under src/main/webapp.

5. To compile and package the application into a WAR, invoke the following maven command in your
console:

ex : mvn clean package

logs :

Packaging webapp
[INFO] Assembling webapp [simple-service-webapp] in [.../simple-service-webapp/target/[INFO] Processing war project
[INFO] Building war: .../simple-service-webapp/target/simple-service-webapp.war

Now you are ready to take the packaged WAR (located under ./target/simple-servicewebapp.
war) and deploy it to a Servlet container of your choice.

Jersey dependency maven :

1) jersey-server, jersey-json, jersey-multipart.

Spring dependency :

spring-core,context,context-support,web,aop.

spring security.

security-web,security-config,security-taglib,security-core,security-acl

spring+jersey

spring,core,web,beans,context,asm,aop.

jackson:

jackson-jaxrs-json-provider


apache commons :

utility for string manipulation

connection pool :

dbcp

Apache-commns :

Apache Commons Codec provides implementations of common encoders and decoders such as Base64, Hex, Phonetic and URLs.

Hibernate :

hibernate-core

spring-transaction:

REF : transaction   why we go for spring transaction

hibernate entity manager
table mapping

spring-orm



6. Root Resource Classes
Root resource classes are POJOs (Plain Old Java Objects) that are annotated with @Path

7. @Produces
annotation is used to specify the MIME media types of representations a resource can produce and send back to the
client.
Using multiple output MIME types
@Produces({"application/xml", "application/json"})


@Consumes
annotation is used to specify the MIME media types of representations that can be consumed by a resource.

@QueryParam
is used to extract query parameters from the Query component of the request URL.

@DefaultValue
annotation, will be assigned to the step method parameter. If the
"step" value cannot be parsed as a 32 bit signed integer then a HTTP 404
ex :
 public Response smooth(
4 @DefaultValue("2") @QueryParam("step") int step

@FormParam

it extracts information from a request representation that is of the MIME media type
"application/x-www-form-urlencoded"

@Context HttpHeaders headers,

@Singleton
annotation says that the resource
will be managed as singleton and not in request scope. The sub-resource locator method returns a class which means that the runtime will managed the resource instance and its life-cycle. If the method would return instance instead, the Singleton annotation would have no effect and the returned instance would be used.


Securiry -- done
Multipart  -- progress -- 8.3
Filters -- 9.0