Rajiv KumarRai

Ranch Hand
+ Follow
since Feb 25, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rajiv KumarRai

Greetings

Please let me understand what do we mean by optional methods in Collection interface.(e.g add, addAll etc)
If we write a class that implements the Collection interface are we required to provide implementations
for the optional methods?

Thanks
9 years ago




When I try to execute the above spring example, it gives the following error

log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "Main Thread" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employee' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.rajiv.Employee]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.rajiv.Employee.<init>()
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:946)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:892)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:84)
at com.rajiv.Test.main(Test.java:10)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.rajiv.Employee]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.rajiv.Employee.<init>()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:69)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:939)
... 13 more
Caused by: java.lang.NoSuchMethodException: com.rajiv.Employee.<init>()
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:64)
... 14 more


Please help me understand why default constructor is needed when we are using the setter injection

Thanks
9 years ago
Hi,
Can someone please tell me about some basic level good resources to learn "Annotations"
Also can I know why were annotations introduced in Java. What was the need for
them?

Thanks
9 years ago



The above code shows error in subclass constructor with the following error message
"Implicit super constructor Test1() is undefined. Must implicitly invoke another constructor."

Please help me understand the cause of the error.
Thanks
9 years ago
What changes can be made to the above code(using join method) so that the threads finish in the following order

Thread One
Thread Two
Thread Three
Main Thread

I guess than I can better understand what join does


Please help me understand what is happening in the above code and how is it happening.
Regarding the join() method, what is joined by what. I am confused by the name of the
method. What makes main thread wait for the child threads. Is it because the the 3 child
threads call join methods inside the main thread. And what changes would be required
if we want to ensure that threads finish in order

I mean like

Child thread One
Child thread Two
Child thread Three
Main thread
Hi,

I wish to know whether the SQL Joins syntax has changed for the latest versions of Oracle database?

I was reading SQL from an Oracle 9i book and there SQL Joins syntax was without any clauses or keywords

but in w3schools SQL tutorial specific keywords like INNER JOIN, etc are being used.

Hence please tell me which syntax I should follow.

Thanks
Hi,

I wish to learn how to use web services using Java/J2EE platform.
So please guide me how to get started on web services.

Also please tell me which are the most widely used APIs/tools(e.g JAX-WS, JAX-RPC)
currently .

Thanks
10 years ago
Hi,

Am using the Weblogic 11gR1(10.3.4) sever to deploy the servlet through eclipse

Can you give me the idea where the error logs and stack trace would be created?

Thanks
10 years ago


When I run the above code , the html is not printed ?
Please help me is there any problem with the code?

Thanks
10 years ago
Hi,
I included the code snippet for InitialContext in my class.

Now when i run the code am getting the following output

User: root, failed to be authenticated.
null
Vendor Error Code: 0


When i run the same code without using datasource deployed on weblogic , it is able to connect
Hence its not the issue of authentication

I suppose it may be some issue with datasource configuration

While creating datasource I have given the machine name as localhost

Is it correct or I need to give IP address



I have configured the datasource on Weblogic server 11g.
When I execute this code I get the following error

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at Test4.main(Test4.java:33)

Please help me on how to resolve the above error

Thanks
Hi,

I have downloaded the oracle DB 12c version as well as SQL Developer.

But I am not able to understand how to create my own database and create tables
and other database objects

I created a connection through SQL Developer but when I try to use it to connect its
giving the following error

Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID
given in connect descriptor

Vendor code 12505

So please let me know the steps to follow to create a database and execute queries
on it.

Thanks
Hi,

Is Oracle and SQL developer download available at the links given by you
free? Are they full or trial versions?