Win a copy of Learning Java by Building Android Games this week in the Android forum!

Himai Minh

Ranch Hand
+ Follow
since Jul 29, 2012
Cows and Likes
Cows
Total received
12
In last 30 days
0
Total given
0
Likes
Total received
68
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 Himai Minh

Hi, I finally contact Microsoft Azure tech support.
They told me to add an inbound port 10000 to the networking panel in the Azure VM instance.
Now, the ODBC driver can connect to the DB instance in the VM instance.
2 weeks ago
Hi, I have an public IP server address.
I tried to use Hortonworks ODBC driver to connect to it.
I don't know why I got this error:
FAILED!

[Hortonworks][Hardy] (34) Error from server: connect() failed: errno = 10060.

I cannot find a solution from Google search. I have already turned off the firewall and anti-virus to avoid any problems.
3 weeks ago
Hi, in Spring's documentation https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#aop,


The execution of any method defined in the service package or one of its sub-packages:
execution(* com.xyz.service..*.*(..))


I don't understand why there are two dots behind the service, like this com.xyz.service..  ?
Why it is not just one dot after service like this ?
1 month ago
Hi, the Spring's documentation  https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#aop,

is the pointcut expression for any public method.
But why it is not  ?
Why there are two * ?
1 month ago
Hi,
Currently, I am using Eclipse Oxygen. If i uninstall it   and try to install Elcipse SimRel (the latest) , I will run into a risk that I cannot install SimRel and lose my Oxygen.
Maybe, just wait for a couple of days and try again.

Usually, we can install different versions of Eclipse on the same machine, so having Oxygen and SimRel on the same machine should be fine.
1 month ago
The init() method is to initialize some variables of a bean. I don't think developers won't need a constructor (or the new operator) to instantiate a bean.

The bean is created by injection using @Autowired to inject the bean. The container will create the bean, not the developer.
Also, a bean should have a non-argument constructor where no variables are initialized in this constructor.
init() method is called after the bean is constructed. Sometimes, we don't want some variables to be initialized during bean's instantiation.

For more information about the Aware interface, refer to this example https://www.baeldung.com/spring-bean-name-factory-aware
BeanPostProcessors are for call back method during a lifecycle of a bean, refer to these examples https://www.tutorialspoint.com/spring/spring_bean_post_processors.htm and https://stackoverflow.com/questions/29743320/how-exactly-does-the-spring-beanpostprocessor-work
1 month ago
Hi, I have been trying to install the latest Eclipse throughout the whole morning. I downloaded the installer from a mirror site. I ran it and got the following error.
I guess the mirror site is down at this moment.
org.apache.http.client.ClientProtocolException
  at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:839)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
  at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.performConnect(HttpClientRetrieveFileTransfer.java:1084)
  at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.access$0(HttpClientRetrieveFileTransfer.java:1075)
  at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer$1.performFileTransfer(HttpClientRetrieveFileTransfer.java:1071)
  at org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:74)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.apache.http.client.CircularRedirectException: Circular redirect to 'http://eclipse.mirror.rafal.ca/releases/2018-09/201809191002/content.xml.xz'
  at org.apache.http.impl.client.DefaultRedirectStrategy.getLocationURI(DefaultRedirectStrategy.java:177)
  at org.apache.http.impl.client.DefaultRedirectStrategy.getRedirect(DefaultRedirectStrategy.java:221)
  at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1083)
  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:514)
  at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
  at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.performConnect(HttpClientRetrieveFileTransfer.java:1084)
  at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.access$0(HttpClientRetrieveFileTransfer.java:1075)
  at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer$1.performFileTransfer(HttpClientRetrieveFileTransfer.java:1071)
  at org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:74)
  ... 1 more
1 month ago
Hi, Spring in Action 5th edition has not been released until Nov 30th, 2018.
But the code are released on Git Hub.
However, some of the codes have something missing and cannot be compiled.
I need to write comments on the code's Git Hub.
1 month ago
Hi,
Is Spring in Action (5th edition) focus on the exam?
Is the "Pivotal Certified Professional Spring Developer Exam: A Study Guide" useful for Spring 5? I think it is only for Spring 4 exam.

Is there any mock exam available for practice?
1 month ago
Hi, is this the right book , "Pivotal Certified Professional Spring Developer Exam: A Study Guide",  for Spring 5 professional exam ?  
As I checked, it targets for only Spring 3 and 4 exam .
1 month ago
Hi, I am planning to take Spring professional exam.
Are Spring JMX, JMS and Microservices on this exam? They are not specified in the official  study guide, but they are covered in the Apress's Pivotal Certified Professional Spring Developer book.
1 month ago
You may want to install Google Chrome and also install the add-on Postman. Then, run the Postman and choose JSON as the request body format.
1 month ago
Hi, Tim,
You mean the object returned from @Bean method is not a bean?
But in the specification it says:


   2.2. @Bean
@Bean is a method-level annotation and a direct analog of the XML <bean/> element. The annotation supports most of the attributes offered by <bean/>, such as: init-method, destroy-method, autowiring, lazy-init, dependency-check, depends-on and scope.
2.2.1. Declaring a bean
To declare a bean, simply annotate a method with the @Bean annotation. When JavaConfig encounters such a method, it will execute that method and register the return value as a bean within a BeanFactory. By default, the bean name will be the same as the method name (see bean naming for details on how to customize this behavior). The following is a simple example of a @Bean method declaration:
@Configuration
public class AppConfig {
    @Bean
    public TransferService transferService() {
        return new TransferServiceImpl();
    }
}


Obviously, @Bean = <bean> in the configuration XML.
1 month ago
Hi, Tim. Thanks for the reply about bean factory.
In the above example from the Spring documentation, there are codes like this:

The clientService  object is not instantiated by Spring injection, but it is created by new operator. So, clientService is outside the scope of Spring. But the method is annoatation with @Bean.
So, is clientService considered as a Spring bean?
1 month ago