Benson Fung

Ranch Hand
+ Follow
since Apr 10, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Benson Fung

However, if I choose Maven Update in eclipse which clean projects and build automatically, it works without any problem.   I really don't know what happen.  I guess it is because of Java 6.
7 years ago
Hi Dave,

I just added as you taught.  But still got errors as below.

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project iengage: Compilation failure: Compilation failure:
[ERROR] /C:/Projects/AIAIENGAGE/iengage-backend/src/main/java/com/aia/iengage/controller/CmsFileController.java:[37,1] C:\Projects\AIAIENGAGE\iengage-backend\src\main\java\com\aia\iengage\controller\CmsFileController.java:37: annotation org.springframework.web.bind.annotation.CrossOrigin is missing <clinit>
[ERROR] /C:/Projects/AIAIENGAGE/iengage-backend/src/main/java/com/aia/iengage/controller/CmsContestController.java:[34,1] C:\Projects\AIAIENGAGE\iengage-backend\src\main\java\com\aia\iengage\controller\CmsContestController.java:34: annotation org.springframework.web.bind.annotation.CrossOrigin is missing <clinit>
[ERROR] /C:/Projects/AIAIENGAGE/iengage-backend/src/main/java/com/aia/iengage/controller/MobileApiController.java:[27,1] C:\Projects\AIAIENGAGE\iengage-backend\src\main\java\com\aia\iengage\controller\MobileApiController.java:27: annotation org.springframework.web.bind.annotation.CrossOrigin is missing <clinit>
[ERROR] /C:/Projects/AIAIENGAGE/iengage-backend/src/main/java/com/aia/iengage/controller/CmsApiController.java:[38,1] C:\Projects\AIAIENGAGE\iengage-backend\src\main\java\com\aia\iengage\controller\CmsApiController.java:38: annotation org.springframework.web.bind.annotation.CrossOrigin is missing <clinit>
[ERROR] /C:/Projects/AIAIENGAGE/iengage-backend/src/main/java/com/aia/iengage/controller/CmsNewsController.java:[54,1] C:\Projects\AIAIENGAGE\iengage-backend\src\main\java\com\aia\iengage\controller\CmsNewsController.java:54: annotation org.springframework.web.bind.annotation.CrossOrigin is missing <clinit>


7 years ago
Hi Dave,

I attached the pom.xml as below.  Please check and comment.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.aia</groupId>
 <artifactId>iengage</artifactId>
 <packaging>war</packaging>
 <version>0.0.1-SNAPSHOT</version>
 <name>AIA iEngage API Server</name>
 <url>http://maven.apache.org</url>;
 <profiles>
<profile>
<id>dev</id>
<build>
<resources>
<resource>
<directory>src/main/resources/dev</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
</profiles>
 <properties>
<!-- -->
<java.version>1.6</java.version>
<spring.version>4.2.1.RELEASE</spring.version>
<slf4j.version>1.7.12</slf4j.version>
<org.log4j-version>1.2.17</org.log4j-version>
<javax.servlet-version>3.1</javax.servlet-version>
<org.springsecurity-version>4.0.2.RELEASE</org.springsecurity-version>
<org.hibernate-version>5.0.1.Final</org.hibernate-version>
<com.fasterxml-jackson-core-version>2.6.2</com.fasterxml-jackson-core-version>
<com.microsoft.sqlserver-version>4.0</com.microsoft.sqlserver-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<basedir>C:\\Projects</basedir>
 </properties>
 <dependencies>
 
   <dependency>
     <groupId>com.microsoft.sqlserver</groupId>
     <artifactId>sqljdbc4</artifactId>
     <version>${com.microsoft.sqlserver-version}</version>
     <scope>compile</scope>
   </dependency>
 
<!--  Junit 4.12 -->      
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>4.12</version>
     <scope>test</scope>
   </dependency>
 
  <!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>

<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>

<!-- Spring Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${org.log4j-version}</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${org.hibernate-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${org.hibernate-version}</version>
</dependency>

<!--  Jackson for JSON parsing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${com.fasterxml-jackson-core-version}</version>
</dependency>

<dependency>
    <groupId>org.json</groupId>
    <artifactId>json</artifactId>
    <version>20160212</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate4</artifactId>
<version>${com.fasterxml-jackson-core-version}</version>
</dependency>

<!-- JDBC -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>

<!-- PostgreSQL
<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>9.4-1203-jdbc41</version>
</dependency>
-->

<!-- JWT -->
<dependency>
    <groupId>io.jsonwebtoken</groupId>
    <artifactId>jjwt</artifactId>
    <version>0.6.0</version>
</dependency>

<!-- Later add:begin -->
<!-- Apache Commons FileUpload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>

<!-- Apache Commons IO -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!-- Later add:end -->


 </dependencies>
   <build>
       <plugins>
           <plugin>
               <artifactId>maven-eclipse-plugin</artifactId>
               <version>2.9</version>
               <configuration>
                   <additionalProjectnatures>
                       <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                   </additionalProjectnatures>
                   <additionalBuildcommands>
                       <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                   </additionalBuildcommands>
                   <downloadSources>true</downloadSources>
                   <downloadJavadocs>true</downloadJavadocs>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.5.1</version>
               <configuration>
                <forceJavacCompilerUse>true</forceJavacCompilerUse>
                   <source>${java.version}</source>
                   <target>${java.version}</target>
                   <compilerArgument>-Xlint:all</compilerArgument>  
                   <compilerArgument>-Xlint:-serial</compilerArgument>
                   <showWarnings>true</showWarnings>
                   <showDeprecation>true</showDeprecation>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>exec-maven-plugin</artifactId>
               <version>1.2.1</version>
               <configuration>
                   <mainClass>org.test.int1.Main</mainClass>
               </configuration>
           </plugin>
       </plugins>
   </build>
   
</project>


Thanks
Benson
7 years ago
Hi Dave,

Yes, I do.  Actually, If I use the eclipse itself built-in compiler to compile, there is no error.  However, if I choose Maven build in the eclipse, the maven build will clean up the classes in the target and then re-compile , it will throw such compilation errors.

Please help

Thanks
Benson
7 years ago
Hi all,

I am using jdk 6.  and the pom.xml is
like
...
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.5.1</version>
               <configuration>
                <forceJavacCompilerUse>true</forceJavacCompilerUse>
                <compilerVersion>1.6</compilerVersion>
                   <source>1.6</source>
                   <target>1.6</target>
                   <compilerArgument>-Xlint:all</compilerArgument>  
                   <compilerArgument>-Xlint:-serial</compilerArgument>
                   <showWarnings>true</showWarnings>
                   <showDeprecation>true</showDeprecation>
               </configuration>
           </plugin>
...

However, I still the below compilation errors.  Please help how to fix it.

   annotation org.springframework.web.bind.annotation.CrossOrigin is missing <clinit>


Thanks
Benson
7 years ago
Hi all,

I am new to Grails 3 application. I just created a Grails 3 application on IntelliJ. But this grails 3 application needs redis access so I need to install redis plugin there. I know that Grails 3 is very different from Grails 2.x even the plugin installation. I did google research about how to install redis plugin into Grails 3 application, unfortunately, most of the result are just the installation on Grails 2.x.

If there is Grails expert, please kindly teach me how to install redis plugin on to Grails 3 application.


Thanks
8 years ago
Hi,

Usually, it is configured in spring security application like login-processing-url="/processLogin" , but I never can see where /processLogin is defined. Please advise how it works.


Thanks
9 years ago
Hi all,

I configured spring security in my web app to authenticate against the LDAP server via ActiveDirectoryLdapAuthenticationProvider class, like

<beans:bean id="ldapActiveDirectoryAuthProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
<beans:constructor-arg value="${login.ad.domain}" />
<beans:constructor-arg value="${login.ad.host}" />
<beans:property name="authoritiesMapper" ref="grantedAuthoritiesMapper" />
<beans:property name="useAuthenticationRequestCredentials" value="true" />
<beans:property name="convertSubErrorCodesToExceptions" value="true" />
<beans:property name="userDetailsContextMapper">
<beans:bean class="org.springframework.security.ldap.userdetails.InetOrgPersonContextMapper" />
</beans:property>
</beans:bean>

And then I login to the web app and got the error User must reset password. As convertSubErrorCodesToExceptions has been set to true, it is supposed to throw a specific exception. I would like to handle this exception but don't know how to handle it or where to handle it. I have google in the net but got no answer or even similar answer.


Please advise if any expert of you all can help.


Thanks
9 years ago
Hi all,

I am looking for a popular/common UI testing framework. Can anyone give me suggestions?


Thanks
9 years ago
Hi

Sorry, I used wrong wordings. Do you mean to clone the entire box with application plus databases into another box for another countries?


Please elaborate. I am new to here.


Thanks
9 years ago
Hi all,

I have a question about a global application strategy and would like to seek for suggestion from the experts of all over the world.

Scenario :

Suppose we developed application(whatever web or core java). And this application will be used by different countries. From the infrastructure point of view, I would like to deploy one instance for one country on the same box. However, it will be commented that if the box is down, it will give impact to all the countries. However, if I use one instance on one box for one country, there will have some data integrity of the database.

I am not so sure the common practice of this in the enterprise especially those global organization like some global banks.
It is appreciated if anyone can give suggestions.


Thanks a lot
9 years ago
Hi all,

I just found that if the string contains < or >, then after objectmapper.readvalue, the < will be encode to < and > respectively. I don't want the objectmapper to convert < and > into < and >. Is there is any to prevent from converting it?

Please help


Thanks
Benson
Hi,

I got a strange scenario.

I would like to setup a Properties object programmatically because those values are retrieved from the database. Then these properties values will be then accessed by a spring bean which has been setup in an xml file, e.g. <bean id="ABC" class="org.test.ABC">
<property name="queue" value="${queue_name}"/>
</bean>


where queue_name key is setup programmatically in advanced as its value is retrieved from database.

Please help how to implement it.


Thanks
11 years ago
Hi,

I have an issue to set the lazy load to true on multiple files. If I do like the followings<





Does it mean the beans defined in B.xml and C.xml are also lazy-init=true?

Please help

11 years ago