I can't access able to compile the servlet that access EJB methods

Hello,
i have written i servlet (TestServlet.java) to access the ejb(SignOn) method(validateUser(userId,Password)) but i can't compile this servlet.it shows this type error.can anybody help me to do it complete.i have written the ejb & servlet in (d:\ejb\src\demo).
D:\riazejb\src\demo>javac TestServlet.java
TestServlet.java:15: cannot find symbol
symbol : class SignOnHome
location: class demo.TestServlet
SignOnHome signOnHome;
^
TestServlet.java:16: cannot find symbol
symbol : class SignOn
location: class demo.TestServlet
SignOn signOn;
^
TestServlet.java:23: cannot find symbol
symbol : class SignOnHome
location: class demo.TestServlet
signOnHome = (SignOnHome)PortableRemoteObject.narrow(objref,SignOnHome.c
lass);
My servlet code is
package demo;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import javax.naming.*;
import javax.ejb.*;
import demo.*;
import javax.rmi.PortableRemoteObject;
public class TestServlet extends HttpServlet {
SignOnHome signOnHome;
SignOn signOn;
public void init(ServletConfig config) throws ServletException {
//Look up home interface
try {
InitialContext ctx = new InitialContext();
Object objref = ctx.lookup("demo/SignOn");
signOnHome = (SignOnHome)PortableRemoteObject.narrow(objref,SignOnHome.class);
} catch (Exception NamingException) {
NamingException.printStackTrace();
public void doGet (HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException
PrintWriter out;
response.setContentType("text/html");
String title = "EJB Example";
out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Hello World Servlet!</title>");
out.println("</head>");
out.println("<body>");
out.println("<p align=\"center\"><font size=\"4\" color=\"#000080\">Servlet Calling Session Bean</font></p>");
try{
// MyTestSession beanRemote;
SignOn signOn;
signOn = (SignOn)signOnHome.create();
out.println("<p align=\"center\"> Message from Session Bean is: <b>" + signOn.validateUser(student,password) + "</b></p>");
signOn.remove();
}catch(Exception CreateException){
CreateException.printStackTrace();
out.println("<p align=\"center\"><a href=\"javascript:history.back()\">Go to Home</a></p>");
out.println("</body>");
out.println("</html>");
out.close();
public void destroy() {
System.out.println("Destroy");
Thanks in advance.
Riaz

Have you added the EJB client JAR to classpath for compilation?
java -classpath "%CLASSPATH%;<<EJBCLient JAR path>> *.java

Similar Messages

  • Hi Anil, I was able to compile the Maven test build successfully but still has errors.

    Hi Anil, I am not able to compile the Maven test build successfully but still have errors/warning messages. Can you please help me or tell me if I can
    processed with the tutorials. Thanks.
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>Maven-Test</groupId>
      <artifactId>Maven-Test</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>pom</packaging>
       <dependencies>
    <!-- check if <sap.cloud.sdk.version> and <sap.cloud.sdk.path> in settings.xml are correct -->
    <!-- SAP HANA Cloud SDK dependency -->
    <dependency>
    <groupId>Maven-Test</groupId>
    <artifactId>Maven-Test</artifactId>
    <version>1.48.16</version>
    <scope>system</scope>
    <systemPath>C:/dev/hanacloud.sdk/1.48.16</systemPath>
    </dependency>
    <!-- check if <eclipse.path> and <sap.cloud.ui5.version> in settings.xml are correct -->
    <!-- SAPUI5 dependency -->
    <dependency>
    <groupId>Maven-Test</groupId>
    <artifactId>Maven-Test</artifactId> (I am getting error here)
    <version>1.18.8</version>
    <scope>system</scope>
      <systemPath>C:/dev/eclipse</systemPath>
    </dependency>
    </dependencies>
    </project>
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    [INFO] Scanning for projects...
    [WARNING]
    [WARNING] Some problems were encountered while building the effective model for Maven-Test:Maven-Test:pom:0.0.1-SNAPSHOT
    [WARNING] 'dependencies.dependency.systemPath' for Maven-Test:Maven-Test:jar should use a variable instead of a hard-coded path C:/dev/hanacloud.sdk/1.48.16 @ line 16, column 14
    [WARNING] 'dependencies.dependency.systemPath' for Maven-Test:Maven-Test:jar should use a variable instead of a hard-coded path C:/dev/eclipse @ line 25, column 15
    [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: Maven-Test:Maven-Test:jar -> version 1.48.16 vs 1.18.8 @ line 20, column 14
    [WARNING] 'dependencies.dependency.systemPath' for Maven-Test:Maven-Test:jar refers to a non-existing file C:\dev\eclipse @ line 25, column 15
    [WARNING]
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING]
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING]
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Maven-Test 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
    Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom (5 KB at 4.3 KB/sec)
    [INFO]
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Maven-Test ---
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.507s
    [INFO] Finished at: Mon Mar 24 02:27:14 EDT 2014
    [INFO] Final Memory: 5M/99M
    [INFO] ------------------------------------------------------------------------

    It's probably best to close thread and that I start a new one. I think that I have gone off on a tangent here. Yes SSIS isn't doing much of a job in reporting errors but my main concern is the error itself.
    I am trying to port an SSIS Script Task from SQL 2008 to SQL 2012. Is uses the ReportExecution2005 web service to run SSRS reports. The really strange thing is that, even though the same web reference is used, different methods seem
    to be available in SQL 2008 and SQL 2012. This doesn't sound right to me, if you refer to the same Web Service you should see the same metros or am I wrong about that.
    For example in SQL 2008 there is ReportExecutionService
    object but on the SQL 2012 to service there only seems to be
    ReportExecutionServiceSOAPClient.
    R Campbell

  • Hello everybody, I need to update my ITunes on my MAC (laptop) to the newer version so I can then be able to update the latest updates for my Iphone-3G'S. I don't require a complete reinstall just need to be able to update it.What I have tried so far is I

    Hello everybody, Im trying to update my ITunes on my MAC (laptop) to the newer version so I can then be able to update the latest updates for my Iphone-3G. I don’t require a complete reinstall just need to be able to update my itunes.
    What I have tried so far is I had my MAC search for update’s and it said that I should update to (ITunes version  10 . 6 . 3 ) So I asked it to do the update but after 2hrs of waiting for it to download/update it then puts up a message saying the following- (In order to continue installation, please close the following application: ITunes).
    When I tried to do this another message comes up that says- (The update ITunes can’t be installed. The following install step failed: run preupgrade script for Apple mobile device support. Contact the software manufacturer for assistance.)
    I have also tried to run the update while having closed ITunes before I even start the update but the same problem happens after waiting about 2hrs.
    Some one that had the same problem said this might be happening in the older operating systems. But that does not make sense because surely Apple want customers who own a MAC and i-phone to still buy from iTunes.
    My MAC is about 4-5years old. I have a i-phone.3G, 
    Can anybody help me please and Thank you?

    Download iTunes using the tab at the top of this page. Then run the update with iTunes closed.

  • Can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action.

    Hi,
    I can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action.  I can access CRM with same user id and password from our office inside the network.  I can get
    the page to give login details once I have login details I got below error. Please help me to solve this issue.  It was working before.
    Access denied You do not have sufficient access rights or privileges to perform this action. 
    Regards,
    Noushad
    [email protected]

    On Premise system Configured with AD FS server for claims-based authentication you need to update your host file with server url to access it from outside office network.
    Refer
    this on how to update host file.
    Regards, Saad

  • The scroll back gesture to the previous page, even after i sign out of my email account or Facebook anyone can still be able to see the content in the accounts just by scrolling back using the gesture.

    the scroll back gesture to the previous page, even after i sign out of my email account or Facebook anyone can still be able to see the content in the accounts just by scrolling back using the gesture. how can i stop safari from showing the content of my accounts?

    Try calling Tech Support, they should be able to check to see if theres a lock and try to help you reset it, I had to call and get my account unflagged, for something that I didn't even do.

  • I was charged for a movie that never was downloaded, i asked for it but the conection was too slow and I never was able to have the movie that i asked for...how can i get it without being charged again, who could remove the chage from my Crecit card?

    i was charged for a movie that never was downloaded, i asked for it but the conection was too slow and I never was able to have the movie that i asked for...how can i get it without being charged again, who could remove the chage from my Crecit card?

    You may not be able to get a refund, since the terms of sale for the iTunes Store state that all sales are final. You can contact the iTunes Store, explain the reason for your request, and ask, though:
    http://www.apple.com/support/itunes/contact.html
    It's possible they'll make an exception for you, particularly if the problem was on their end preventing the movie from downloading in a reasonable time.
    Good luck.

  • I have iphone 3g, phone is working very slow and even i can not been able to close the running application

    i have the Iphone 3g, OS 4.3.2.1
    My Phone is working terribly slow, and even i can not been able to close the running application
    for closing application Every time i have to restart the phone
    can any 1 help me solve this problem
    with best regards,
    prakash

    You must have an iPhone 3GS then if its running 4.3.2
    The iPhone 3G can only update to 4.2.1 iOS.
    Reset the iPhone
    Hold the top silver button and the home button (just below the display of the iPhone)
    Do this at the same time for about 10 seconds until you see an Apple.
    The iPhone then should take 1-3 minutes to restart and it should be fine

  • HT1277 I set up a new folder for an email sender and now my emails are not able to use the rules that I set up.  What can I do to enable them again.

    I set up a new folder for an email sender and now my emails are not able to use the rules that I set up.  What can I do to enable them again.

    I don't seem to be able to copy a rule, but, this is how one rulel displays.
    Name of Rule is Richard Cryar.
    If any of the following conditions are met:
    From contains rcryar@auduboncapital
    Move message to Richard Cryar mailbox
    Not only does this rule not work, but all emails are going into the new box I created and not to the inbox.

  • My mac's launchpad is working but i am not able to use the apps that are provided in the launchpad

    my mac's launchpad is working but i am not able to use the apps that are provided in the launchpad

    Well, everything that you have bought with her Apple ID prior to getting your own Apple ID is forever hers. Apple will not transfer content from one ID to another. But in the case of the Mac, contact iTunes Customer Service and request that they send your issue to the Account Security Team and ask that the Mac be released form your mother's account so you may register it with your account. Then you can accept the iLife apps into your account for any future updates.
    iTunes Support -
    http://www.apple.com/support/itunes/

  • Create problem when compiling the servlet

    hi,
    i got a problem when i compile a servlet
    when i try to compile the servlet, it shows that it could
    not found the classes like httpservlet, etc.
    means the classes of the servlet
    i am using the j2sdk1.4.1 edition,
    i had include the javax.servlet.*; in the program
    please tell me what can be the problem & especially any solution for that

    the javax.servlet package and it's sub packages (javax.servlet.http, javax.servlet.jsp, javax.servlet.jsp.tagext) are not included with the Standard Edition. These packages are part of the Enterprise Edition. Check out this link for download:
    http://java.sun.com/j2ee/sdk_1.3/

  • What do i do when iPhoto Deletes my recent pic's all the way to 2010????? i opened the program and it said i needed to update my library otherwise i wouldn't be able to view the images that were not updated-- and now they are gone!!!!!! WHat do i do!!!!!!

    what do i do when iPhoto Deletes my recent pic's all the way to 2010????? i opened the program and it said i needed to update my library otherwise i wouldn't be able to view the images that were not updated…… and now they are gone!!!!!! WHat do i do!!!!!!  Is this some type a virus???? my mac is protected!!!!! tried to chat with an IT person but they keep asking if its like a tech problem and it is just iphoto

    You should get your keyboard checked as it's repeating  on a lot of keys and makes you look silly.
    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • HT2688 We have 2 ipods, how are we able to share the music that is on our computer?

    I have 2 iPod touch, how am I able to share the music that is on my personal computer that my music is on

    Even if you connect both devices at the same time, each device appears separately in iTunes, in the iTunes sidebar, under DEVICES.  Select one device and set it up to sync as desired.  Then, select the other device and set it up to sync as desired. 
    The same music does NOT go to both, unless that is how you set it up, because iTunes treats each device separately.  So, you can set one up to automatically sync to your iTunes library.  You can set up the other device for manual loading (dragging songs to the device in iTunes).  Whatever you want, for each device...

  • I have realised over time I have created multiple accounts. I have bought music on my iphone and am not able to locate the account that I made most of my purchases on. I have bank statements on the purchases but don't know how to contact someone to help.

    I have realised over time I have created multiple accounts. I have bought music on my Iphone and am not able to locate the account that I made most of my purchases on. I have bank statements on the purchases but don't know  how to contact someone in Itune to help me.  PLEASE

    I don't have the app adn no expereince with it, but it appears basec on teh app description you may need it installed on your MAC as well to download the files.
    You might find help on the vendors website: http://www.nfinityinc.com/index.html

  • HT204266 I was trying to buy an app from the apple store, it asked for confirmation , when I re-entered my credit card details, got the message that your payment method is not valid!!!! How can I fix this problem?

    I was trying to buy an app from the apple store, it asked for confirmation , when I re-entered my credit card details, got the message that your payment method is not valid!!!! How can I fix this problem?

    Is this a pre-paid card thing? Or different billing address than your iTS account?

  • Am I able to download the games that came with my PC?

    Am I able to download the games that came with my PC onto my IPad?

    No.  Those games were written for whatever language your pc speaks.  The pad runs on a system called iOS, and it is a totally different type of system.
    The good news is that most common games have a version written for the pad in the app store.  Take a look!

Maybe you are looking for

  • I am getting dump error while running one report in one select query

    Hi, While running a report program, I am getting a dump error in one select query. So could you please correct the select query so that I can't face the dump error. SELECT vbeln parvw kunnr INTO CORRESPONDING FIELDS OF TABLE l_t_vbpa   FROM vbpa   FO

  • Connecting with external time recording system

    Hi,  I need to know how an in-house Java Time Recordins System can communicate with SAP.  The plan is for this system to send raw data, clock in, clock out to SAP work schedules.  Employees are mostly positive and have occasionnaly shift differential

  • Problems displaying BO reports in an iframe in Firefox

    Hi, I have an aspx page which has an iFrame. I have provided the src for this iFrame as the BO report. When I open this page in IE, the report comes up properly. However when I open this page in Firefox, the report does not display. However if I open

  • Date in a report to xcelsius

    Hi, I have a Date/Time parameter which i am passing from crystal reports to crystal Xcelsius. I am using Remedy DB which internally stores the date as seconds from 1/1/99 until current date. In crystal reports, the date is getting displayed, but in x

  • Whats the use of E1EDKT1 seg. of  idoc ORDERS05

    Hi,      What is the use of TDLINE field in segment E1EDKT1. Depends on the value of this field, Sales Order  and subsequent orders creation is controlled. Is this value makes any difference in deciding which posting FM to be called. Thank U for Ur t