Problem with JSP using bean packaged in jar file

Hi,
          I am trying to use a java bean in a jsp file. The java bean is packaged
          into a jar file. I am getting class not found compilation error. If the
          bean remains to be a seperated class file, everything work well.
          Does anyone know how I can use bean in a jar file within jsp , i.e. to
          allow the bean to be found during compilation ?
          Thanks,
          Terence.
          [email protected]
          

Jacek,
          Thanks for replying.
          My JSP's are just files in my document root . However, I found a solution to
          my
          problem. That is to have the jar file defined in my weblogic.class.path. I may
          have missed some files in my original jar file which causes my problem.
          Mayby I should package everything into a web application for deployment. That
          will be my next step.
          Thanks anyway.
          Terence.
          Jacek Laskowski wrote:
          > Terence Lai wrote:
          > >
          > > Hi,
          > >
          > > I am trying to use a java bean in a jsp file. The java bean is packaged
          > > into a jar file. I am getting class not found compilation error. If the
          > > bean remains to be a seperated class file, everything work well.
          >
          > How do you use the JSP file ? Is it a part of web application ? If so,
          > the bean jar package should be located in WEB-INF/lib directory. It's
          > also recommended to put the bean class into a package, so it's not in
          > 'unnamed' package, and <jsp:useBean> can find it.
          >
          > >
          > > Does anyone know how I can use bean in a jar file within jsp , i.e. to
          > > allow the bean to be found during compilation ?
          >
          > see above.
          >
          > > Terence.
          >
          > Jacek Laskowski
          > HP Consulting
          

Similar Messages

  • How to use Stylesheets packaged in JAR file

    Hi,
    I would like to package XSL files in a JAR. The stylesheet may import other XSL files. For example:
    <xsl:import href="demos.xsl">
    <xsl:import href="table.xsl">
    where the original stylesheet and the imported stylesheets (demos.xsl and table.xsl) are all located in this package: com.company.xsl
    Is there a way for the transformers to retrieve the files from the JAR?
    Possibly another complication is that this JAR file is loaded at runtime.
    Any suggestions would be of great help. Thanks!

    Thanks that worked.
    However, is it possible to use a relative path? Right now it only works if the absolute path is used:
    <xsl:import href="jar:file:///c:/applications/bin/myjar.jar!/com/company/xsl/table.xsl" />
    It would be nice if this worked instead:
    <xsl:import href="jar:file:///./bin/myjar.jar!/com/company/xsl/table.xsl" />

  • Problem deploying and using custom Tags in jar files

    I am trying to create a custom tag library of Java classes, package them in a JAR file, and use them in another web application. Here is the JAR file structure, named mytags.jar:
    META-INF
    META-INF/manifest.mf
    META-INF/taglib.tld
    mytags/FooBar.class
    mytags/Another.class
    ...Here is the taglib.tld file:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <taglib xmlns="http://java.sun.com/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
    version="2.0">
       <tlib-version>1.0</tlib-version>
       <short-name>foo</short-name>
       <uri>fooTags</uri>
       <info>My tags</info>
       <tag>
         <name>fooBar</name>
         <tag-class>mytags.FooBar</tag-class>
         <body-content>empty</body-content>
         <attribute>
           <name>name</name>
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
         </attribute>
      </tag>
    </taglib>The FooBar class has getName(String) and setName() methods.
    In the web application, I have copied mytags.jar into the WEB-INF/lib directory. I've verified that it lands in the corresponding directory for my appserver (I'm using Tomcat 6.0.10).
    Here's the header for my JSP:
    <%@ page language="java" contentType="text/html;charset=UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="fooTags" prefix="foo" %>
    <foo:fooBar name="dummy" />
    ...When I access my page, the browser sits there and spins, not able to do anything. I know that some of the content is executed, but it is not able to get to the fooTags. I have tried replacing fooTags with WEB-INF/lib/mytags.jar, to no effect.
    According to the docs, I should not need to include anything in web.xml to reference the fooTags. The tag library classes are valid, since I used them as local tags prior to moving them into a Jar library.
    Any help would be appreciated

    Take the code of the jsp file :
    <%@ page language="java" %>
    <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    <html>
       <head>
         <title> First Struts Application </title>
       </head>
         <body>
            <table width="500" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> </td>
            </tr>
            <tr bgcolor="#36566E">
              <td height="68" width="48%">
                <div align="left">
                  <img src="images/hht.gif" width="220" height="74">
                </div>
              </td>
            </tr>
            <tr>
             <td> </td>
            </tr>     
           </table>
           <html:form action="Lookup"
                      name="lookupForm"
                      type="wiley.LookupForm" >
           <table width="45%" border="0">
            <tr>
              <td>Symbol:</td>
              <td><html:text property="symbol" /> </td>
            </tr>
             <tr>       
              <td colspan="2" align="center"><html:submit/> </td>
             </tr>       
            </table>              
          </html:form>
         </body>
    </html>

  • Problems with loading Ressources out of a jar file

    Hi Folks !
    My current job for my university is to make some Java programms runnable as a WebStart Application. With most of the programms this was no problem. But i have a problem with one.
    The gui of the program loads some icons out of the jar file with the following code:
    try {
          openIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/open.png"));
          generateIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/generate.png"));
          editIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/edit.png"));
          propertiesIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/properties.png"));
          alphabetIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/alphabet.png"));
          cutIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/cut.png"));
          saveIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/save.png"));
          helpIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/help.png"));
          aboutIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/about.png"));
          exitIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/exit.png"));
          startIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/start.png"));
          stopIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/stop.png"));
          preferencesIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/preferences.png"));
          okIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/ok.png"));
          noIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/no.png"));
          clearIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/clear.png"));
          plusIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/plus.png"));
          minusIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/minus.png"));
          overlapIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/overlap.png"));
          canselIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/cansel.png"));
        catch(NullPointerException e){
          JOptionPane.showMessageDialog(frame,
              "There was an error while loading icon files. Probably the needed icon files are not present.",
              "Missing icon files!", JOptionPane.ERROR_MESSAGE);
        }When i start the program as a normal jar with
    java -jar ssstester.jarAll Icons are loaded normaly. But when i start it as a WebStart Application i get the catch (NullPointerException e) error message "There was an error while loading icon files. Probably the needed icon files are not present. Missing icon files!".
    So where is the problem ? Don't know if it is important, but the Application gets full rights in the jnlp File
    <security>
        <all-permissions/>
    </security>Greetings and sorry for my horrible english,
    Christoph

    Thread.currentThread().getContextClassLoader().getResource(imageFilePath); to load the images than the one you are using right now
    Edited by: Mayya on Jun 17, 2008 4:34 AM

  • Problems with JSP - using tag library with Weblogic 8.1

    I am getting the following error when I try to run a web application called "regain":
    /searchinput.jsp(2): Error in using tag library uri='regain-search.tld' prefix='search': cannot find tag class: 'net.sf.regain.ui.server.taglib.MsgTag'
    probably occurred due to an error in /searchinput.jsp line 2:
    <%@taglib uri="regain-search.tld" prefix="search" %>
    The classes that the .tld file points to are in the web applications WEB-INF/classes directory and I have put this path into my classpath environment variable (running Windows 2000 Server).
    This application runs fine on Tomcat.
    I can't not figure out whether is error is masking another error or what. I've tried using JDK and Jrockit for my web app - no luck.
    Please help! Thanks!

    anyone? :/

  • I have problem with the BPEL server caching the jar file of Instance

    Is there any way to undeploy and redeploy a process where you have changes to the underlying DA, without the BEPL server being restarted. This always works in my Local BPEL server in my Laptop. But when deploying in the hosted BPEL enviroment it becomes a big problem in getting it restarted when ever I MAKE changes.
    Is there any other way to disable the Cache of the instance and make it use the newer version uploaded. One more thing if the connection to a database is severed, then the DA will not work until the server is restarted. All the instances using the said connection is failing with either "Invalid Datatype" or "Socket Read exception". Can someone help!!
    Thanks,
    Prabhakar

    Hi,
    have you tried to kill the session of the DA in the database?

  • Unable to install itunes 10,5.I receive this message: there is a problem with this window installer package. A program required for nthis install to complete could not run. Contact your support personnel or package vendor.Am using window ultimate 64 bits

    I am unable to install itunes 10,5. I receive this message: There is a problem with this window installer package. A program required for this install to complete could not run. Contact your support personnel or package vendor. I am using window 7 ultimate 64 bits

    There is a problem with the Window installer package. A program required for this intall to complete could not be run. Contact your support personnel or package venfor.
    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • I am trying to upgrade to itunes 10.5 on my pc which using windows xp but it keep saying there is a problem with this windows installer package. A program run as part of the setup did not finish as expected. Contact your support personel or package vendor

    I am trying to upgrade to itunes 10.5 on my pc which is using windows xp but i keep getting an error message stating that there is problem with this windows installer package. A pogram run as part of the setup did not finish as expected. Contact your suppor personal or package vendor.

    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • A simple problem with sateful Session beans

    Hi,
    I have a really novice problem with stateful session bean in Java EE 5.
    I have written a simple session bean which has a counter inside it and every time a client call this bean it must increment the count value and return it back.
    I have also created a simple servlet to call this session bean.
    Everything seemed fine I opened a firefox window and tried to load the page, the counter incremented from 1 to 3 for the 3 times that I reloaded the page then I opened an IE window (which I think is actually a new client) but the page counter started from 4 not 1 for the new client and it means that the new client has access to the old client session bean.
    Am I missing anything here???
    Isn�t it the way that a stateful session bean must react?
    This is my stateful session bean source.
    package test;
    import javax.ejb.Stateful;
    @Stateful
    public class SecondSessionBean implements SecondSessionRemote
    private int cnt;
    /** Creates a new instance of SecondSessionBean */
    public SecondSessionBean ()
    cnt=1;
    public int getCnt()
    return cnt++;
    And this is my simple client site servlet
    package rezaServlets;
    import java.io.*;
    import java.net.*;
    import javax.ejb.EJB;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.SecondSessionRemote;
    public class main extends HttpServlet
    @EJB
    private SecondSessionRemote secondSessionBean;
    protected void processRequest (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType ("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter ();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet main</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Our count is " + Integer.toString (secondSessionBean.getCnt ()) + "</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close ();
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    protected void doPost (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    }

    You are injecting a reference to a stateful session bean to an instance variable in the servlet. This bean instance is shared by all servlet request, and that's why you are seeing this odd behavior.
    You can use type-leve injection for the stateful bean, and then lookup the bean inside your request-processing method. You may also save this bean ref in HttpSession.
    @EJB(name="ejb/foo", beanName="SecondBean", beanInterface="com.foo.foo.SecondBeanRemote")
    public MyServlet extends HttpServlet {
    ic.lookup("java:comp/env/ejb/foo");
    }

  • Possible classpath problems with JSP

    I'm trying to run a simple jsp under ocj4 and I'm running into problems. Other jsp's run fine so I'm pretty sure everything's installed right. However, when I try and use the ConnCacheBean I get a "bean type ConnCacheBean not found error". Now the class is there under (on my system) d:\oracle\jsp\lib in osjputil.jsp. I tryed adding this manually to the -cp option of java when I run orion.jar but to no help.
    Where can I set this classpath variable (if this what's going wrong, if not what is) as I can't find anything addressing this in the documentation.
    thanks
    Jonny Wray
    null

    I've had success putting my non-JSP stuff into a simple jar file and placing it in
    j2ee/home/default-web-app/WEB-INF/lib. It seems that the engine picks up anything in that directory.
    Possibly, you will have to create this lib directory yourself.
    See if this helps.
    Cheers,
    Malte Christensen
    null

  • I am trying to install iTunes on my PC, but I get this error: "There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor." Help!

    I am trying to install iTunes on my PC (using Windows 8.1), but I get this error: "There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor." The iTunes file (64-bit) I am trying to install, is named "iTunes64Setup.exe". What seems to be the problem? Help!

    Hey madnest,
    Thanks for the question. After reviewing your post, it sounds like you are having difficulty installing iTunes in Windows. I would recommend that you read this article, it may be able to help you resolve or isolate the issue.
    Issues installing iTunes or QuickTime for Windows
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • How to re-install iTunes after receiving "There is a problem with this Windows Installer package ..." message?

    Hi,
    This is how it all started. When the new update for iTunes 11 came out, I tried to update it. After I had updated it I found nothing had changed. So i tried rebooting my computer and everything and found that still nothing had changed. So I tried uninstalling it. After that I tried to re-install it, but it came up with the
    "There is a problem with this Windows Installer package ..." message. So I looked around the internet and found a website that told me to uninstall all Apple products. So i did that. When i tried to uninstall Apple Software Update, it came up with the 'problem with windows' message again. So I used Revo to uninstall it. So I rebooted and tried to install it again. It installed Bonjour and all of the other programs but stopped halfway and gave me the 'proplem with windows' message again. I've looked around and most of the solutions have been to try and repair Apple Software Update, but the problem is, I've already deleted it. So can someone PLEASSEEEE help me fix this problem! (Sorry for droning on)

    http://support.microsoft.com/mats/Program_Install_and_Uninstall  try this an see if it fixes it.

  • Error message on window 7 for install iTune and iCloud!!!"There is a problem with this Windows installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor."

    Hi,
    I just try to install the setup download from apple website for iTune and iCloud.
    During the installation, there was error message prompt out "There is a problem with this Windows installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor."
    I am using Window 7 32 bit. I have try several time for install, but the result is getting same error message.
    Anyone can help on this??????
    Thanks.
    Justin

    I have also tried extracting the individual components to the temp file and attempting to install them individually despite being unable to remove the previous install of Apple Software Updater.  The outcome, both Apple Software Updater and itunes encountered the same error message during the install process.

  • ITunes won't upgrade to10.5. Error message "There is a problem with the Windows installer package. Contact the package vendor". I need help.

    iTunes won't upgrade to10.5. I'm on 10.1.17.
    When installing 10.5 it terminates with an error message "There is a problem with the Windows  installer package. Contact the package vendor".
    It does not provide an error code or details/description to further troubleshoot. As a result I can't upgrade my Apple devices to leverage the cloud.
    Any smarts out there who could help?
    Using PC Win-7 w/IE 7 (should that matter)
    Thanks much

    I know there's a million threads like this, but I thought I'd record my experience.  I, too, was having the original poster's error when I tried to update iTunes on Windows XP.  I think I was stuck on 10. 
    I solved it by un-installing iTunes and every other Apple app.  I discovered that Apple Software Update would not un-install as its MSI file could not be found.  I used the "Windows Install Cleanup" tool from Microsoft to remove Apple Software Update from the list of installed programs.  Google "kb290301" for a Microsoft page that includes a download link for it.  After that, I was able to install a fresh copy of iTunes 10.5.2.
    I'm not sure why this app's folder and MSI were missing from my computer.  I had once used Laplink PC Mover to move everything from my old computer to this one, and perhaps it missed a bit.

  • I need to Uninstall Apple Software Update. I am getting error. "There is a problem with this Windows Installed package.

    My itunes stopped working. I uninstalled/reinstalled. But it would not complete reinstall. Started with Quicktime not loading. I have tried to install Quicktime individually. Still nothing. I now am trying to uninstall ALL itunes/Apple to attempt reinstall. But the Apple Software Update will not remove. I get the error :THERE IS A PROBLEM WITH THIS WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN. CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR.

    Hey madnest,
    Thanks for the question. After reviewing your post, it sounds like you are having difficulty installing iTunes in Windows. I would recommend that you read this article, it may be able to help you resolve or isolate the issue.
    Issues installing iTunes or QuickTime for Windows
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

Maybe you are looking for

  • Target Named Anchor in a Spry Collapsible Panel from a different page

    Let me start by saying I have combed this forum (and others) looking for a resolution to this.  I am familiar with David Powers solution on Foundationphp.com and am using that code in project to open the collapsible panel from a separate page and it

  • Quicktime NO Longer Gets Streamed H264 Video . Why

    for teh past year and ahalf i have streamed live content to our helix server, and have been able to watch it with quicktime on other pc's however in teh past month and few updates, quicktime has broken this. no video is diesplayed at all. if we chang

  • External display and "clam shell" closed lid mode = "Input Not Supported"

    I have an Acer AL2016W 20" monitor hooked up to my again Powerbook due to it having a cracked screen. It is working just fine right now, in 1680x1050, when the screen is open. Citing this article, http://support.apple.com/kb/HT3131 I should be able t

  • Deployed with warnings

    Hello All, I have a SC in a track. I have a used another SC in the same track. I can not create DCs from the used track as it is added only as a dependency. I am using an external library DC from that SC in one the DCs of my original SC. The DC gets

  • OPEN_DATASET_NO_AUTHORITY abap dump

    Hi! We have a Z-program to upload CSV files. With my user, it works ok. With the file_loader_user, it appears a dump. Ichecked with the PFCG the role for this user, and it has the S_DATASET object with activities: 33, 34. Program: SAPLSCMS_FILE What