Import interfaces in jsp

Hi, all.
I'm new with EJB and try to test something in order to get to know EJB.
I just faced with some problem. I am trying to solve this for couple hours now..
Here is the problem.
I get this error when I compile jsp file.
C:\Documents and Settings\Administrator\TestEApps\TestEApps-war\build\generated\src\org\apache\jsp\actionForm_jsp.java:8: '.' expected
import HelloEJBRemoteHome;
C:\Documents and Settings\Administrator\TestEApps\TestEApps-war\build\generated\src\org\apache\jsp\actionForm_jsp.java:9: '.' expected
import HelloEJBRemote;
Here is the source code for this.
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="javax.naming.*"%>
<%@page import="javax.rmi.PortableRemoteObject"%>
<%@page import="HelloEJBRemoteHome"%>
<%@page import="HelloEJBRemote"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String text;
try{
text = request.getParameter("name");
}catch(Exception e){
text = null;
Context initial = new InitialContext();
Object obj = initial.lookup("HelloEJBBean");
HelloEJBRemoteHome home = (HelloEJBRemoteHome)PortableRemoteObject.narrow(obj,HelloEJBRemoteHome.class);
HelloEJBRemote hello1 = home.create();
out.println("Hello," & hello1.getHello());
%>
</body>
</html>
and here is the configuration file
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>TestEApps-EJBModule</display-name>
<enterprise-beans>
<session>
<display-name>HelloEJBSB</display-name>
<ejb-name>HelloEJBBean</ejb-name>
<home>Hello.HelloEJBRemoteHome</home>
<remote>Hello.HelloEJBRemote</remote>
<ejb-class>Hello.HelloEJBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HelloEJBBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
What's wrong with this?
Thank you.

Hmm try doing your context like this....
InitialContext ctx = new InitialContext();
HelloEJBRemoteHome  home = (HelloEJBRemoteHome ) PortableRemoteObject.narrow(ctx.lookup("ejb/HelloApp/HelloEJB"),HelloEJBRemoteHome.class);Note.... A EJB application has these classes..
HelloEJB.java
HelloEJBBean.java
HelloEJBRemote.java
HelloEJBRemoteHome.java
So you have to set up the Context in a way of ejb/HelloApp/HelloEJB
Which ejb is standard, and HelloApp is the application name localhost:8080/HelloApp/ and HelloEJB is the HelloEJB.java class
REmember that HelloEJB.java extends the EJB Object so that the EJB Interface will take care of all the remote...
You have to organize your EJB beans and Home Locals and Remotes... It is a bit complicated telling you what is wrong if we don't know your full structure...
But thats the taste of it

Similar Messages

  • Error in Supplier importing interface

    Hi,
    I am working on supplier Importing Interface. I have to import suppliers, and supplier site information into base tables.
    I successfully loaded the data into AP_SUPPLIER_INT and AP_SUPPLIER_SITE_INT interface tables. After submitting 'SUPPLIER OPEN INTERFACE IMPORT' program to move data from interface to base table, i am getting below error.
    ERROR: '1099 Type is inconsistent' for a particular vendor.
    I checked type_1099 validation with the base table AP_INCOME_TAX_TYPES.INCOME_TAX_TYPE, validation was fine.
    Could anyone has any idea, how to solve this error.
    Thanks in advance.

    Hi;
    Duplicate post
    Re: type_1099 error after submitting supplier open interface import
    Please post once
    Regard
    Helios

  • Getting Error While Importing Interface "EOF"

    Hi,
    I am trying to import Interface to my project but i am getting an error like "EOF"

    close the odi and relogin..

  • What to import in the JSP file??

    I want to use jsp and xsl to convert xml to html in order to display the file. But I come across a problem, I don't what should be import into the jsp file. Should I import these? <%@ page import="org.xml.sax.*" %>
    <%@ page import="org.apache.xalan.xslt.*" %>
    Since I'm not very good at this field, can anybody give me some suggestion to hlep me to work it out?
    thanks~

    One thing is sure. Whatever the classes you are going to use, need to be imported in your Jsp.
    There is no need for different import statements. You can write in a single import statement (comma separated).
    So, forget about the import statements and do your coding, finally you can look at the code and decide what classes (packages) you need to import.
    I think you need to import
    org.xml.sax.*;
    org.xml.sax.helpers.*;
    import javax.xml.parsers.*;
    Hope this helps.

  • Getting import error in jsp in creating war project of masthead for portal 7.31

    Hi,
    I am getting error in customize masthead war project in jsp for import statement.
    <%@ page import="com.sapportals.htmlb.*"%>
    <%@ page import="com.sapportals.htmlb.hovermenu.*"%>
    <%@ page import="com.sap.security.api.UMFactory"%>
    <%@ page import="com.sapportals.portal.prt.service.license.ILicenseService"%>
    <%@ taglib uri="prt:taglib:tlhtmlb" prefix="hbj"%>
    I have asked basis team for jar relative to these but they have not found in system.
    We are using portal 7.31 version.
    Kindly help me to remove this error from jsp.
    Thanks in advance.

    Hi Hemendra,
    At first i have done this and after that even i was facing error that's why i created this thread.
    Kindly check my first post for error.
    Getting import error in jsp in creating war project of masthead for portal 7.31
    This question is Not Answered.(Mark as assumed answered)
    Swati Joshi  Apr 29, 2015 12:34 PM  
    Hi,
    I am getting error in customize masthead war project in jsp for import statement.
    <%@ page import="com.sapportals.htmlb.*"%>
    <%@ page import="com.sapportals.htmlb.hovermenu.*"%>
    <%@ page import="com.sap.security.api.UMFactory"%>
    <%@ page import="com.sapportals.portal.prt.service.license.ILicenseService"%>
    <%@ taglib uri="prt:taglib:tlhtmlb" prefix="hbj"%>
    I have asked basis team for jar relative to these but they have not found in system.
    We are using portal 7.31 version.
    Kindly help me to remove this error from jsp.
    Thanks in advance.

  • Having problems compiling *.java with import javax.servlet.jsp......

    I've been trying to do the tutorials in a book titled Apache Jakarta-Tomcat as part of my introduction to JSP. I'm new to Java but do know the basics. I have on my machine Java 1.3, Java 1.4, Java FrameWorks 2.1 and Jython 2.1 on Win2000 Pro. So enough about my configuration. I have never worked with packages also.
    I downloaded the files from the books site due to the fact I make a lot of typos when hand coding Java (I've become a pretty good debugger of my own code). But everytime I go to compile the *.java I get error messages. So below you will find HelloTag.java and beneath that the error messages that are thrown when I try and compile it. I tested other bits of *.java and have had no problem compiling them. Is there a JSP module I'm missing?
    Am I doing something wrong or am I missing something from my configuration.
    Marijan Madunic
    package chapter2;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspTagException;
    import javax.servlet.jsp.tagext.TagSupport;
    public class HelloTag extends TagSupport
    public void HelloTag() {
    // Method called when the closing hello tag is encountered
    public int doEndTag() throws JspException {
    try {
    // We use the pageContext to get a Writer
    // We then print the text string Hello
    pageContext.getOut().print("Hello");
    catch (Exception e) {
    throw new JspTagException(e.getMessage());
    // We want to return SKIP_BODY because this Tag does not support
    // a Tag Body
    return SKIP_BODY;
    public void release() {
    // Call the parent's release to release any resources
    // used by the parent tag.
    // This is just good practice for when you start creating
    // hierarchies of tags.
    super.release();
    D:\Java\JDK 1.3\bin>javac HelloTag.java
    HelloTag.java:3: cannot resolve symbol
    symbol : class JspException
    location: package jsp
    import javax.servlet.jsp.JspException;
    ^
    HelloTag.java:4: cannot resolve symbol
    symbol : class JspTagException
    location: package jsp
    import javax.servlet.jsp.JspTagException;
    ^
    HelloTag.java:5: cannot resolve symbol
    symbol : class TagSupport
    location: package tagext
    import javax.servlet.jsp.tagext.TagSupport;
    ^
    HelloTag.java:7: cannot resolve symbol
    symbol : class TagSupport
    location: class chapter2.HelloTag
    public class HelloTag extends TagSupport
    ^
    HelloTag.java:14: cannot resolve symbol
    symbol : class JspException
    location: class chapter2.HelloTag
    public int doEndTag() throws JspException {
    ^
    HelloTag.java:20: cannot resolve symbol
    symbol : variable pageContext
    location: class chapter2.HelloTag
    pageContext.getOut().print("Hello");
    ^
    HelloTag.java:24: cannot resolve symbol
    symbol : class JspTagException
    location: class chapter2.HelloTag
    throw new JspTagException(e.getMessage());
    ^
    HelloTag.java:28: cannot resolve symbol
    symbol : variable SKIP_BODY
    location: class chapter2.HelloTag
    return SKIP_BODY;
    ^
    HelloTag.java:37: cannot resolve symbol
    symbol : variable super
    location: class chapter2.HelloTag
    super.release();
    ^
    9 errors

    Well, it looks like you've not got the servlet development kit JAR on your classpath. I think it'll probably be called servlet.jar on your system. Add that to the classpath if it's not already there.
    Incidentally, you've bumped into one of the areas Java's slightly lenient - declaring a method that looks like a constructor:
    public HelloTag() { }
    public void HelloTag() { }The first is a constructor, the second is a normal method. I'm assuming you intended to have the former instead of the latter.
    Anyway, hope this helps.

  • Importing packages in JSP using iPlanet problem

    hi experts,
    i am new begi to iPlanet server6.0
    i have installed iPlanet6.0 in windowsNT(d:\iPlanet\servers)
    document root is d:\iPlanet\servers\Docs
    i have one jsp called test.jsp in document root dir.
    i imported one package called adminBeans in jsp file.
    i put adminBeans class folder in
    d:\iPlanet\servers\Docs\WEB-INF\classes
    whrn i am ruuning this jsp error shows as below
    ============================
    [04/Jul/2002:11:15:01] info ( 347): JSP: JSP1x compiler threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSPd:\iPlanet\Servers\https-ntserver.vsnl\config\..\ClassCache\_jsps\_test_jsp.java:15: Package adminBeans not found in import.
    import adminBeans.*;
    ^
    1 error
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
         at com.iplanet.server.http.servlet.NSServletEntity.load NSServletEntity.java:252)
         at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:173)
         at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:416)
    =====================================================
    do i want to set any configuration for jsp running?.
    without any import,like helloworld.jsp file is working fine.
    any idea
    plz help me ya.
    thanks in adv.
    endrum anpudan
    maruthu

    hi,
    first of all u understand the way package works
    suppose u have package named mybeans and there r classes under this folder for e.g myBeans/AdminBean and many more so ur definetly going to import the classes in this way import myBeans.*; for all classes or import myBeans.AdminBean; for single class but before doin that make sure that u have set that package path in ur environment. how will u do that ? register the path just above one folder to myBeans for e.g
    D:\myClasses in the evironment and ur myBeans folder wil reside under D:\myClasses\myBeans

  • Import javax.servlet.jsp.*;

    I am new to JSP.I getting errors in compilation.Can anyone please tell me the following import file can be found in which development kit.
    "import javax.servlet.jsp.*;

    You can download J2EE from sun's website. What you need is servlet.jar package. Put it in your CLASSPATH.

  • Order Import Interface

    Hi,
    I have to develop pl/sql code for importing Sales order from diffrent system throgh xls.
    Please provide me all the validations used in Order Import Interface program.
    Also if anyone already developed please share with me, its urgent friend.
    I am new in oracle apps
    Thanks in advance

    You can get the sample script for Oracle Order Management from the following MOS note:
    Process Order API - How To Scripts [ID 1265721.1]
    Script To Create An Order With One Line using OE_ORDER_PUB.process_order API [ID 746783.1]
    Also please check the following thread:
    Re: Order Import Workflow
    Cheers,
    ND
    Use the "helpful" or "correct" buttons to award points to replies / Mark the thread as answered, if your question is answered.

  • JAVA IOException when adding "org.jdom.*" in the list of the imports for Attributes.jsp

    Hi all,
    I am trying to use JDOM and was playing with the xml examples code(Attributes.jsp)
    for WLS6.1SP2.
    When I add the " org.jdom.* " to the list of the imports on the Attributes.jsp page
    I get a java.io.exception.
    Please HELP !!

    You didn't post the exception.
    It is probably caused by the JDOM JAR or classes not being available or an
    IO error reading them (e.g. permissions issue on Unix).
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Gary Fields" <[email protected]> wrote in message
    news:3cd01550$[email protected]..
    >
    I believe that someone on this newsgroup has the answer....
    Come on guys/gals !!!
    "Gary Fields" <[email protected]> wrote:
    Hi all,
    I am trying to use JDOM and was playing with the xml examples
    code(Attributes.jsp)
    for WLS6.1SP2.
    When I add the " org.jdom.* " to the list of the imports on theAttributes.jsp
    page
    I get a java.io.exception.
    Please HELP !!

  • How can use interface in JSP?

    hi! friends i have one dought in JSP? it's possible interface in JSP? how?
    waiting for ur reply!

    hi
    i think u can not use interface in JSP but u can extend a class which implements an interface

  • Error when Trying to add customer address in Order Import Interface

    hello I am trying to add a new address via the Order Import Interface and I am getting the errors listed below. This is working is several other environments so I believe that the data set in the interface tables is correct but I am wondering if this could be related to a setup related issue in this instance. Any suggestions would be greatly appreciated
    Order Import Add Customer failed (API = Create_Address). Please enter required field LOCATION_NUMBER.
    Cannot get valid ID for - ship_to_org_id

    Hi,
    In few a scenarios the interface errors does not point to the exact error message, Please check if you have populated all the mandatory columns:
    OEHEADERS_IFACE_ALL:_*
    ORIG_SYS_DOCUMENT_REF
    ORDER_SOURCE
    CONVERSION_RATE
    ORG_ID
    ORDER_TYPE_ID
    PRICE_LIST
    SOLD_FROM_ORG_ID
    SOLD_TO_ORG_ID
    SHIP_TO_ORG_ID
    SHIP_FROM_ORG_ID
    CUSTOMER_NAME
    INVOICE_TO_ORG_ID
    OPERATION_CODE
    OEHEADERS_IFACE_ALL:_*
    ORIG_SYS_DOCUMENT_REF
    ORDER_SOURCE
    CONVERSION_RATE
    ORG_ID
    ORDER_TYPE_ID
    PRICE_LIST
    SOLD_FROM_ORG_ID
    SOLD_TO_ORG_ID
    SHIP_TO_ORG_ID
    SHIP_FROM_ORG_ID
    CUSTOMER_NAME
    INVOICE_TO_ORG_ID
    OPERATION_CODE
    OE_LINES_IFACE_ALL
    ORDER_SOURCE_ID
    ORIG_SYS_DOCUMENT_REF
    ORIG_SYS_LINE_REF
    ORIG_SYS_SHIPMENT_REF
    INVENTORY_ITEM_ID
    LINK_TO_LINE_REF
    REQUEST_DATE
    DELIVERY_LEAD_TIME
    DELIVERY_ID
    ORDERED_QUANTITY
    ORDER_QUANTITY_UOM
    SHIPPING_QUANTITY
    PRICING_QUANTITY
    PRICING_QUANTITY_UOM
    SOLD_FROM_ORG_ID
    SOLD_TO_ORG_ID
    INVOICE_TO_ ORG_ID
    SHIP_TO_ORG_ID
    PRICE_LIST_ID
    PAYMENT_TERM_ID
    Regards,
    Yuvaraj

  • Import statement in JSP

              Hi
              I am maintaining a system done by one of our vendors.
              Application is deployed in WLS 7.0.
              When I imported the Jsp's into my IDE , I got errors where java.util classes are
              used in the JSP's and the import statement is missing.
              Most of the Jsp's are like this,
              It is working fine in the production server.
              In the IDE i am forced to put the import statement and that is what I expect.
              But how can it work in the production server without any issue.
              Can someone advise me on this
              Thanks
              DN
              

    <%@page import="java.util.calendar" %>
    Oops... forgot the "page" in there ...That's what I get for using GUI's too much!!! :)

  • Bank Statement Import interface tables

    Hi all,
    I'm using OEBS R 12.1.3. Can anybody tells me/some links or info / about the Bank Statement Import Program which interface tables uses as i cannot found or i'm just a bad researcher...? I have to insert data there in order this program to create bank statements.
    Thanks in advance,
    Bahchevanov.

    See http://docs.oracle.com/cd/A60725_05/html/comnls/us/ce/intert01.htm
    and How To Create New Bank Statement Mapping Template To Requirement, Latest Patch [ID 563476.1]
    Sandeep Gandhi

  • Error in Exporting and Importing Interface.

    Hi Guys! warms greetings!
    My problem is:
    1] I have added a constraint in my datastore(table) at database level and reverse engg. but the metadata is not getting reflected in the datastore.
    2] I then thought of dropping the entire datastore and re-reverse it ; for this I had to drop the Interface where I was using for the same datastore because while dropping datastore it thew "Referenced Error"
    3] To do this I took a back up of my Interface by exporting it to some path and then deleted my original datastore.
    4] I reverse enggd it all over again and now the constraint was visible.
    5] I then Imported the interface which i had exported in above steps.
    Now I am getting error like' No Dataserver is associated with the Column" for every column in my target.
    Waiting for your wise comment/advise.
    thankyou,
    Diwakar.

    Hi Diwakar,
    Earlier I had this issue,
    That exported interface XML file has contains the details of the datastore which you have deleted for reversing the new modified datastore.
    that Xml file has the ID of Old datastore, After imporing of that interface it will searching the respective datastores but it wont available. Because you did deleted that datastore.
    I did that interface again to resove this issue.
    another option is-> you need to modify the Exported XML file to Refer the new datastore detals like Id.
    Exports comments are welcome
    Thanks,
    Madha.

Maybe you are looking for