agoncal / agoncal-book-javaee7 Goto Github PK
View Code? Open in Web Editor NEWCode of my Java EE 7 Book
Home Page: https://antoniogoncalves.org/category/books/
Code of my Java EE 7 Book
Home Page: https://antoniogoncalves.org/category/books/
Your name on the repo links to: "Antonio Goncalves (http://http://www.antoniogoncalves.org)", so it's broken :(
Le module war est déployé correctement, mais avec l'erreur suivante :
PER01003: Deployment encountered SQL Exceptions: PER01000: Got SQLException executing statement "CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(15), PRIMARY KEY (SEQ_NAME))": java.sql.SQLException: Table/View 'SEQUENCE' existe déjà dans Schema 'APP'. PER01000: Got SQLException executing statement "INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 0)": java.sql.SQLIntegrityConstraintViolationException: L'instruction a été abandonnée parce qu'elle aurait entraîné la duplication d'une valeur de clé dans une contrainte de clé ou d'index unique identifié par 'SQL121207220824430' définie sur 'SEQUENCE'. Command deploy completed with warnings.
Test réalisé avec GlassFish Server Open Source Edition 4.0 (build 64)
in documentations, it says the following;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@qualifier
@retention(RUNTIME)
@target({TYPE, METHOD, FIELD, PARAMETER})
public @interface Informal {}
You can then define a bean class that extends the Greeting class and uses this qualifier:
package greetings;
@InFormal
public class InformalGreeting extends Greeting {
public String greet(String name) {
return "Hi, " + name + "!";
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
However in the examples the book provide, the following annotations are used.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@qualifier
@retention(RUNTIME)
@target({FIELD, TYPE, METHOD})
public @interface ThirteenDigits {
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
In netbeans IDE, this gives an error (http://tinypic.com/view.php?pic=fknqs2&s=8#.U5R4Z3VdWhc), although it compiles and runs.
I tried changing the the target annotation to @target({METHOD, FIELD, PARAMETER, TYPE}), which works just as well without the error sign. Are there going to be cases where I'd want(because of necessity) to put 3 targets likeyou did, instead of 4 like documentation suggests?
At the last step in deploying the jar from chapter 8(Service), i got this error Exception while invoking class org.glassfish.ejb.startup.EjbApplication start methodjava.lang.RuntimeException: java.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor
. I don't know if it's because glassfish has the wrong version for CDI validator or not.
Tested on :
Cannot resolve dependency to org.agoncal.book.javaee7.chapter22:chapter22-service:jar in chapter22-consumer.
When deploy the project of chapter 11 not alow, because, apper the next error: Error occurred during deployment: Exception while deploying the app [chapter11-1.0] : Servlet [RegistrationPortTypeRPCPortImpl] and Servlet [RegistrationRequesterPortTypePortImpl] have the same url pattern.
please help me, I don't now what is?
I give excuses for my english
I got the following error when I do mvn dependency:go-offline
[ERROR] Failed to execute goal on project chapter08-consumer: Could not resolve dependencies for project org.agoncal.book.javaee7.chapter08:chapter08-consumer:jar:1.0: Failure to find org.agoncal.book.javaee7.chapter08:chapter08-service:jar:1.0 in http://maven.repository.redhat.com/techpreview/all was cached in the local repository, resolution will not be reattempted until the update interval of jboss-ga-repository has elapsed or updates are forced -> [Help 1]
It seems the dependency it's not in the repository
java.lang.NoClassDefFoundError: org/eclipse/persistence/internal/libraries/asm/ClassVisitor
Lié au bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=396943
FAIL (Error 500) :
curl -X GET -H "Accept: application/json" http://localhost:8080/chapter22-service-1.0/rs/book -v
WIN :
curl -X GET -H "Accept: application/xml" http://localhost:8080/chapter22-service-1.0/rs/book -v
Tested with GlassFish Server Open Source Edition 4.0 (build 64)
Why not Java EE 7 (Beginning Java EE 7) book?
From jdk8 (1.8.0u45) via intelliJ when executing the chapter 2 ex33 tests:
[main] WARN org.jboss.weld.Reflection - WELD-001471 Interceptor method logMethod defined on class org.agoncal.book.javaee7.chapter02.ex27.ProfileInterceptor27 is not defined according to the specification. It should not throw java.lang.Exception, which is a checked exception.
[main] WARN org.jboss.weld.Reflection - WELD-001471 Interceptor method init defined on class org.agoncal.book.javaee7.chapter02.ex25.LoggingInterceptor25 is not defined according to the specification. It should not throw java.lang.Exception, which is a checked exception.
page 46 of the book says "This method can throw a checked exception" in reference to Interceptors.
Hi
When I run mvn package command for chapter 11 "putting it all" project, glassfish-embedded-all dependency cannot be found. It seems version 4.0-b87 does not exist.
Meanwhile, I found version 4.0-b72 in the following url:
https://maven.java.net/content/repositories/releases/org/glassfish/main/extras/glassfish-embedded-all/
Original code on the book.
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
}
Proposal code.
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
Logger logger = Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
Handler h = new ConsoleHandler();
h.setLevel(Level.ALL);
logger.addHandler(h);
logger.setLevel(Level.ALL);
return logger;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.