Tuna Töre

How to ignore columns class fields in Hibernate Missing column: in databasetable


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

Caused by: org.hibernate.HibernateException: Missing column: test in databasetable
at org.hibernate.mapping.Table.validateColumns(Table.java:276)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1313)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:378)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
… 61 more

Solution is adding @Transient to column like as below;

@Transient
private String test;

27/08/2015 Posted by | Hibernate | | Leave a comment

Windows task kill with commands


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

netstat -a -o -n
taskkill /F /pid processid

25/08/2015 Posted by | Windows | Leave a comment

How to create effective pom.xml in Maven (merge parent pom with modules)


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

If you would like to create an effective pom.xml (merged pom.xml) file based on parent pom.xml and modules;
Use the following command in order to display and save it as a file;

inside module project type

mvn help:effective-pom -Doutput=mergedpom.xml

24/08/2015 Posted by | Maven | | Leave a comment

ERROR LazyInitializationException:42 – failed to lazily initialize a collection of role no session or session was closed org.hibernate.LazyInitializationException


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

19 aug 2015 10:03:24,448 ERROR LazyInitializationException:42 – failed to lazily initialize a collection of role: class, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: class, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)

Solution on JUnit tests

@Test
@Transactional

And @Entity level use fetch = FetchType.EAGER

@OneToMany(mappedBy = "groups", fetch = FetchType.EAGER)

19/08/2015 Posted by | Hibernate, JUnit | , | Leave a comment

java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

Solution
use @Test on JUnit methods

java.lang.Exception: No runnable methods
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:171)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:115)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:269)
at org.junit.runners.ParentRunner.(ParentRunner.java:66)
at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:59)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.(SpringJUnit4ClassRunner.java:104)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

19/08/2015 Posted by | Exceptions, JUnit | , | Leave a comment

org.hibernate.JDBCException: Error during import script execution


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

Hibernate by default tries to import SQLs under (classpath);
resources folder named as import.sql;

So you should edit the content of this SQL file.

17 aug 2015 17:05:27,027 INFO SchemaExport:348 – Executing import script: /import.sql
17 aug 2015 17:05:27,030 ERROR SchemaExport:287 – schema export unsuccessful
org.hibernate.JDBCException: Error during import script execution at line 1
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:370)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:276)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:372)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)

17/08/2015 Posted by | Hibernate | | Leave a comment

Windows cannot find ‘http://127.0.0.1:%HTTPPORT%/apex/f?p=4950’. Make sure you typed the name correctly, and then try again.


Windows cannot find ‘http://127.0.0.1:%HTTPPORT%/apex/f?p=4950&#8217;. Make sure you typed the name correctly, and then try again.

Replace the URL with the following one

http://127.0.0.1:8080/apex/f?p=4950

11/08/2015 Posted by | Oracle | | Leave a comment

Plugin execution not covered by lifecycle configuration: org.apache.cxf:cxf-codegen-plugin:2.1.2:wsdl2java (execution: generate-sources, phase: generate-sources)


In order to solve this, <plugins> should be defined under <pluginManagement> tag

Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?
couponCode=spring32coupon

<pluginManagement>
<plugins>
<!-- Generate Java classes from WSDL during build -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/java/wsdlfile.wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Add generated sources - avoids having to copy generated sources to build location -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Build the JAR with dependencies -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>

03/08/2015 Posted by | Maven | | 1 Comment

Java Spring Framework 4 and Core Spring Certification udemy


Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

Course Description

NEW Course on udemy and published on 07 JULY 2015

By attending this course, you will be able to learn the details of the latest Spring Framework 4x version with code examples.

This course also provides you the answers of all Core Spring Framework 4x Certification questions inside the official study guide. (in total 162 questions). Therefore, after completing this course, you will learn the answers of questions with code examples and able to pass the certification.

The course will start with the configuration of the course environment such as downloading and installing the Java JDK and STS (Spring Tool Suite). I will also provide you the links for downloading the source codes and slides used in this course. By downloading those materials, you will be able to configure your environment and also other commercial applications in an easy way. This course will provide you two sample application including the configurations of Spring Framework and its dependencies; one of them is configured as a Java Standard Edition program and the other one is a Web-based application. (names arespring, spring-web)

The course’s content is based on the following sections;

  • Spring Container, Dependency, and IOC (Inversion of Control)
  • Aspect Oriented Programming
  • JDBC, Transactions, and ORM (Hibernate)
  • Spring MVC
  • Spring Security
  • Messaging (JMS)
  • REST
  • Unit Testing with JUnit
  • Library Management with Maven

If you attend this course, I will also answer all of your questions related to the course or code examples through comments. You will be able to ask me any questions related to the Spring Framework or Core Spring Certification through udemy, emails and the contact form inside my technical blog.

  • Installing Spring Tool Suite and Java JDK 8.0
  • Learn how to use Maven by editing pom xml for library management
  • Provides information about Core Spring Framework 4.x certification and passing scores
  • You will learn how to debug, test and run Spring Framework applications
  • Understand how to use Spring Framework’s Container
  • Understand how to use constructor and setter injection works
  • Learn the bean life cycle in Spring Framework
  • Understand the usage of BeanFactoryPostProcessors and BeanPostProcessors
  • How to use @ComponentScan annotation
  • Understand the usage of <context:component-scan/> tag in application-context xml file
  • How to define scopes for beans in XML configuration and annotation configuration
  • How to use @Bean annotation with @Scope annotation
  • How to configure PropertyPlaceholderConfigurer in XML configuration or Java based Configuration
  • How to use @Autowired and @Qualifier annotations
  • How to use @PostConstruct and @Predestroy JSR-250 annotations
  • How to configure init-method and destroy-method in Spring XML Configuration
  • Understand how to use <bean/> tag in XML configuration
  • How to use <context-annotation-config> tag in XML configuration
  • How to use ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, XmlWebApplicationContext and AnnotationConfigApplicationContext
  • How to configure JUnit with Spring Framework applications
  • How to use @RunWith(SpringJUnit4ClassRunner class)
  • How to use @ContextConfiguration
  • Understand the usage of @Value annotation
  • Learn how to configure profiles with @Profile annotation
  • Learn how to use Bean Inheritance in Spring Framework
  • How use abstract beans in Spring Framework
  • How to use <context:property-placeholder/>
  • How to configure PropertySourcesPlaceholderConfigurer in JavaConfig
  • How to implement FactoryBean interface in Spring Framework
  • How to use @Configuration annotation in Spring Framework
  • How to define AnnotationConfigApplicationContext
  • How to use AbstractJUnit4SpringContextTests
  • How to implement ApplicationContextAware interface
  • See how to use <util:properties/> in XML configuration files
  • Understand how to use basic SpEL (Spring Expression Language) in properties
  • How to define inner beans in XML configuration
  • How to get beans from application-context xml with getBean() method
  • How to close Application Context with ConfigurableApplicationContext
  • How to use @PropertySource annotation
  • Understand the usage of Aspect Oriented Programming (AOP)
  • Learn cross cutting concerns in programming
  • Learn the following concepts; pointcut, jointpoint, advice and aspect
  • How to use @Aspect annotation
  • Learn how to use <aop:config>, <aop:pointcut>, <aop:after>, <aop:before>, <aop:after-throwing>, <aop:after-returning>, <aop:around> and <aop:aspect> tags in XML configuration
  • Understand the usage of @EnableAspectJAutoProxy annotation
  • Understand the usage of <aop:aspectj-autoproxy />
  • How to define named pointcuts
  • Learn how to use @Pointcut, @Before, @After, @AfterThrowing, @AfterReturning and @Aroundannotations
  • Learn the difference between checked and unchecked exceptions in Java Programming
  • Learn DataAccessException in Spring Framework
  • Learn how to define DriverManagerDataSource or BasicDataSource in XML configuration
  • Understand how to use JDBCTemplate when accessing databases
  • Learn how to define <jdbc:embedded-database/> and <jdbc:script/>
  • Learn the usages of RowMapper, RowCallbackHandler and ResultSetExtractor
  • Learn how to define DataSourceTransactionManager
  • How to use @Transactional annotation
  • Understand how to use TransactionTemplate
  • Learn the usage of Propagation object
  • Learn the usage of @Transactional(rollbackFor=YourExceptionclass)
  • Learn the usage of @Transactional(noRollbackFOr=YourExceptionclass)
  • Learn the usage of @Rollback(value=false) annotation
  • Learn how to configure entityManagerFactory with Hibernate in Spring Framework
  • How to use @Entity and @PersistentContext annotations
  • Understand what is MVC (Model View Controller)
  • How to use DispatcherServlet
  • Understand how to edit web xml file for configurations
  • Understand the usage of @Controller and @RequestMapping annotations
  • How to configure SimpleUrlHandlerMapping using XML configuration
  • How to configure ContextLoaderListener in web xml
  • How to define <contextConfigLocation/> tag in web xml
  • How to use @RequestParam and @PathVariable annotations
  • Understand the usage of ModelAndView
  • How to define InternalResourceViewResolver in configuration files
  • How to define DelegatingFilterProxy in web xml
  • How to use <intercept-url/> in Spring Security
  • How to use @Secured and @RolesAllowed annotations
  • Understand the usage of <authentication-manager/> tag in Spring Security
  • Understand the usage of <password-encoder/>
  • How to configure <salt-source/> in Spring Security
  • Understand how to define <jdbc-user-service/>
  • How to configure <access-denied-handler/>
  • Understand how to configure <form-login/> in Spring Secuirty
  • Understand how to use JMS (Java Message Service) in Spring Framework
  • How to use JMSTemplate
  • How to implement MessageListener interface
  • Learn how to configure ApacheMQ for messaging in Spring Framework
  • Learn how to configure <jms:listener-container/>
  • Learn how to use topics and queues
  • How to configure MDP (Message Drivern POJOs)
  • How to develop REST web services with Spring Framework
  • How to use <mvc:annotation-driven /> and @EnableWebMvc
  • How to use RequestMethod types in Spring Framework
  • How to use @ReponseBody, @RestController, @ExceptionHandler and @ResponseStatusannotations
  • How to use RestTemplate in Spring Framework

HD quality (full screen) recorded course content and you will be able to see the source code clearly (HD format) if you attend this udemy course as a student.

What are the requirements?

  • Basic Java programming knowledge and enthusiasm to learn the latest Spring Framework 4.x
  • Basic knowledge of XML, HTML and Web Development
  • Knowledge of simple SQL queries such as SELECT, INSERT, DELETE and UPDATE

What am I going to get from this course?

  • Over 75 lectures and 9.5 hours of content!
  • Learn the latest Spring Framework 4.x in detail with code examples
  • Pass Core Spring Framework 4.x certification successfully
  • Learn the answers of all questions asked in the official study guide
  • Configure Spring Framework based applications in commercial environments
  • Learn Spring Framework’s Container, Dependency Injection and IOC (Inversion of Control) concepts
  • Understand how to code and configure Spring Framework with XML or Java Config
  • Understand how to use AOP (Aspect Oriented Programming) wtih Spring Framework
  • Understand Spring JDBC and Hibernate ORM integration
  • Learn how to use Spring MVC module in Web Applications
  • Code Spring Framework based Web applications
  • Learn how to use and configure Spring Security Module
  • Code REST based web applications using Spring Framework
  • Understand the integration of JMS (Java Message Service) API with Spring Framework
  • Use @Annotations in Spring Framework applicatons
  • Code unit tests using JUnit with Spring Framework
  • Learn how to use Maven for library management
  • Learn the benefits of using Spring Tool Suite (STS)
  • Understand the structure of Spring Web applications
  • Learn how to configure Embedded Database source for Spring applications
  • Understand how to implement Transaction Support for Spring Applications

What is the target audience?

  • Programmers with the basic knowledge of Java
  • Java Programmers/Developers interested in learning the usage of latest Spring Framework 4.x
  • Web developers planning to learn Spring MVC components
  • Programmers interested in learning Spring Framework for developing commercial applications
  • University Students planning to do web applications using Spring Framework
  • Back-end or Front-end Web Developers
  • Junior, Senior or Expert Developers interested in understanding the usage of Spring Framework

Discount: https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

27/07/2015 Posted by | Spring Framework | | Leave a comment

Java Spring Framework 4 and Core Spring Certification


https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring32coupon

22/07/2015 Posted by | udemy | Leave a comment

Follow

Get every new post delivered to your Inbox.

Join 238 other followers