« first day (585 days earlier)      last day (1653 days later) » 

1:47 AM
Hi anyone, can you refer to my post? How can I set the initial date in the text box for today's date? Here's my code stackoverflow.com/questions/32067201/…
 
 
3 hours later…
5:12 AM
@Jens @Tajinder good morning
 
Good mornig. Yes : See the documentation of hashCode from object class: " * As much as is reasonably practical, the hashCode method defined by
* class {@code Object} does return distinct integers for distinct
* objects. (This is typically implemented by converting the internal
* address of the object into an integer, but this implementation
* technique is not required by the
* Java<font size="-2"><sup>TM</sup></font> programming language.)
"
@greenhorn Good morning. How are you today?
@NurWafiqa You have already an accepted answer. So looks as obsolete.
@Tajinder Good morning
Good mornig. Yes : See the documentation of hashCode from object class: " * As much as is reasonably practical, the hashCode method defined by
* class {@code Object} does return distinct integers for distinct
* objects. (This is typically implemented by converting the internal
* address of the object into an integer, but this implementation
* technique is not required by the
* Java<font size="-2"><sup>TM</sup></font> programming language.)
"
 
@Jens fine friend, what about you?
 
@greenhorn I am fine too.
 
@Jens good morning
 
morning everyone!
 
5:25 AM
@SpringLearner Good morning. Do you read the above post?
@JudeNiroshan Good morning
 
@Jens yes,thanks
 
@SpringLearner You are welcome
 
hashcode() should return unique integer...
 
@SpringLearner The method is native so i can't give you the algorithm
 
that will be used to decide in which bucket that the element is going to be available
 
5:44 AM
Is there anyone around with PHP Doctrine experience?
 
@NathanBirrell Sorry i am not
 
@NathanBirrell worked only with plain PHP
 
6:28 AM
@Jens for the same case i am getting error in one page and not getting that error in another page
if (USER_TYPE == null) {
System.out.println("#### user type check for null in menu "+USER_TYPE);

%>

<script>
window.location = '/ezeepayJdbc/Invalid-User';
</script>
<% }
this succeeding line is printed
 
@greenhorn What is the error message?
 
#### user type check for null in menu "+USER_TYPE
but window not moving to this "Invalid-User'" page
 
@greenhorn I would suggest you use jstl instead of writing java code in jsp page
 
error message is here pastebin.com/R82K507F @Jens
@SpringLearner any reasons @SpringLearner
 
@greenhorn is dispute_jsp.java one of your JSP's?
 
6:32 AM
@Jens yes that's a compiled jsp jens
 
@greenhorn can you show line 191 of the compiled jsp?
 
where could i see that compiled jsp? @Jens
 
@greenhorn in tomcats work directory
 
C:\Program Files\apache-tomcat-7.0.53_2\apache-tomcat-7.0.53\work here there is no file @Jens
 
@greenhorn Do you use a standalone tomcat or a tomcat in eclipse?
 
6:39 AM
E:\Apache Software Foundation\Tomcat 8.0\work\Catalina\localhost @Jens
under local host it has three folder
docs, ROOT, manager
 
@greenhorn can you search for the filename in this dir?
 
i found this only @Jens
 
@greenhorn Do you run the project in this tomcat?
 
@Jens yes
 
ok then it must be in this work\Catalina\localhost path
@greenhorn Can you search it there?
 
6:46 AM
all these have no files inside @Jens
docs, ROOT, manager
 
@greenhorn and you have copied the war file to this tomcats webapp folder?
 
i have installed tomcat in my eclipse @Jens
 
@greenhorn Ok then the work directory is in eclipse workspace in .metadata/.plugins/org.eclipse.wst.server.core/tmp0/work
 
@Jens this is the line 191 code
if(USER_TYPE.equals("ADM") || USER_TYPE.equals("PWR"))
 
@greenhorn There is a null check missing. As you shown in your other jsp USER_TYPE is null. So you get a NPE here
 
6:57 AM
<body>

<jsp:include page="/Access Privelege/menu2.jsp" />
<%
String USER_TYPE = (String) session.getAttribute("user_type");

// URL url = new URL(request.getHeader("referer"));
String usr_name=(String)request.getSession().getAttribute("user_name");
%>


<% if(USER_TYPE.equals("ADM") || USER_TYPE.equals("PWR"))
{ %>
menu2.jsp:
 
@greenhorn or change it to: if("ADM".equals(USER_TYPE) || "PWR".equals(USER_TYPE))
 
if (USER_TYPE == null) {
System.out.println("#### user type check for null in menu "+USER_TYPE);

%>

<script>
window.location = '/ezeepayJdbc/Invalid-User';
</script>
<% }%>
before reaching this code if(USER_TYPE.equals("ADM") || USER_TYPE.equals("PWR"))
menu2.jsp will be called
in menu2.jsp if USER_TYPE == null it should move to /ezeepayJdbc/Invalid-User
 
Ok then use `<%
String redirectURL = "/ezeepayJdbc/Invalid-User";
response.sendRedirect(redirectURL);
%>`to make a redirect
 
but the problem is it shows NPE in dispute.jsp
how could it be possible @Jens
 
@greenhorn I do not know. Where you call this jsp?
 
7:05 AM
here is my dispute.jsp pastebin.com/crJbWYLb @Jens
 
@greenhorn But where you call it in your workflow?
 
here is my menu2.jsp pastebin.com/hwGxst8C
 
@greenhorn on other thin. You make a null check in your menu2.jsp on USER_TYPE and the you get the user_type again String USER_TYPE = (String) session.getAttribute("user_type"); after the null check. i think it is no good practice
@greenhorn Please change the redirect as i suggested and try again.
 
i tried redirect too but it shown the same error @Jens
in my log i am getting error after this print statement in menu2.jsp @Jens
#### user type check for null in menu "+USER_TYPE
 
@greenhorn That is not an error. That is your sysout
 
7:10 AM
@Jens i know that i am saying that after printing this line it goes to error
 
@greenhorn The NPE?
 
yes
 
@greenhorn But i do not understand when the dipute_jsp is called? is it called in your controller?
 
@Jens how to get the user_type value in dispute .jsp without getting them using session
@Jens it will be called by a href
 
@greenhorn you can use it as a paramter
 
7:14 AM
@Jens i set this user_type value in session and i will access it in any JSP where i need that value that's why i stored that in session jens
 
@greenhorn Ok and you are sure that you have the same session in all jsp's?
@Tajinder good morning
 
7:38 AM
@Jens same session ?
i think i have the same only
 
@jens good morning , @greenhorn good morning.
 
@Tajinder I fond an other sample project for your problem.
I think you can not autowire the entitymanager in yor case. It will be set by the configuration. Read about docs.spring.io/spring-data/jpa/docs/current/api/org/…
 
@jens ... thanks.... i will read it.
@jens... can you please share that sample project please?
 
@greenhorn Where you put the user type into your session?
 
@Jens in controller
 
7:50 AM
@greenhorn can you show the controller?
 
:25172355
@RequestMapping(value = "/login", method = RequestMethod.POST)
public ModelAndView eusers(ModelAndView model, HttpServletRequest request,HttpServletResponse response ) {
try {
System.out.println("####### in login controller ");
String firstname = request.getParameter("firstname");
String password = request.getParameter("password");
System.out.println("####### uname & pwd "+firstname+" "+password);
String[] user_type = userDAO.logCheckUser(firstname, password);
System.out.println("####### user_type value in jsp "+user_type[0]);
 
@greenhorn Is your controller configured with @Scope("session")?
 
@Jens i mentioned this only
HttpSession session =request.getSession();
 
@jens .... in Git code they are using hibernate database HSQL @Bean
public JpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setShowSql(true);
jpaVendorAdapter.setGenerateDdl(true);
jpaVendorAdapter.setDatabase(Database.HSQL);
return jpaVendorAdapter;
}
but i will use mysql db .. so i need to change here right?
adapter remains same ?
@jens i changed it to jpaVendorAdapter.setDatabase(Database.MYSQL);
 
8:04 AM
@Tajinder Looks ok.
 
@Jens why can't we create session directly with this
HttpSession session =request.getSession();
 
@greenhorn because the standard behavier of the controller is Scope request as i know. So the session is gone after the response is send.
 
@jens .... i have moved further but still i have one problem how i will access repository from controller?
@RestController
@RequestMapping("/Order")
public class OrderController {
@Autowired
OrderRepository order;
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.gatcbiotech.blueberry.crud.repository.order.OrderRepository com.gatcbiotech.blueberry.crud.controller.OrderController.order; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderRepository': Injection of persistence dependencies failed; nested exception is org.springframework.bea
 
@Tajinder Can you show your new config?
where is entityManagerFactory defined?
 
@Autowired
JpaVendorAdapter jpaVendorAdapter;

@Bean
public DataSource nextGenDataSource() {
return DataSourceBuilder.create()
.url("jdbc:mysql://192.168.30.36/blueberry")
.driverClassName("com.mysql.jdbc.Driver").username("blueberry")
.password("blueberryPWD").build();
}

@Bean(name = "nextGenEntityManager")
public EntityManager entityManager() {
return nextGenEntityManagerFactory().createEntityManager();
}

// @Bean
// public DataSource nextGenDataSource() {
// return DataSourceBuilder.create().url(url)
@jens... i think i need to have another layer between repository and controllerr...for example Service and there i can perform perform my operations
 
8:12 AM
@Tajinder but also i think you have to add the beean name to your nextGenEntityManagerFactory.
 
@jens ...yes i added
@jens... first of all i am just trying to connect with 1 database
 
@Tajinder ok sounds good.
 
@jens i asked this question here and there was this comment ,which i didnot understand
0
Q: Spring JPA Autowiring failing after using EntityManagerFactory

Tajinderhere is my exception trace org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.gatcbiot...

 
@Tajinder Sorry i do not understand the points of spring boot to, because i haven't used it.
 
@Jens thanks jens
 
8:21 AM
@greenhorn you are welcome my friend
 
@jens ....i have these 2 beans
@Bean(name = "nextGenEntityManager")
public EntityManager entityManager() {
return nextGenEntityManagerFactory().createEntityManager();
}


@Bean
public EntityManagerFactory nextGenEntityManagerFactory() {
// HibernateJpaVendorAdapter vendorAdapter = new
// HibernateJpaVendorAdapter();
// vendorAdapter.setGenerateDdl(true);
// vendorAdapter
// .setDatabasePlatform("org.hibernate.dialect.MySQL5Dialect");
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
i am accessing it this way @PersistenceContext(name = "nextGenEntityManager")
protected EntityManager nextGenEntityManager;
 
@Tajinder But in the example the Entitymanger is never autowired as you can see. It will be set with the annotation.
 
i am getting
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory] is defined: expected single matching bean but found 2: nextGenEntityManagerFactory,entityManagerFactory
 
8:43 AM
@Jens have you worked in EJB?
 
@SpringLearner No sorry.
 
9:11 AM
@Jens do you have any idea what it is and how is it different from spring?
 
@jens Sir I want to use a package -import psoft.hsphere.resource.registrar . but this package show error. why
 
@RakeshRaka Which error?
 
@Jens thanks,I am also googling about it
 
@jens Error is psoft is not find.
 
@RakeshRaka Looks like you do not have the coresponding jar in your classpath
 
9:26 AM
@jens yes right. but I don't know the name of jar file ,that is include lib folder .Main problem is that jar file name.
 
@RakeshRaka Sorry but this you have to know if you want to work with it.
 
9:46 AM
@Jens have you worked on spring AOP?
 
10:11 AM
@SpringLearner Yes.
 
@Jens can you please guide me how to do a small project in AOP?
 
@SpringLearner What do you mean with small project in AOP? AOP will only use in projects to do common things like logging or for interceptor or somethink like this.
 
@Jens if some one asks me have you worked on spring AOP then how should I answer?
 
@SpringLearner Look into some tutorials and learn the basics on spring aop site and say yes.
 
@Jens in which project you have used AOP?
 
10:22 AM
@SpringLearner In mostly all spring projects.
 
@jens : i have question
 
@SpringLearner you can use it to add logging arround methods. Without change all your methods. Or for standard error handling
@Tajinder Then ask
 
@Jens please give more info
 
@jens .... my server starts fine if i use this public class OrderRepository implements JpaRepository<Order, Long> {
instead of // public class OrderRepository extends AbstractRepository<Order> implements
// OrderRepositoryInterface {
 
hi guys one eclipse related question, I am trying out groovy and getting exception when I add watch to expression windows while evaluating that expression. When I see eclipse logs, it says it cant see find some JARs. Any one knows where to put JARs that eclipse itself require?
 
10:24 AM
OrderRepositoryInterface is extending JPARepository Interface itself..
now i have used
public class OrderRepository implements JpaRepository<Order, Long> {
and deleted AbstractRepository and OrderRepositoryInterface,,, other wise it gives same eexception
 
@SpringLearner which kind of infos?
@Tajinder OK
 
@jens... so something is wrong with these Abstract Repository and OrderRepositoryInterface....
@Jens any input?
 
@Tajinder I think you can not autowire the entitymanager factory as you tried it in the AbstractRepository.
 
@jens i am not autowiring it anymore
@jens i am first trying with only 1 db...
 
@Tajinder Not in Abstractrepository?
@Tajinder Can you show the related code?
 
10:31 AM
@jens @Repository
public abstract class AbstractRepository<T> implements JpaRepository<T, Long> {}
i have just commented everything inbetween so it is just clean blank class
public interface OrderRepositoryInterface extends JpaRepository<Order, Long> {
Order findById( Long id );
}
and @Repository
public class OrderRepository extends AbstractRepository<Order> implements
OrderRepositoryInterface {
// public class OrderRepository implements JpaRepository<Order, Long> {
// @Autowired
// public OrderRepository(OrderRepositoryInterface repositoryInterface) {
// this.repositoryInterface = repositoryInterface;
// }

@Override
public Page<Order> findAll(Pageable pageable) {
// TODO Auto-generated method stub
return null;
}

@Override
public <S extends Order> S save(S entity) {
// TODO Auto-generated method stub
@jens Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.data.jpa.repository.JpaRepository com.gatcbiotech.blueberry.crud.controller.OrderController.order; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderRepositoryInterface': Cannot create inner bean '(inner bean)#dd0587' of
 
@Tajinder It is an empty And this gives you an error?
 
yes
 
@Tajinder try to remove the @repository annotation fom the abstract class
@Tajinder Think that is not needed here
 
@jens ...yieh still same error
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.data.jpa.repository.JpaRepository com.gatcbiotech.blueberry.crud.controller.OrderController.order; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderRepositoryInterface': Cannot create inner bean '(inner bean)#dd0587' of type
 
@Jens how will i know if a spring project is using spring aop?
 
10:35 AM
@jens ...my question is when OrderRepository implements JPARepository and i delete both these (abstract and interface) then things work fine. how spring knows about them in that scenario ?
 
@SpringLearner If the project uses aop then aping-aop.jar must be in the classpath.
@Tajinder Sorry can't get you
 
@Jens by seeing xml files or by seeing the classes,methods is it possible to know?
 
@SpringLearner Yes it is also possible. Normally in code you have classes which are annotated with @Aspect
That is aop functionality
also in the xml file you can find a reference to aop for instance <aop:aspectj-autoproxy/>
@SpringLearner or <aop:config> if the aspects are configured in the xml file.
@SpringLearner But the easiest way is to look in the maven pom file and look if you can find the spring-aop<version>.jar
 
@Jens is it necessary for to use AOP in transaction management?
Actually i am going thorough some articles and all give the example of transaction management?
 
@SpringLearner As i know the spring transaction management works with aop yes.
@SpringLearner But transaction managemant is implemented by spring not by your own.
 
10:44 AM
@Jens actually I had a requirement in my project to insert in 3 tables
 
@SpringLearner In one transaction i think?
 
if suppose successful insertion is done in 2 tables but while inserting in 3rd table
some error occured
so in this I have to rollback the inserted tables
and for that purpose I used @transactional
 
@SpringLearner Yes sounds good
 
@Jens but I did not use AOP here
 
@SpringLearner No you do not need it. Because it will "done" by the @transactionl annotation
Spring build a proxy around your class using aop.
@SpringLearner see docs.spring.io/spring/docs/current/spring-framework-reference/… maybe it helps you to understand
@SpringLearner The whole documentation you can find here: docs.spring.io/spring/docs/current/spring-framework-reference/…
 
11:05 AM
@SpringLearner So you understand the image?
 
@jens ...i found problem... now i am able to use 1 database and can use native sql query
 
@Tajinder What was the problem?
 
@jens some stupid problem....
package it should use to scan repository was wrong... so thats why it was trying to see everything in given package as repository
even controller or what ever there was in that wrong package.
 
@Tajinder That is one terrible thing in spring. You can make so many errors with the path to scan
 
@jens... yes you are right,
 
11:14 AM
@Tajinder But great that you found it
 
@jens.... yes after 2 days and ofcourse your valuable time too... but all is good that ends well...now i will try it with 2 db's
 
@Tajinder now it should be easy ;)
 
@jens... i hope so ... but now i know many things about spring jpa :)
 
@Tajinder That's good to know if i have questions with it ;)
 
12:09 PM
@jens ....now i was trying to configure my another config file but minor spring exception is coming
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.orm.jpa.JpaVendorAdapter com.gatcbiotech.blueberry.crud.GatcDbConfig.jpaVendorAdapter; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nextGenDbConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.orm.jpa.JpaVendorAdapter com.gatcbiotech.blueberry.crud.NextGenDbConfig.jpaVendorAdapter; nested except
********************my GatcDBConfig
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = "com.gatcbiotech.blueberry.crud.repository.running", entityManagerFactoryRef = "gatcLimsEntityManagerFactory", transactionManagerRef = "transactionManagertwo")
@PropertySource("classpath:application.properties")
public class GatcDbConfig {

@Value("${spring.datasourceGatcLims.driver-class-name}")
String driverClassName = "";
@Value("${spring.datasourceGatcLims.url}")
String url = "";
@Value("${spring.datasourceGatcLims.username}")
**********************And the first configuration,it works fine....
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = "com.gatcbiotech.blueberry.crud.repository.running", entityManagerFactoryRef = "nextGenEntityManagerFactory", transactionManagerRef = "transactionManagerOne")
@PropertySource("classpath:application.properties")
public class NextGenDbConfig {

@Value("${spring.datasourceNextGenLims.driver-class-name}")
String driverClassName = "";
@Value("${spring.datasourceNextGenLims.url}")
String url = "";
@Value("${spring.datasourceNextGenLims.username}")
 
@Tajinder You need two differend JpaAdapter or the JpaAdapter has to be scope prototype i think
 
@jens okk
@jens ... i tried that way
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: gatclimsDataSource,nextGenDataSource
@Bean
@Scope("prototype")
public JpaVendorAdapter jpaMyGatcVendorAdapter() {
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setShowSql(true);
jpaVendorAdapter.setGenerateDdl(true);
jpaVendorAdapter.setDatabase(Database.MYSQL);
return jpaVendorAdapter;
}
@Bean
@Scope("prototype")
public JpaVendorAdapter jpaNextGenVendorAdapter() {
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setShowSql(true);
jpaVendorAdapter.setGenerateDdl(true);
jpaVendorAdapter.setDatabase(Database.MYSQL);
return jpaVendorAdapter;
}
 
@Tajinder Oh you had already two JpaVendorAdapter
Where you autowire the adapter?
 
in the same configuration file
in Gatcdbconfig
@Autowired
JpaVendorAdapter jpaMyGatcVendorAdapter;
in nextgenconfig
@Autowired
JpaVendorAdapter jpaNextGenVendorAdapter;
 
@Tajinder Why you autowire it. You can simply call the method.
 
12:18 PM
yes, but i thought i will call in 1st using method and in another i will autowire?
 
You do not need to autowire it. If you want to autowire it, use @Qualifier for make it unique
 
@jens okay
 
@Tajinder And you can remove the scope
 
No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: gatclimsDataSource,nextGenDataSource
still it says
now i am creating 2 different methods, i am not Autowiring, just calling methods
@jens now i have this in both classes
@Bean
@Qualifier
public JpaVendorAdapter jpaMyGatcVendorAdapter() {
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setShowSql(true);
jpaVendorAdapter.setGenerateDdl(true);
jpaVendorAdapter.setDatabase(Database.MYSQL);
return jpaVendorAdapter;
}
with different names
and i am calling them as
factoryBean.setJpaVendorAdapter(jpaMyGatcVendorAdapter());
and in another as factoryBean.setJpaVendorAdapter(jpaNextGenVendorAdapter());
 
@Tajinder and same exception?
 
12:24 PM
@jens... yes...
 
There is a problme with the datasource.
@Tajinder Do you autowire it also?
 
@jens... no i am not autowiring
there should not be any problem because when i comment one config file.... then its run fine
 
@Tajinder Yes spring finds two datasources and do not know wich it should use.
@Tajinder The question is where
 
@okk.
 
@Tajinder Have you removed the property jpaadapter with the autowire annotation?
 
12:27 PM
@jens yes
@jens
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.dataSource; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: gatclimsDataSource,nextGenDataSource
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
*****************First Bean
@Bean
public DataSource nextGenDataSource() {
return DataSourceBuilder.create().url(url)
.driverClassName(driverClassName).username(userName)
.password(password).build();
}

@Bean
@Primary
public LocalContainerEntityManagerFactoryBean nextGenEntityManagerFactory() {
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();

factoryBean.setDataSource(nextGenDataSource());
factoryBean.setJpaVendorAdapter(jpaNextGenVendorAdapter());
factoryBean.setPackagesToScan(R.nextGenDB_PACKAGE);
*************************Second bean
@Bean
public DataSource gatclimsDataSource() {
return DataSourceBuilder.create().url(url)
.driverClassName(driverClassName).username(userName)
.password(password).build();
}

@Bean
public LocalContainerEntityManagerFactoryBean gatcLimsEntityManagerFactory() {
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();

factoryBean.setDataSource(gatclimsDataSource());
factoryBean.setJpaVendorAdapter(jpaMyGatcVendorAdapter());
factoryBean.setPackagesToScan(R.GatcDB_PACKAGE);
 
@Tajinder Have you double checked the annotations component scan and so on?
 
@jens.... yes i have checked.... everything works fine when i run them 1 at a time by comment out the other... but both together not working.
 
@Tajinder and if you add a name to the datasource bean as in the example?
 
@jens still same...
 
@Tajinder Can you add a breakpoint in DefaultListableBeanFactory.doResolveDependency to find out which bean the datasource needed?
 
12:41 PM
@jens ok
 
@Tajinder Looks intresting. So it works this way?
@Tajinder I have to leave today earlier. I wish you a nice rest of the day. Bis morgen.
 
@jens... ok viel spass... Bis Morgen
 
 
3 hours later…
3:49 PM
@Jens hi
thanks
i was asked in an interview can we open excel by using sendRedirect()
I said no, you can open only jsp/html page using it
then he asked why its not possible?
and 2nd question is can we call destroy() inside init() of servlet?
 
 
2 hours later…
6:20 PM
@SpringLearner Hi. I would say it is possible. You send a redirect, so you have a new requesz with a new response. and the new response can have a new content-type.
@SpringLearner Hi think it makes no sence to destroy a servlet in init. I think this method should only be called by the servlet container.
But possible is it. it is a public method.
 

« first day (585 days earlier)      last day (1653 days later) »