javax.servlet.ServletException: HV000030: No validator could be found for type: java.lang.Integer

HV000030: No validator could be found for type: java.lang.Integer That will happen when you use JSR303 bean validation in flavor of Hibernate Validator and you have in your JPA entity the Hibernate-specific @NotEmpty on an Integer property like this: @NotEmpty private Integer some; This is completely wrong. An integer cannot be considered as a string, … Read more

Class “model.Address” is listed in the persistence.xml file but not mapped

This is an Eclipse quirk. I recently had exactly this problem when I created a new JPA project with the JPA library configuration disabled, but didn’t manually configure the JPA libraries before I created the entities by the Eclipse New JPA Entity wizard. After creating the entities I configured the JPA libraries in project’s Build … Read more

Any good resource for java interview questions? [closed]

How about SO? https://stackoverflow.com/questions/64856/senior-j2ee-interview-questions https://stackoverflow.com/questions/72183/any-good-interview-questions-to-ask-prospective-junior-java-developers Check the resources at this site, it has a very good collection of sample questions and answers: http://www.j2eebrain.com/j2ee-interview-questions-answers

Difference between a packaged archive and an exploded archive

There is no difference really. An exploded archive is a tree of folder and files that respects a given structure which your application server can exploit to deploy the application. For a web application for instance, you create a war directory structure. The application server expects a WEB-INF directory containing the web.xml files which acts … Read more

Difference between Java EE and Spring framework [closed]

Java EE is an standard, official, specification for a full featured Enterprise Application Framework stack. Includes stuff like Object-Relational Mapping, Security, Web Applications, database connectivity, transactions… On top of Java EE specifications there are JavaEE implementations/application servers like: JBoss, Glassfish, WebSphere, Weblogic. Spring on the other hand, is a framework doing lots of the stuff … Read more

How can I manually load a Java session using a JSESSIONID?

There is no API to retrieve session by id. What you can do, however, is implement a session listener in your web application and manually maintain a map of sessions keyed by id (session id is retrievable via session.getId()). You will then be able to retrieve any session you want (as opposed to tricking container … Read more

Where are compiled JSP Java (*__jsp.java) files?

The compiled JSP files are by default available in the /work folder of the Tomcat environment. There should be a subfolder Catalina which in turn has a subfolder representing the domain name which defaults to localhost. There in turn should be the project folder which in turn contains package hierarchy org.apache.jsp with therein the compiled … Read more

Sharing a persistence unit across components in a .ear file

Here are the relevant sections of the JPA 2.0 specification: 8.2 Persistence Unit Packaging … A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. In Java EE environments, the root of a persistence unit must … Read more

Hibernate auto create database

<property name=”hibernate.hbm2ddl.auto”>create</property> will create tables. But it will not create database. Change the connection url to generate the database. <property name=”connection.driver_class”>com.mysql.jdbc.Driver</property> <property name=”connection.url”>jdbc:mysql://localhost/InternetProject?createDatabaseIfNotExist=true</property> <property name=”connection.username”>root</property> <property name=”connection.password”></property> <property name=”connection.pool_size”>10</property> Update : character encoding when creating database <property name=”connection.url”> jdbc:mysql://localhost/InternetProject?createDatabaseIfNotExist=true&useUnicode=yes&characterEncoding=UTF-8 </property>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)