neil johnson

Greenhorn
+ Follow
since Dec 03, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by neil johnson

I am a newbee to the hadoop. I got confused about who does the splitting of input file. lets assume i have a 200 mb of file and the block size is 64 mb. so we need total of 4 blocks multiplied by the replication factor. who splits the file and how does the split files available to client to be able to write to datanodes.
10 years ago
Hi, i am new to webservices. I am looking for apache cxf plugin for eclipse. Is it available. if so let me know the plugin downloadable site url.
If not please provide the links that guide me in developing a simple webservice using apache cxf.
14 years ago
hi Christophe,

I tried the way you have suggested but no luck.

I tried with HelloWorld#com.test.TestBeanLocal as JNDI but of no use.

My doubt is am i missing to configure in any xml file like in web.xml
14 years ago
I tried the way Nathan has posted but of no use.

one error i found in my code is:
In my controller i was using TestBean class ref instead of TestBeanLocal ref. now i changed it to below in Controller

@EJB
private TestBean testBean;


I even tried the below in spring config file.
<jee:local-slsb id="testBeanLocal" jndi-name="HelloWorld"
business-interface="com.test.TestBeanLocal" />

But no luck.
Can somebody please help me in resolving this.
14 years ago
I am trying to integrate spring3.0 with ejb3.0. below is the setup i have and using weblogic server 10.3
Interface, bean are in separate ejb project. controller, spring config file are in spring project

interface:
@Local
public interface TestBeanLocal {}

bean:
@Stateless(mappedName="HelloWorld")
public class TestBean implements TestBeanLocal {}

spring controller:
@Controller
@RequestMapping("/welcome")
public class WelcomeController {
@EJB
private TestBean testBean;
}

In spring config file:
<jee:jndi-lookup id="testBean" jndi-name="HelloWorld"/>

I am getting below exception:
javax.naming.NameNotFoundException: Unable to resolve 'HelloWorld'. Resolved ''; remaining name 'HelloWorld'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)

Any help would be appreciated.
14 years ago

David Newton wrote:Did you read its documentation? It supports chained calls.



can you elaborate the use
14 years ago
what is the use of ModelMap. how is it useful than Map. or in which cases it is more useful than map
14 years ago
modelandview has two methods
ModelAndView addAllObjects(Map modelMap)
Add all entries contained in the provided map to the model.
ModelAndView addObject(String modelName, Object modelObject)
Add an object to the model.


i am confused by having two methods. we can use addObject() in place of addAllObjects(). right? if not please clarify how addAllObjects() is useful.
14 years ago
but we can set the properties after BPP using postProcessBeforeInitialization() right?

so we can do it before intializing the instance.

correct me if i am wrong.
15 years ago
Why CustomEditorConfigurer is declared as BeanFactoryPostProcessor?

Why it is not a BeanPostProcessor? As we use CustomEditorConfigurer to assign complex properties like Date as a string in the spring configuration file, and the beanpostprocessor can be used before and after initializing the properties and can able to convert Date to String.
15 years ago
class CoffeeCup implements Cloneable {

public Object clone() {
try {
return super.clone();
}
catch (CloneNotSupportedException e) {
// This should never happen
throw new InternalError(e.toString());
}
}
}

in another class i used:
CoffeeCup original = new CoffeeCup();
original.add(75); // Original now contains 75 ml of coffee
CoffeeCup copy = (CoffeeCup) original.clone();

Now i got exact copy of CoffeeCup.

my question is: how the application is creating an subclass object(CoffeeCup) when I call super.clone().
As per my understanding if we call super.clone() that means we are calling Object.clone() -- if that is the case how it is creating the object of sub class?
Is there any underlying implementation that Object class uses for creating the subclass object?


15 years ago

saima kanwal wrote:Hi Thanvi,

consider the following code:



the output is : ThreadMain
ThreadA (100 times)
Back in ThreadMain

Hope you understand by this simple code.






I doubt about the code. Because as far as i know you can't start a thread more than once. Correct me if I am wrong. Any how thanks for such a nice explanation you gave for Object vs Thread.

Neha Daga wrote:because anyways two will always be an object of class Thread.
after starting it it becomes a thread of execution but what after its run method completes??? Do you think the Thread object doesn't exist anymore???
If yes you are wrong, It will still be a Thread object its just it can't be a thread of execution anymore.

hope that clears your doubt.




I don't know whether i am confusing the people with the way i am asking. My question is why we are using two terms thread and object instead of using just a thread while calling join and wait. because in both the cases we are calling using an alive thread.

Simran Dass wrote:

When you just say

Thread two = new Thread(runnable ref);

its a Thread Object. Only after you start it (two.start()) , it becomes a Thread of execution.





you are right. but my question is how you differentiate object and thread in terms of those two methods (join and wait). wait is called on object and join on thread.
we are calling both the methods after starting a thread. even then we are saying that wait is called by an object. why?

Guido Sautter wrote:A look at the JavaDoc of Thread might be pretty helpful here.

Basically, wait() and notify() belong to class Object because myObject.wait() causes the calling thread to wait until some other thread calls myObject.notify() or myObject.notifyAll(). join(), in turn, belongs to class Thread because myThread.join() makes the calling thread wait until myThread dies.





What ever you said regarding wait and join is correct(wait belongs to Object, join belongs to Thread). What makes me confusing is that how you differ Object and Thread (I know Object is Super class).

Thread two = new Thread(runnable ref);

Is "two" considered as Object or Thread?

In the above example "two" is used to call both wait and join
myObject.wait() ---------> two.wait
myThread.join() ---------> two.join