Can't access non ejb classes from JSP - NoClassDefFound error

          Hi,
          I have one session ejb which has a method returning a collection of non ejb class objects (say of Class 'Foo').
          The method signature is like :
          "Collection getFinacialData() throws RemoteException"
          It is working fine with normal java clients. Now when I run this from a JSP it gives a "NoClassDefFoundError". I kept class 'Foo' and the remote interface of the session bean in the same package and also in the same ejb jar file. Also I am running JSP and ejb in same WL server(ver 5.1, SP8 on solaris). What I have done is only deployed the bean jar file. Do I need to do anything more?
          thanks in advance.
          

I ran into a similar problem. I solved it by putting the client classes for
          accessing my EJB in the WebLogic POST_CLASSPATH in the startWebLogic script
          file:
          set POST_CLASSPATH=d:\weblogic\myserver\myClient.jar
          For more information on class visibility between the JSP and EJB class
          loaders, check out
          http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deployover.html#1056256
          Rick
          "niroja" <[email protected]> wrote in message
          news:3a6ed903$[email protected]..
          >
          > Hi,
          >
          > I have one session ejb which has a method returning a collection of non
          ejb class objects (say of Class 'Foo').
          > The method signature is like :
          > "Collection getFinacialData() throws RemoteException"
          > It is working fine with normal java clients. Now when I run this from a
          JSP it gives a "NoClassDefFoundError". I kept class 'Foo' and the remote
          interface of the session bean in the same package and also in the same ejb
          jar file. Also I am running JSP and ejb in same WL server(ver 5.1, SP8 on
          solaris). What I have done is only deployed the bean jar file. Do I need to
          do anything more?
          >
          > thanks in advance.
          >
          

Similar Messages

  • Question about access non-public class from other package.

    Hi, everyone!
    Suppose class A and class B are in the same java file of package pkg1
    -- A.java. So, A is a public class and B is a non-public class.
    If I want to access class B from another class class C and class
    C is in package pkg2. When compiling, an error occurs indicating
    that class B is not visible to class C.
    So, If I defined serveral classes in one java file and I want to
    access every class from other package. How should I do?
    (I think in one java file, there should be only one public class and
    only the public class can be accessed from other package.)
    Thanks in advance,
    George

    So, If I defined serveral classes in one java file and
    I want to
    access every class from other package. How should I
    do? As you already seem to know, there is at most one public class allowed per source file (at least, with javac and most popular compilers). So if you want more than one public class, you will need to use more than one file...

  • Locating EJB classes from JSP

    Hi all,
    I have some JSP that invoke Session Beans. My question is:
    what is the right place to put EJB classes in order to be found by JSP ?
    I have found the following solutions but they both slow down during development
    phase:
    1) Build an EAR and let the JSP reference EJB classes via the Class-Path attribute.
    This is nice but a bit complex: I'd like to use EAR only for shipment phase and
    not for every small change to the Bean.
    2) Let WLS see the classes including them in the classpath at startup. But this
    has the disadvantage that I have to restart WLS every time because - I suppose-
    WLS isn't able to unload classes if I include them in the CLASSPATH
    So what do you suggest me for development phase? is there a faster solution?
    Thanks a lot
    F.Marchioni

    Hi Arjuna,
    put it on the weblogic startup classpath.mmmmm well I think the JSP will not reload the EJB classes when I make a change
    if they are on the classpath...unless I restart the server....I'll try again...I
    hope I'm wrong...
    thanks
    Francesco
    "Arjuna Chala" <[email protected]> wrote:
    for testing
    - put it on the weblogic startup classpath.
    - use the console's hot deploy facility to re-deploy the ejb after changes.
    This works well for me (WLS6.1).
    Reagrds
    Arjuna Chala
    "Marchioni F." <[email protected]> wrote in message
    news:3c5eae94$[email protected]..
    Hi all,
    I have some JSP that invoke Session Beans. My question is:
    what is the right place to put EJB classes in order to be found byJSP ?
    I have found the following solutions but they both slow down duringdevelopment
    phase:
    1) Build an EAR and let the JSP reference EJB classes via the Class-Pathattribute.
    This is nice but a bit complex: I'd like to use EAR only for shipmentphase and
    not for every small change to the Bean.
    2) Let WLS see the classes including them in the classpath at startup.But
    this
    has the disadvantage that I have to restart WLS every time because- I
    suppose-
    WLS isn't able to unload classes if I include them in the CLASSPATH
    So what do you suggest me for development phase? is there a fastersolution?
    Thanks a lot
    F.Marchioni

  • How can i access the EJB from a Webdynpro

    Dear all,
    How can i access the ejb , from a webdynpro?.
    Is there any way to do that?.
    I want to write the entire code (business functions) within the EJB and i wan to access the entire methods from a WebDynpro Application.This is the situation.
    Please help me to , resolve this problem.(Here im using JDBC Connection .. etc.).
    I want to do the basic connection setting's and data retrieval part within the EJB and use that within the WebDynpro..
    how can i seperate this two(i mean, i want to seperate the JDBC connections and WebDynpro,i dont want to hard code any connection parameters within the webdynpro code)
    So that i want use that saet of particular function's in many webdynpro applications..
    (i dont need any help regarding webservice way.)
    If anyone can , please help me..
    I tried that javabean class , manifest file , that way (importing javabean model).
    but im getting errors.
    I cant properly utilize that..
    So please help me with steps regarding that,,
    for javabean
    and if any , for EJB also..
    with regards
    Kishor.G

    HI,
    Since webdynpros follows Model View Controller Architecture You can access EJBs in webdynpro(views/frontend) infact to connec to database uding JDBC you have to utilise EJB ( opening connection to database closing, and other Business functionality).See this link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/unkown/web dynpro tutorial and sample applications.faq#q-7
    <b>How to access the Car Rental Web Service?</b>
    Regards,
    RK

  • Accessing custom classes from JSP

    Hi Guys,
    I am having some problems accessing my custom classes from my JSP.
    1) I've created a very simple class, SimpleCountingBean that just has accessors for an int. The class is in the package "SimpleCountingBean". I compiled this class locally on my laptop and uploaded the *.class file to my ISP.
    2) I've checked my classpath and yes, the file "SimpleCountingBean/SimpleCountingBean.class" is located off of one of the directories listed in the classpath.
    3) When I attempt to use this class in my JSP, via the following import statement:
    import "SimpleCountingBean.*"
    I get the following compile error
    java.lang.NoClassDefFoundError: SimpleCountingBean/SimpleCountingBean
    I'm pretty sure that my classpath is properly setup because when I purposely garble the import statement, I get the "package not found" compile error.
    Do I need to upload some other files in addition to the class file? Any suggestions would of course be appreciated.
    Sonny.

    Trying to get some clearer view.. so don't mind..
    So you uploaded all your .jsp files into your account which is:
    home/sonny
    and it compiles and work. But custom classes doesn't seems to be working, where did you place your classes?
    From my knowledge of tomcat, classes are normally placed in, in this case:
    home/sonny/web-inf/classes
    Maybe it differs from windows enviroment to *nix enviroment.. well, I'm just saying out so if its not the case.. don't mind me.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can not call bean class from JSp/Tomcat 5.5

    hello everyone...
    i m using one bean class Parser which is called by discussion.jsp page. i put class file in webapps/grid/WEB-INF/classes and JSP page is in webapps/grid/. The whole combination is working fine for tomcat 3.3.2 but not working properly in tomcat 5.5.
    Error is as follow...
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 38 in the jsp file: /discussion.jsp
    Generated servlet error:
    Parser cannot be resolved or is not a typeplease help me....
    Thank in Advance

    You still need to import the class from the default package. As a word of advice you should put the class in a package. The later versions of Tomcat do not play well with bean classes that are not in packages.

  • The syntax for accessing MS SQL db from JSP

    Can anybody help me with the syntax for accessing MS SQL db from JSP???
    This is what I do when I use MySQL:
    Class.forName( "org.gjt.mm.mysql.Driver" );
    Connection conn = DriverManager.getConnection(
         "jdbc:mysql:://um" ,
    What do I write when it is MS SQL and where do I install the driver
    BR Soren

    Can anybody help me with the syntax for accessing MS
    SQL db from JSP???
    This is what I do when I use MySQL:
    Class.forName( "org.gjt.mm.mysql.Driver" );
    Connection conn = DriverManager.getConnection(
    "jdbc:mysql:://um" ,
    What do I write when it is MS SQL and where do I
    install the driver
    BR Soren
    One way of doing this is to use ODBC. Here's an example:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:<odbc name>", "<login>", "<password>");

  • Calling WEB-INF/lib/.Jar class from JSP

    Hi everybody.
    I have a problem about calling my jar file class from JSP .My development plotform is WSAD 5.1.2 and application server : WebSphere Test Server 5.1.This is the my server console error:
    error: IO exception sun.io.MalformedInputException
    D:\Projeler\Mustafa Yilmaz\WFR\WTIREAR\WTIRSD.jar&#40;dvo/utb_part_tai_tool_code_bilgi_DVO.java&#41;:4: cannot access ortak.dvo.AnaDvo
    bad class file: D:\Projeler\Mustafa Yilmaz\WFR\WTIREAR\ERPOrtak.jar&#40;ortak/dvo/AnaDvo.java&#41;
    file does not contain class ortak.dvo.AnaDvo
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    &#40;source unavailable&#41;
    3 errors
    ]: org.apache.jasper.JasperException: Unable to compile class for JSP
    D:\Projeler\Mustafa Yilmaz\WFR\WTIREAR\WTIRSD.jar(dvo/utb_part_tai_tool_code_bilgi_DVO.java):8: class utb_part_tai_tool_code_bilgi_DVO is public, should be declared in a file named utb_part_tai_tool_code_bilgi_DVO.java
    (source unavailable)
    error: IO exception sun.io.MalformedInputException
    D:\Projeler\Mustafa Yilmaz\WFR\WTIREAR\WTIRSD.jar(dvo/utb_part_tai_tool_code_bilgi_DVO.java):4: cannot access ortak.dvo.AnaDvo
    bad class file: D:\Projeler\Mustafa Yilmaz\WFR\WTIREAR\ERPOrtak.jar(ortak/dvo/AnaDvo.java)
    file does not contain class ortak.dvo.AnaDvo
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    (source unavailable)
    3 errors
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:129)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.loadJSP(JspServlet.java:941)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:285)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:317)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    can you help me ?

    class utb_part_tai_tool_code_bilgi_DVO is public,
    should be declared in a file named utb_part_tai_tool_code_bilgi_DVO.java...
    cannot access ortak.dvo.AnaDvo bad class file:
    D:\Projeler\Mustafa Yilmaz\WFR\WTIREAR\ERPOrtak.jar(ortak/dvo/AnaDvo.java)
    file does not contain class ortak.dvo.AnaDvoThe error messages say it all. Rename the .java files so that they match the class names. Then recompile and repack the JAR file.

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • How to access a Java class from view controller?

    Hi All,
    I have created a Test.java class file from Navigator view under
    Src --> Packages --> com.sap.MyProject.
    When I try to access the Test class from view controller,
    I getting this error "Test cannot be resolved or is not a type".
    How do I fix this?
    Thanks
    Sundar

    Hi,
    I have created a Test.java class file from Navigator view under
    Src --> Packages --> com.sap.MyProject.
    After this you can goto the context of your View and define the VA goto the type of VA and click on the right side button and go to java native type and type your java file name click you name .
    that means the jave file s assigned to VA.
    U can utilize thrut that VA.
    Thanks,
    Lohi.

  • Can I access my windows computer from mu ipad?

    am wanting to buy an ipad2, but I have a Windows based computer at home that I take college classes on.  Can I access my home work from my ipad ?

    Do you mean seize control remotely? There are a variety of apps that will let you do that - I use Splashtop, which recently rolled out a way to access and control the PC over the Internet. If you just mean copy docs over to your iPad, then also yes - through cloud storage (such as DropBox) or productivity apps such as Goodreader or the many office suite apps.

  • (261936172) Q general How can I access an EJB hosted on a remote server?

    Q<general> How can I access an EJB hosted on a remote server?
    A<general> The ability to add EJB control files enables you to access an EJB that
    is deployed to the server on which your web service is running. When you select
    "add EJB control" you need to supply the home and remote interfaces for the EJB
    as well as the JNDI name. This does not provide you with the capability for creating
    a control for a remotely hosted EJB. To use a EJB hosted on another server you
    will have to provide the appropriate code within your web service itself. You
    will have to programmatically gain to access the JNDI for the remote server, lookup
    up the home stub and use it to create the remote stub for the EJB. Of course,
    to make this work you must have the necessary client interfaces in you classpath
    (home and remote interfaces) which can easliy be achieved by adding the EJB client.jar
    file to the lib directory in the webservice WEB-INF folder.

    just define the different server path in the description xml file
    <jndi-name>jnp://serverA(B)/....</jndi-name>

  • I have converted a pdf to word. How can I access the Word file from my online account?

    I have converted a pdf to word. How can I access the Word file from my online account? When it says 'download the converted file' I choose a location on my PC and click, but nothing happens. It seems that it can only save the converted file to my online account. I went to my online account but I see no way to look for the file

    Hey Fabrizio,
    You might need to sign up at "https://cloud.acrobat.com/exportpdf" using your Adobe ID credentials to convert your PDF file to Word.
    Do you get the 'download' prompt?
    Also, you can find the converted files by clicking at the 'Files' tab. 
    Please try the same using a different browser and check.
    Hope to hear from you.
    Regards,
    Anubha

  • Can I access my itunes lib from another comp on my wireless network at home

    How can I access my itunes library from another computer in my home. The computers are on a wireless network. The computer that we have used as our main computer and that has our library on it is running Windows XP. The laptop that I want to use to access the library is running VISTA. ANy ideas?

    You can sign into the iTunes Store on it, but your library won't be automatically put onto it.
    (100361)

Maybe you are looking for