Error trying to use jsp:useBean
I am trying to use a class in a JSP that is basically a connection to an
Oracle database. It works fine when used from a servlet. However, when I try
to instantiate it from a JPS page, I get errors. Here is the snippet from
the JSP page:
<%@ page import="engr.projmgmt.*" %>
<jsp:useBean id="OB" class="engr.projmgmt.OracleBroker" />
The class is here:
/usr/local/apache/servlets/engr/projmgmt/OracleBroker.class
The weblogic class path contains /usr/local/apache/servlets.
I get the following error in the weblogic log:
Mon Aug 13 17:39:15 PDT 2001:<E> <ServletContext-General> Servlet failed
with Exception
java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
java.lang.IllegalAccessException: engr/projmgmt/OracleBroker
at java.beans.Beans.instantiate(Beans.java:215)
at java.beans.Beans.instantiate(Beans.java:55)
at jsp_servlet._PM._index._jspService(_index.java:90)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:120)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:915)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:879)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:269)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
--------------- nested within: ------------------
weblogic.utils.NestedRuntimeException: cannot instantiate
'engr.projmgmt.OracleBroker' - with nested exception:
[java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
java.lang.IllegalAccessException: engr/projmgmt/OracleBroker]
at jsp_servlet._PM._index._jspService(_index.java:92)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:120)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:915)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:879)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:269)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
Anyone have anyideas?
Thanks,
CC
I appears that your default constructor is not publicly accessible from the
exception.
Sam
"Chuck Carson" <[email protected]> wrote in message
news:[email protected]...
>
> I am trying to use a class in a JSP that is basically a connection to an
> Oracle database. It works fine when used from a servlet. However, when I
try
> to instantiate it from a JPS page, I get errors. Here is the snippet from
> the JSP page:
>
> <%@ page import="engr.projmgmt.*" %>
> <jsp:useBean id="OB" class="engr.projmgmt.OracleBroker" />
>
> The class is here:
> /usr/local/apache/servlets/engr/projmgmt/OracleBroker.class
> The weblogic class path contains /usr/local/apache/servlets.
>
> I get the following error in the weblogic log:
>
> Mon Aug 13 17:39:15 PDT 2001:<E> <ServletContext-General> Servlet failed
> with Exception
> java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
> java.lang.IllegalAccessException: engr/projmgmt/OracleBroker
> at java.beans.Beans.instantiate(Beans.java:215)
> at java.beans.Beans.instantiate(Beans.java:55)
> at jsp_servlet._PM._index._jspService(_index.java:90)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :120)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:915)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:879)
> at
>
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
> Manager.java:269)
> at
>
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
> --------------- nested within: ------------------
> weblogic.utils.NestedRuntimeException: cannot instantiate
> 'engr.projmgmt.OracleBroker' - with nested exception:
> [java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
> java.lang.IllegalAccessException: engr/projmgmt/OracleBroker]
> at jsp_servlet._PM._index._jspService(_index.java:92)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :120)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:915)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:879)
> at
>
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
> Manager.java:269)
> at
>
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
>
>
> Anyone have anyideas?
>
> Thanks,
> CC
>
>
Similar Messages
-
Why do you use jsp:useBean?
Hi,
I have one "simple" question :) : When or why do you are using <jsp:useBean>,<jsp:getProperty> and <jsp:setProperty>?
For practice, I am creating a form, sends the data to a servlet and the servlet "packs" the parameter into a Bean and put this Bean into a request- or SessionScope. After that, my resultpage could access the property name of the bean with (for instance) sessionScope.Bean.name.
I wanted to use the 3 tags above first, but after I realised the way I describes above I didn't have to use these three jsp tags. Therefore I wonder when you are using these tags.
Thnx
Alexhi
The component model for JSP technology is based on JavaBeans component architecture. JavaBeans components are nothing but Java objects which follow a well-defined design/naming pattern: the bean encapsulates its properties by declaring them private and provides public accessor (getter/setter) methods for reading and modifying their values.
Before you can access a bean within a JSP page, it is necessary to identify the bean and obtain a reference to it. The <jsp:useBean> tag tries to obtain a reference to an existing instance using the specified id and scope, as the bean may have been previously created and placed into the session or application scope from within a different JSP page. The bean is newly instantiated using the Java class name specified through the class attribute only if a reference was not obtained from the specified scope. Consider the tag:
sun site -
Unable to use jsp:useBean tag
when I use
<jsp:useBean id="addressBean" class="AddressBean" scope="session"/>
I get the following error
Exception Details: org.apache.jasper.JasperException
Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path.
So my question is how to use the <jsp:useBean> tag in JSCPlease see my message How to set developer's mode for oracle jsp engine.
As a very early warning of the future, this way of setting configuration paramemter in web.xml for oracle jsp engine will be deprecated in the next major version of oc4j and desupported probably later on. Yes, it is still supported in 10.1.3 and the next major version, though. -
Which one better to use - jsp:useBean or import statement
Hi,
I just want to know that which one is better to use jsp:useBean or import statement .
I can instantiate and call method of myclass -
1) by importing the class through import tag in jsp as <%@page import="myclass"%. or
2). by using <jsp:useBean tag....
i have these two option to do the same thing. i know that basically useBean is used to call setter and getter method of bean class and but it can be used to call a normal java file that have some logic .
so what should i used , which one is better and why?
useBean provides scope and object instance so no need to create object by new operator. and with import you have to create an instance .
but which tag should i use in my jsp?
i am confused???ok, means i can use jsp:useBean tag for all my
classes that are not actually bean. so it will be
instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
>
but when should i use import statement in my jsp and
it happen at translation time so will it create any
type of burden for my code if i import multiple
classes.For non-java beans, you need to import the classes, period.
It's not a burden, it's a necessity. -
Error message when using JSP pages
Version 6.0
The error I'm getting is as follows:
trying to POST headerFragment.html, internal-redirect reports: no way to service request for headerFragment.html
All I'm trying to do is a jsp:forward on JSP page 1 to JSP page 2 which, at the top of it, has a jsp:include (the headerFragment.html page mentioned in the error).
Any thoughts on how to remedy this problem would be appreciated.
Thanks,
MarkBy default, the server will not serve static files in response to POST requests, even when using jsp:include.
This bug was addressed in 6.0 SP2, but instances created in an earlier release will continue to exhibit the problem even after upgrading. To fix the problem, locate the following line in the obj.conf configuration file:
Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-fileChange the above line so it reads as follows:
Service method=(GET|HEAD|POST) type=*~magnus-internal/* fn=send-file -
I am running MS Word 2011, latest Mac OS, and trying to use the Mail Merge option with the Apple Address Book as the data source.
However whenever I select the Apple Address Book as the data source, I get the error "Word was unable to open the data source".
Anybody got any idea why?
Thanks for your helpI am guessing you could have solved this little problem already but perhaps someone else may benefit:
I struggled with the same problem - not being able to use Mac Address Book (i.e. Contacts) with Word 2013 for mac mail-merge (on Mountain Lion and, now, on Mavericks) - with the exact same error message reported by Klausngigtoas above .
So I read lots of techie stuff on forums which passed a nice few hours but didn't help. Finally, with slumped, defeated expression, I gave up.
But I just now (such is life) I accidentally stumbled upon the simple solution:
1. Enter System Preferences and click Security & Privacy.
2. Select the Privacy tab and then on Contacts on the left hand panel.
3. In the right hand panel ("Allow the apps below to access your contacts") just tick the Contacts box.
4. And Voilà! - at least it worked for me - hope it does for you. -
Error trying to use OLTCommandLine.jar
I have an error trying to run an OLT Scenario from command line using OLTCommandLine.jar as described in Chapter 4.3.6 of the OLT Load Testing Users Guide. (OATS 12.1) If anyone has input please let me know.
I am attempting to invoke OLTCommandLine.jar on the OATS Server with the following command line:
C:\OracleATS\jdk\bin\java.exe -jar C:\OracleATS\lib\OLTCommandLine.jar -run -scenarioFile="C:\OracleATS\OFT\Login_LOAD\Login_LOAD.scn" -session="Login_LOAD_CMD_test" -OLTServer=localhost:8088 -user=Administrator -password=XXXXX -log C:\Temp\myOLTlog.log
The error message is as follows:
Error initializing controller connection to t3://10.0.1.13:8088/Administrator\n\n(message id=ctl.initError)
Please make sure the OLT server is running!I was able to resolve this issue.
The error message indicated a problem using the t3 protocol. The local weblogic install did not have it enabled. I was able to login to the weblogic console (http://localhost:8088/console) as user "oats" with the install password. Then I figured out that I needed to click the "Enable Tunneling" checkbox. After that the OLTCommandLine.jar started working as desired. -
Getting Error Trying to Use addField Method
I am trying to use automation to add a field to a document but get an error stating Invalid Argument Type..
Here is part of my code:
avDocMM =
CreateObject("AcroExch.PDDoc")
If File(whatDrawingNumber) = .T. Then
ispdffilee = avDocMM.Open(whatDrawingNumber)
If ispdffilee = .T.
jse3MM = avDocMM.GetJSObject
*dfrnopMM = jse3MM.numPages
STORE 50 TO array1(1)
STORE 20 TO array1(2)
STORE 450 TO array1(3)
STORE 0 TO array1(4)
jse4MM = jse3MM.addField("test","text",0,array1)
avDocMM.
Close()Hi Marco,
I guess I need to install XML functions in my DB. Do you think anything else might be the problem?
Here is the table description:
SQL> describe resultstable;
Name Null? Type
TAXON NUMBER(38)
GENOMEID VARCHAR2(30)
REFSEQNA VARCHAR2(40)
CONTIGNAME VARCHAR2(40)
LOCATIONID CHAR(3)
SEQUENCEVERSIONID NUMBER(38)
EXTFEATUREID VARCHAR2(11)
GENEID NUMBER(38)
LEFTEND FLOAT(126)
RIGHTEND FLOAT(126)
STRAND VARCHAR2(30) -
Error trying to use VHV or diff
Hi,
I've installed SCM 9.0.4 on a 9i database. I'm trying to use it but I get the following error while trying to use RON's diff tool or VHV:
Message
CDR-03120: Internal Error - Problem making a repository connection
Cause
An internal Diff or Merge component has been
unable to make a repository connection.
How can I get this to work?
thanks
LapollaLapolla,
This is typically a problem with the entry in tnsnames.ora for the database instance. Can you check that it looks similar to:
UKP1111.ORACLE.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ukp1111)(PORT = 1521))
(CONNECT_DATA =
(SID = ORCL)
The connection used by the RON is vmia sqlnet, the VHV and Diff/Merge use a jdbc connection, thus your tns entries may work for the RON and not the java tools.
David -
I get an odd error when trying to use TreeSet on my computer... even in code that I know compiles on other computers...
C:\Program Files\JavaCompiler\Programs\Exam2\Prob03>javac Prob03.java
.\Prob03MyClass.java:1: cannot resolve symbol
symbol : class TreeSet
location: class Prob03MyClass
class Prob03MyClass extends TreeSet
^
1 error
I'm figuring that it doesn't know where to find TreeSet... even though I put in the command
import java.util.*;
So... anyone know what I can do to fix this?nevermind... I had the import java.util.* only in the driver program, and not in the class...
When I put it in the class, it worked... kinda... -
Topic: error occuring while use jsp
code:
Parsing of JSP File '/view.jsp' failed:-------------------------------------------------------------------------------- /view.jsp(18): "mybean" is not a defined bean variable on this pageprobably occurred due to an error in /view.jsp line 18:value="<jsp:getProperty name="mybean" property="firstname"/>"/>
this is the error i am getting while accesing the view.jsp.
here below is my view.jsp and mybean.java codes.
view.jsp
code:
<jsp:useBean id="mybean" class="mvc.beans.mybean" scope="request"/ ><html><head><title>MVC View</title></head><body><h2>MVC Architecture View<h2><form method="post" action="myservlet"><table> <tr> <td> First Name: </td> <td> <input type="text" name="form first name" value="<jsp:getProperty name="mybean" property="firstname"/>"/> </td> </tr> <tr> <td> Last Name: </td> <td> <input type="text" name="form last name" value="<jsp:getProperty name="mybean" property="lastname"/>"/> </td> </tr> <tr> <td> E-mail: </td> <td> <input type="text" name="form mail" value="<jsp:getProperty name="mybean" property="email"/>"/> </td> </tr> <tr> <td> <input type="submit" value="submit"/> <td> <tr> </table></form></body> <pre> <jsp:getProperty name="mybean" property="message"> </pre></html>
mybean.java
code:
package mvc.beans; public class mybean{ private String firstname; private String lastname; private String email; public String getFirstname() { return fixNull(this.firstname); } public String getLastname() { return fixNull(this.lastname); } public String getEmail() { return fixNull(this.email); } public void setFirstname(String firstname) { this.firstname=firstname; } public void setLastname(String lastname) { this.lastname=lastname; } public void setEmail(String email) { this.email=email; } private String fixNull(String in){ return (in == null) ? "" : in; } public String getMessage() { return "\nFirst Name:" + getFirstname() + "\n" +"Last Name :" + getLastname() + "\n" +"email :" + getEmail() + "\n"; } };
please clarrify my error.Are u putting the bean in the request scope????
-
Why use jsp:useBean?
I got the below sample code in sun document. Here bookId is passed as a parameter in cart.remove method and sql query. I want to know why the statement "<jsp:useBean id="bookId" type="java.lang.String" /> " is used.
<c:set var="bookId" value="${param.Remove}"/>
<jsp:useBean id="bookId" type="java.lang.String" />
<% cart.remove(bookId); %>
<sql:query var="books"
dataSource="${applicationScope.bookDS}">
select * from PUBLIC.books where id = ?
<sql:param value="${bookId}" />
</sql:query>
thanks,
VinodhThe useBean tag has a side effect of creating a local scriptlet variable with the id "bookId"
This variable is then used on the next line in the scriptlet code.
In effect, it is executing the following code
<c:set var="bookId" value="${param.Remove}"/>
<%
String bookId = (String)pageContext.findAttribute("bookId");
cart.remove(bookId); %>which if you think about it, you could get rid of the <c:set> and have the scriptlet code access the variable directly.
<%
String bookId = request.getParameter("Remove");
cart.remove(bookId); %>Mixing scriptlet and JSTL code in this fashion gets confusing.
The scriptlet code here is part of the 1% of code that can't be replaced directly by JSTL (but could be replaced by a custom function/tag)
However it more probably belongs in a servlet/bean. -
Error trying to use OWB 10.2
Hi:
Could anybody help? I am using windows XP with service pack 2:
OWB client version 10.2.0.1.31
OWB repository 10.2.1.0
ORACLE DATABASE 10.1
I just installed OWB 10.2 in windows XP. I created repositories and I could open the design center, However trying to open a mapping or create a table, view etc. I get the following error:
API5072: Internal Error: Null message for exception. Please contact Oracle Support with the stack trace and details on how to reproduce it.
oracle.wh.util.Assert: API5072: Internal Error: Null message for exception. Please contact Oracle Support with the stack trace and details on how to reproduce it.
at oracle.wh.util.Assert.owbAssert(Assert.java:51)
at oracle.wh.ui.jcommon.OutputConfigure.showMsg(OutputConfigure.java:216)
at oracle.wh.ui.common.CommonUtils.error(CommonUtils.java:370)
at oracle.wh.ui.console.commands.TreeMenuHandler.error(TreeMenuHandler.java:132)
at oracle.wh.ui.console.commands.TreeMenuHandler.error(TreeMenuHandler.java:121)
at oracle.wh.ui.console.commands.CreateCmd.performAction(CreateCmd.java:86)
at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Could anybody help? I am using windows XP with service pack 2:
OWB client version 10.2.0.1.31
OWB repository 10.2.1.0SolutionTo implement the solution, please execute the following steps:
1. Log into OWB Design Center.
2. Navigate to Tools -> Preferences.
3. For Appearance, set locale to a value (use English US ).
4. Restart OWB Design Center.
5. Retest the issue.
8. Migrate the solution as appropriate to other environments. -
Output error trying to use Classes
I downloaded and installed the classes that come with "Flade"
I am trying to learn how to use the classes that comes with it.
In my actionscript I have:
import org.cove.flade.util.Vector;
import org.cove.flade.util.Line;
var p1:Vector = 5;
var p2:Vector = 40;
var x:Number = 10;
var y:Number = 40;
var MyLine:org.cove.flade.util.Line = new
org.cove.flade.util.Line(p1:Vector, p2:Vector);
var MyVector:org.cove.flade.util.Line = new
org.cove.flade.util.Vector(x:Number, y:Number);
and the error that I get is:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 9: ')'
or ',' expected
var MyLine:org.cove.flade.util.Line = new
org.cove.flade.util.Line(p1:Vector, p2:Vector);
Total ActionScript Errors: 1 Reported Errors: 1
What am I missing here? And am I going about this the right
way? Thanks for any help in advance.Hi Marco,
I guess I need to install XML functions in my DB. Do you think anything else might be the problem?
Here is the table description:
SQL> describe resultstable;
Name Null? Type
TAXON NUMBER(38)
GENOMEID VARCHAR2(30)
REFSEQNA VARCHAR2(40)
CONTIGNAME VARCHAR2(40)
LOCATIONID CHAR(3)
SEQUENCEVERSIONID NUMBER(38)
EXTFEATUREID VARCHAR2(11)
GENEID NUMBER(38)
LEFTEND FLOAT(126)
RIGHTEND FLOAT(126)
STRAND VARCHAR2(30) -
Error trying to use load-externs in a module project
Hi:
I am trying to implement modules in my application. I have
read the documentation and learned that if i want to reduce the
size of my modules i have to use the link-report and load-externs
compiler options (the first in the main project and the second in
the modules)
This is the line that i use in the "Additional compiler
arguments" section of the the main project:
-locale en_US -use-network=true -optimize=true
-link-report=C:\report.xml
The file is created in the specified location but......
when i try to use report.xml in the load-externs argument of
the module project i get the next error:
"could not open 'C:\report.xml' while processing
configuration variable 'load-externs'
The line tha i use is this:
-locale en_US -use-network=true -optimize=true
-load-externs=C:\report.xml
I am using Flex Builder 2.01
I'll appreciate your help
Thanks
GBYHi
This answer is 3 1/2 years too late, but someone else might find it helpful.
Saw your question and was looking for the same answer. Eventually translated this spanish site to english.
Solution: you need to copy the linkReport.xml to the root folder of your module project i.e. the same directory as
your [ModuleName].mxml file.
Good luck
Brian
Maybe you are looking for
-
Firefox 4 will not open thunderbird for mailto and Send links
I am using Windows 7 business. Since update FF4 will not open Thunderbird when a mailto link or send link is clicked. My system has Thunderbird selected as the default mail client and these links work in other browsers. Following some online help sug
-
Interactive Images - Way to Block Full-Screen?
The way I see it, Interactive Images are useful because they dont' require a large area of the screen to zoom in and see crisp graphics and descriptions. So when I set my images up, set the views for the "embedded sized" viewer, it all works great. B
-
Pie Chart Label - APEX 4.X
i have made a flash Pie chart and i am trying to make some labeling changes. currently this is my SQL for my chart: select 'javascript:alert("#VALUE# hours was worked on Project Number #LABEL#");' link, PROJ_NUM label, SUM(TIME_WORKED) value1 from "P
-
ERROR: Basis Start Release not known in putGenSubstNamePuttb()
Solman 3.2 to 4.0 upgrade. Getting this error immediately after starting Upgrade with SAPup. Prepare finished successfully however! Using latest version of SAPup together with the Upgrade "Fixes'. NOTE: I am only using Basis SP11 since SP12 was not a
-
Motion 5 clicking sound with audio
Anyone else notice that Motion 5 creates a clicking sound with your audio if you raise the volume, yet isn't redlining in the meter? That's what's happening to me. I have an AIF voiceover and I raised the volume by 3 and even though the audio meter i