Arnab Sinha

Ranch Hand
+ Follow
since Jul 23, 2006
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 Arnab Sinha

Thank you for providing that information.
1) Do you know of any plugins or 3rd party that we can use fairly easy with netbeans 6 for code coverage? I didnt see anything obvious on the site http://plugins.netbeans.org/PluginPortal/faces/CategoryPage.jsp?categoryname=Version+Control

2) Can Netbeans 6 be configured with Rational ClearCase and ClearQuest?

Thanks for your response
Thanks for your response. I will look into it.
Hi All,

I am reading the HF EJB book. At the same time I would like to do the sample examples in the book. The book talks about SUN RI server which i am having a hard time finding.

Can someone please recommend which would be a easy app server to use to develop some quick EJBs and test them using core java classes or servlets and jsps.

I tried using JBOSS and ran into some strange JNDI issues when I use a core class to lookup the bean. Here is the link of my post in JBOSS forum for that problem
https://coderanch.com/t/90761/JBoss/JBOSS-help-first-ejb-deployment

I am able to compile my ejb class and interfaces, however i would like to test them as well.

Thanks in advance.
Hi All,

I downloaded JBOSS 4.0.2 app server. I am doing the first program from HF EJB book.

I was able to compile the bean class and interfaces and package them into the jar file.

I believe I was also able to deploy it successfully because I can see my bean in the JMX console:

+- ejb (class: org.jnp.interfaces.NamingContext)
| +- AdviceBean (proxy: $Proxy50 implements interface headfirst.AdviceHome,interface javax.ejb.Handle)

However my problem is when I invoke the bean from a core java class:

import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;


public class AdviceClient
{
public static void main(String[] args)
{
new AdviceClient().go();
}

public void go() {
try
{
Context ic = new InitialContext();
Object o = ic.lookup("ejb/AdviceBean");

AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);

Advice advisor = home.create();
System.out.println(advisor.getAdvice());
}
catch (Exception ex)
{
ex.printStackTrace();
}

}
}

It compiles fine but when I try executing the client I get the following run-time error:

java AdviceClient

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(NamingManager.java:640)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at AdviceClient.go(AdviceClient.java:19)
at AdviceClient.main(AdviceClient.java:12)

ejb-jar.xml

<ejb-jar>

<display-name>EJB1</display-name>

<enterprise-beans>
<!-- Session Beans -->
<session>
<display-name>AdviceBean</display-name>
<ejb-name>AdviceBean</ejb-name>
<home>headfirst.AdviceHome</home>
<remote>headfirst.Advice</remote>
<ejb-class>headfirst.AdviceBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>

</enterprise-beans>

</ejb-jar>

Any help would be appreciated.

Thanks in advance.
[ October 16, 2007: Message edited by: Arnab Sinha ]
12 years ago
Congrats!! I know the feeling but its still a great score.
Enjoy it!!
great score. Congratulations!!!
I found it very strange when I logged into http://www.certmanager.net/sun. On clicking the logo link, it said the following:

Sun Certified Web Component Developer for J2EE 1.4
There are no logos available for this program

Is this accurate?
Excellent score
Thanks for sharing your experience.
Congrats!! we share the same score and coincidently I also cleared it today. Calls for a toast
Thanks to everybody on this forum for helping me with my doubts and concerns.

I prepared seriously for about 6 weeks before exam. Prior to doing that it was just on and off basis. I work full-time but dedicated atleast 2 hours a day and avoided alcahol the last week .

Javaranch - awesome site for all info needed.
HFSJ - is a awesome study guide.
SCWCD Exam study kit - for last minute cramming.

Thanks to Mikalai Zaikin's notes.
Thanks to Marc Peabody's notes on Design Patterns.

I did the SCWCD Mock Exam on this site.
I also did Marcus Green's 3 scwcd quizzes. Avg 88%
Score 68% on HFSJ Mock exam.

Although I wish I touched the 90 percentile I am glad that I cleared SCWCD.
Now its time for lots of alcahol
[ October 11, 2007: Message edited by: Arnab Sinha ]
HFSJ states that base64 encoding is used only by BASIC and not FORM

SCWCD Exam study kit says - base64 encoding is used both by BASIC and FORM.

Which is correct?

Thanks
Figured out the problem. Both Person and Pet should be public. I had them as default.

Thank you for your response.
This was definitely wrong -
page import="person.arnab.*"

It should be page import="com.arnab.*"

However that didnt help: here is the stack trace:

org.apache.jasper.JasperException: /EL.jsp(6,0) The value for the useBean class attribute com.arnab.Person is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1227)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.arnab.elServlet.doPost(elServlet.java:28)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)