Method addLayout not found in class ...cp.request.ConcurrentRequest
I am trying to send concurrent request (XML publisher report) through OAF controller.
But I get next error when compile it:
Error(46,20): method addLayout(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) not found in class oracle.apps.fnd.cp.request.ConcurrentRequest
Below the sample of code.
Please, help me to find a root of cause
package xxcust.oracle.apps.ap.oie.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.jdbc.OracleCallableStatement;
import java.util.Vector;
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransaction;
public class xxMyPrintCO extends OAControllerImpl
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OADBTransaction tx = am.getOADBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);
int xxRequestId = 0;
// concarent parameters
String xxp_type = null;
String applnName = "SQLAP";
String cpName = "XXKVP_KO1";
String LayName = "XXKVP_KO1";
String cpDesc = null;
try
cr.addLayout("PER",LayName,"ru","RU","PDF");
catch(Exception e)
{throw new OAException("addLayout -" + e.getMessage(), (byte)0);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
}
it was a bug described in doc [ID 1360914.1]
JBO-29000 java.lang.NoSuchMethodError When Calling oracle.apps.fnd.cp.request.ConcurrentRequest.addLayout [ID 1360914.1]
Similar Messages
-
Method init not found in class oracle.apps.fnd.cp.request.C
Hi all,
I am reffering to Oracle Application Framework Developers Guide Release
11.5.10 RUP3 December 2, 2005
As given in the document (page 275) Concurrent Processing: Request Submission
and Monitoring ,I want the Concurrent Processing Request Submission and Monitoring user interfaces available on my OA Framework-based pages.
I have followed the steps given in the OADevGuide but when the custom CO
is compiled it gives following error.
method <init> not found in class oracle.apps.fnd.cp.request.ConcurrentRequest.
The import statement in our code is as followed
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.cp.request.RequestSubmissionException;
wheather I have to open a SR on metalink asking for an updated file ConcurrentRequest.class ?
Thanks in advance,
Anant.Hi All,
Thanks Prabhat for that update.
Thanks tapashray cause u r update on thread Apply not being caught in debugger helped me a lot.
Right now I am facing a different problem.
On click of submit button The page gets called but it gives error as
oracle.apps.fnd.framework.OAException: Could not load application module 'oracle.apps.fnd.cp.srs.server.RequestAM'.
In myprojects folder under oracle dir at reqd path I have this AM .
Whether I need to add the bc4j pkg "oracle.apps.fnd.cp.srs.server.RequestAM" in my project . I dont think so as I am not extending any class/VO or doing any substitution.
my code is as followed
public void processFormData(OAPageContext pageContext, OAWebBean webBean)
System.out.println("Inside ProcessFormData");
if (pageContext.getParameter("Submit")!= null )
System.out.println("Inside Submit ");
try
// get the JDBC connection
OAApplicationModule am = pageContext.getApplicationModule(webBean);
//Connection conn = (Connection)am.getOADBTransaction();
OADBTransaction conn = am.getOADBTransaction();
System.out.println("OADBTransaction conn "+conn);
ConcurrentRequest cr = new ConcurrentRequest(conn.getJdbcConnection());
System.out.println(" ConcurrentRequest cr "+cr);
cr.setDeferred();
// call submit request
Vector param = new Vector();
String selectedValue = pageContext.getParameter("reportList");
System.out.println("selectedValue -> "+selectedValue);
param.add(selectedValue);
System.out.println("before cr.submitRequest ");
int reqId = cr.submitRequest("SQLGL", "RGFSGXML", "Run FSG and XML Publisher",null, false, param);
// int reqId = cr.submitRequest("SYSADMIN", "FNDSCURS", "User Responsibility Report",null, false, param);
System.out.println("After cr.submitRequest reqId "+reqId);
conn.commit();
System.out.println("After commit");
// redirect page to Request Scheduling page
HashMap parameters = new HashMap();
String url = "OA.jsp";
parameters.put("akRegionApplicationId", "0");
parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
String id = "" + reqId + "";
parameters.put("requestMode", "DEFERRED");
parameters.put("requestId", id);
System.out.println("before page forward ");
pageContext.setForwardURL("BSE_CONC_REQUEST"
,OAWebBeanConstants.KEEP_MENU_CONTEXT
,null
,parameters
,true
,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
,OAWebBeanConstants.IGNORE_MESSAGES);
catch(RequestSubmissionException reportError)
System.out.println("RequestSubmissionException raised "+reportError.getStackTrace());
catch(SetDeferredException deferred)
System.out.println("SetDeferredException raised "+deferred.getStackTrace());
super.processFormData(pageContext,webBean);
Hope I have given all the details.
Regards,
Anant.
Message was edited by: Removed the error stack so that thread details remain on the same page
Anant -
UI Error 'Method clone not found in class java.lang.Class'
When attempting to view an application window in the User Interface error I receive the error 'Method clone not found in class java.lang.Class'. The window will run correctly when I execute the application and other objects on the window are displayed correctly in the UI editor.
Within the window class I have used the following line of code to clone a reference list of values that is loaded just once when the application starts up: -
dsDefaultComboBoxModel priorityComboBoxModel = (dsDefaultComboBoxModel) dsReferenceLuLists.priorityComboBoxModel.clone();
And then this line of code to create a combo box: -
dsGuiComboBoxRefelu priorityComboBox = new dsGuiComboBoxRefelu(priorityComboBoxModel,ReportWindowSql.priorityCodeBuffer);
And then later on the combo box is displayed.
detailsArea.add(priorityComboBox, new XYConstraints(250,10,dsGlobalVariables.gvFieldWidthLarge,-1));
'dsDefaultComboBoxModel' is defined as follows: -
public class dsDefaultComboBoxModel extends DefaultComboBoxModel implements Cloneable
public dsDefaultComboBoxModel()
public Object clone()
try
return super.clone();
catch ( CloneNotSupportedException e )
// Shouldn't happen.
throw new InternalError( e.toString() );
This error occurs using the latest v903, but was also present in previous versions of JDeveloper.
At the moment this means that I did to execute the window in order to see all of the GUI elements that are displayed. As on option I could use something other than the clone method, but it seems to be such a nice way of copying the static reference lists.
Thanks for any help.Hi Darren,
My guess is that since DefaultComboBoxModel doesn't implement Cloneable, you can't call super.clone(). Does your code compile?
Later.
Dennis -
Methods not found in class ! HELP !
Dear java People,
I am trying to draw, move, and erase balls in a ArrayList. I get an error message that says:
"BallDemo.java": Error #: 300 : method draw() not found in class java.lang.Object at line 126,
"BallDemo.java": Error #: 300 : method move() not found in class java.lang.Object at line 132
"BallDemo.java": Error #: 300 : method erase() not found in class java.lang.Object at line 138
below are the lines causing the errors and the method with the problem code
Thank you in advance
Stan
public void bounce()
int ground = 400; // position of the ground line
int numberOfBalls = 0;
myCanvas.setVisible(true);
ArrayList balls = new ArrayList();
// draw the ground
myCanvas.drawLine(50, ground, 550, ground);
//ex 5.50 (a)
System.out.println("Type in the number of balls you would like to see bouncing and hit enter");
numberOfBalls = input.readInt();
//(b)
for(int i = 0; i < numberOfBalls; i++)
//(c) (d)
Random rg = new Random(255);
BouncingBall newBall = new BouncingBall(i + 15, 0, 16, new Color(rg.nextInt(255),rg.nextInt(255),rg.nextInt(255)), ground, myCanvas);
//add the ball to the ArrayList object
balls.add(newBall);
for(int i = 0; i < numberOfBalls; i++)
balls.get(i).draw();
// make them bounce
boolean finished = false;
while(!finished) {
myCanvas.wait(50); // small delay
balls.get(i).move();
// stop once ball has travelled a certain distance on x axis
// if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550)
finished = true;
balls.get(i).erase();
}balls.get(i).draw();
balls.get(i).move();
balls.get(i).erase();I actually caught this error myself !
I must be improving !
Cheers
Stan -
Hi , when i try to run my program, i keep getting the error msg:
Error(23,19): method getName(java.lang.String) not found in class javax.swing.JTextField
I have checked the java API and it inherits from the awt.Component class and should be accessible via the jtextfield.
I have tried the following:
trying to initailise the JTextField at the start.
Using getName works if i use it within the loop after setting the name.
Does anybody know what i am doing wrong please?
public class clsMember extends JPanel implements ActionListener {
private JButton jbtnLog;
private String surname;
private JTextField txtItem;
public clsMember() {
super(new SpringLayout());
makeInterface();
surname = txtItem.getName("Surname").toString();
private void makeInterface() {
//code omitted
for (int i = 0; i < numpairs; i++) {
JLabel l = new JLabel(strLabels, JLabel.LEADING);
this.add(l);
//if the array item is salutation create a combobox
if (strLabels[i] == "Salutation") {
jcomSalutation = new JComboBox(strSalutation);
jcomSalutation.setSelectedIndex(0);
this.add(jcomSalutation);
} else {
txtItem = new JTextField(10);
l.setLabelFor(txtItem);
txtItem.setName(strLabels[i].replaceAll(" ", "")); //this is where the label is set and if i do a system.out it shows fine. getName works here too.
this.add(txtItem);
//code omittedIf i have a loop that creates the jtextfields such as
txtItem = new JTextField(10);
l.setLabelFor(txtItem);
txtItem.setName(strLabels.replaceAll(" ", ""));
this.add(txtItem);How is it then possible to assign to a string the value of a *specific jtextfield*. Lets say that one of these JTextfields has the name surname.
How is it possible for me to writeString surname = surnamejtextfield.getText(); -
I am having trouble with my GUI class not recognizing methods from a STACK class from the same package. Here's the skinny:
I have a GUI class named WordGUI.
I hava a STACK class named WordStack.
within WordGUI I instantiate an instance of a WordStack and call it myStack. Example below:
WordStack myStack = new WordStack();
When I call WordStack methods from WordGUI I get the error message even though display is a method from WordStack:
"WordGUI.java": Error #: 300 : method display(java.awt.Graphics, int) not found in class assign4.WordStack at line 34, column 13
Complete code for both classes is below:
WordGUI class:
package assign4;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class WordGUI extends Applet implements ActionListener{
WordStack myStack = new WordStack();
private Button testButton;
private TextField wordField;
public void init(){
//add(myStack);
wordField = new TextField(20);
add(wordField);
wordField.addActionListener(this);
testButton = new Button("Test for palindromes");
add(testButton);
testButton.addActionListener(this);
}//init()
public void paint (Graphics g){
g.drawString("Enter a word in the textField above and click", 25, 100);
g.drawString("the button to check if the word is a palindrome", 25, 115);
myStack.display(g, 150);
}//paint()
public void actionPerformed(ActionEvent event){
if(event.getSource() == testButton){
String userInput = wordField.getText();
myStack.evaluate(userInput);
repaint();
}//actionPerformed()
}//class WordGUI
WordStack class:
package assign4;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class WordStack implements Cloneable{
private char[] data;
private int manyItems;
public WordStack(){
final int initialCapacity = 20;
manyItems = 0;
data = new char[initialCapacity];
}//generic constructor
public WordStack(int initialCapacity){
if(initialCapacity < 0){
throw new IllegalArgumentException
("initialCapacity too small: " + initialCapacity);
manyItems = 0;
data = new char[initialCapacity];
}//constructor
public int getCapacity(){
return data.length;
}//getCapacity()
public boolean isEmpty(){
return (manyItems == 0);
}//isEmpty()
public char pop(){
if(manyItems == 0){
//throw new EmptyStackException();
return data[--manyItems];
}//pop()
public void push(char item){
if(manyItems == data.length){
ensureCapacity(manyItems * 2 + 1);
data[manyItems] = item;
manyItems++;
}//push()
public void ensureCapacity(int minimumCapacity){
char biggerArray[];
if(data.length < minimumCapacity){
biggerArray = new char[minimumCapacity];
System.arraycopy(data, 0, biggerArray, 0, manyItems);
data = biggerArray;
}//ensureCapacity()
public String evaluate(String userInput){
char charToProcess;
for(int charNum = 0; charNum < userInput.length(); charNum++){
push(userInput.charAt(charNum));
}//evaluate()
public void display(Graphics g, int yLoc){
for(int i = 0; i < data.length; i++){
g.drawString("" + data, 25, yLoc);
yLoc += 15;
}//display()
}//class WordStack
Any help would be appreciated greatly. Thank youyou need to make your graphics call against the GUI object
-
Method not found in class errors when compiling project
Hi,
I am getting the following errors when compiling my project:
Error(3,8): ReqLinesNotificationsVORowImpl not found
Error(25,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(31,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(37,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(43,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(49,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(55,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(61,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(67,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(67,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(79,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(85,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(91,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(97,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(103,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(109,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(115,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(121,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(127,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(133,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(139,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(145,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(151,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(157,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(163,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(169,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(175,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(181,23): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(187,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Date) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(193,23): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(199,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Date) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImplError(205,23): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
I have ReqLinesNotificationsVORowImpl and ReqLinesNotificationsVOImpl files in myprojects directory. Can anyone help please?
ThanksHi,
From the error it seems that the code is refering ReqLinesNotificationsVOExRowImpl file.
Please make sure that its class file is present in myclasses folder.
Since u have mentioned that ReqLinesNotificationsVORowImpl is already placed in myclasses folder. Hope this should resolve your issue.
Regards,
Raj Papdeja -
"method not found in class " error message !
Dear People,
I have an error message that says:
"Clerk.java": Error #: 300 : method doTransaction(stan_ch15p622.Transaction) not found in class stan_ch15p622.Bank at line 36, column 12
below is the Clerk class of the program.
doTransaction() is defined below the constructor and is called at the
bottom of the class.
Thank you in advance
Stan
package stan_From_Ivor_Horton_ch15p622;
public class Clerk implements Runnable
private Bank theBank; // the employer. who the clerk works for
private Transaction inTray; //holds a transaction
public Clerk(Bank theBank)
this.theBank = theBank;
inTray = null; // no transaction initially
//receive a transaction
public void doTransaction(Transaction transaction)
inTray = transaction;
//The working clerk...
public void run()
while(true) // no transaction waiting ?
while(inTray == null)
try
Thread.sleep(150); // then take a break
catch(InterruptedException e)
System.out.println(e);
theBank.doTransaction(inTray);
inTray = null;
//you can check whether a clerk is busy by calling the isBusy() member
// it returns true if the transaction is strill in progress
public boolean isBusy()
return inTray != null;
}Dear Hambone3,
Due to your help I was able to correct my error. I mispelled the
method in the Bank class. I wrote "toTransaction" instead of
"doTransaction".I have alwyas had a hard time interrpreting the
error messages literally because many times I don't see the
connection between the message and the error. Cold water over
the brain is sometimes what I need.
God bless you.
Stan -
I have uploaded my Application which was running fine in other IDE to jdev 10.1.3, when i compile the follwing error error in jsp page.
Error(400,8): method include(java.lang.String, boolean) not found in class javax.servlet.jsp.PageContext
My jsp code where error is shown is
<jsp:include page="querySections/generation.jsp" flush="true">
<jsp:param name="TSN" value="<%=strParamValue[1]%>"/>
<jsp:param name="SectionID" value="<%=String.valueOf(lngSectionID)%>"/>
</jsp:include>
pl help me in solving this its urgent...
Thanks & Regards
LakshmiHi,
code snippet looks okay and is identical with what JDeveloper generates.
Frank -
Method ServletConfig() not found!!
Hello,
i got this error when i used the below code. it said the mtheod ServletConfig() not found in class. however, i have download the lastest version of servlet2.1 from sun and i have import to the project. like the following:
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.GenericServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestWrapper;
but it still doesn't work. Does anyone know what i miss here? here is the code
v.processHttpRequest(request, response, ServletConfig().getServletContext;
Thanks a lot
EvaServletConfig is no method, it's a class.
As said, use getServletConfig() instead. -
The getBuiltInScopes method was not found
I have an application that has worked for quite a while. I have made no changes to the code since the last time I used it. Basically, the code creates a zip file with input for an involved report. I used it in March of this year it worked fine. I've been assured by the gov't sysadmins and DBAs that nothing has changed, but I still get the attached error. Any ideas? I have just heard from a friend who knows CF, that it could be a version issue. I am currently running 8 and I believe he is running 10. If this is an issue, is the solution somewhere on this site? I do minimal CF and am at a loss. The function that is throwing the error is when a button is clicked, a javascript routine is run which combines all the files requred for the zip file. Yesterday, another application started throwing the error. I haven't been through the code yet, but it is another button being clicked, and I'm sure, another javascript error.
The SysAdmin sent me the application log: Since it is a government site, I changed identifying things to XXXX or xxxx.
"Error","ajp-bio-8012-exec-2091","09/26/14","11:43:33","XXXXransfer3","The getBuiltInScopes method was not found.Either there are no methods with the specified method name and argument types or the getBuiltInScopes method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity. The specific sequence of files included or processed is: \\haffs002\ProdData\Sites\xxx\IE\XXXX\secure\Authorization\FundingRequestForm_Action.cfm, line: 113 "
Line 113 is: document.form1.actiontaken.value = "approve"
The user clicks on a button to Approve or Disapprove a request. This causes another screen to be displayed. The error is happening before the 2nd screen is displayed. -
Restlet Error "The server has not found anything matching the request URI"
I want to serve some static html pages along with my restlet services from the same app ( running in Tomcat )
Here is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
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/web-app_2_4.xsd">
<display-name>first steps servlet</display-name>
<!-- Application class name -->
<context-param>
<param-name>org.restlet.application</param-name>
<param-value>
firstSteps.FirstStepsApplication
</param-value>
</context-param>
<!-- Restlet adapter -->
<servlet>
<servlet-name>RestletServlet</servlet-name>
<servlet-class>
org.restlet.ext.servlet.ServerServlet
</servlet-class>
</servlet>
<!-- Catch all requests -->
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Here is my Application router class
public class FirstStepsApplication extends Application
@Override
public synchronized Restlet createInboundRoot()
Router router = new Router(getContext());
// Defines only one route
router.attach("/hello", HelloWorldResource.class);
router.attach("/login", LoginResource.class);
router.attach("/", BasicResource.class);
return router;
}I've gone back to the basic first steps example.
It works fine if the url pattern is <url-pattern>/*</url-pattern>
localhost/rest/login returns a string from my LoginResource, same too for /hello
However a static html page I have /Mypage.html does not get returned when I enter the URL /MyPage.html
However, if I then modify the url pattern to be
<url-pattern>/login</url-pattern>
and then enter the url /MyPage.html I will get the html page.
But ...... I get the error "The server has not found anything matching the request URI" when I enter the url /login which worked ok the first case.
What must I do in order for both Restlet & Static HTML resources to work together?
Thanks ... Jyes, basicResource is my own class. It's a catch all for restlet requests that don't match any of the other ones. It just returns String = "My catch all resource"
Because you highlighted it I decided to try and remove it from my Restlet Router. Presto, it now works, the login & hello requests are serviced by my Restlet resources and the MyPage.html requests are served the mypage.html file. This now brings another question. If from my servlet mapping in web.xml all urls are to be handled by restlet "/*", how then does a mypage.html request not get serviced by my restlet? Seems to be just passed through the restlet framework when there is no router to match it? what do you think? -
Variable textArea not found in class javax.swing.JFrame...
Making progress on this issue -- but still stuck. Again trying to get the text from a JTextArea on exit:
frame.addWindowListener
(new WindowAdapter() {
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + frame.textArea.getText());
});User MARSIAN helped me understand the scope fo the variables and now that has been fixed. Unfortunately I cannot access my variable textArea in the above code. If get this error:
Error: variable textArea not found in class javax.swing.JFrame
What am I doing wrong?
import java.net.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import FragImpl.*;
public class Framework extends WindowAdapter {
public int numWindows = 0;
private Point lastLocation = null;
private int maxX = 500;
private int maxY = 500;
JFrame frame;
public Framework() {
newFrag();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
maxX = screenSize.width - 50;
maxY = screenSize.height - 50;
makeNewWindow();
public void makeNewWindow() {
frame = new MyFrame(this); //*
numWindows++;
System.out.println("Number of windows: " + numWindows);
if (lastLocation != null) {
//Move the window over and down 40 pixels.
lastLocation.translate(40, 40);
if ((lastLocation.x > maxX) || (lastLocation.y > maxY)) {
lastLocation.setLocation(0, 0);
frame.setLocation(lastLocation);
} else {
lastLocation = frame.getLocation();
System.out.println("Frame location: " + lastLocation);
frame.setVisible(true);
frame.addWindowListener
(new WindowAdapter() {
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + frame.textArea.getText());
//This method must be evoked from the event-dispatching thread.
public void quit(JFrame frame) {
if (quitConfirmed(frame)) {
System.exit(0);
System.out.println("Quit operation not confirmed; staying alive.");
private boolean quitConfirmed(JFrame frame) {
String s1 = "Quit";
String s2 = "Cancel";
Object[] options = {s1, s2};
int n = JOptionPane.showOptionDialog(frame,
"Windows are still open.\nDo you really want to quit?",
"Quit Confirmation",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
s1);
if (n == JOptionPane.YES_OPTION) {
return true;
} else {
return false;
private void newFrag()
Frag frag = new FragImpl();
public static void main(String[] args) {
Framework framework = new Framework();
class MyFrame extends JFrame {
protected Dimension defaultSize = new Dimension(200, 200);
protected Framework framework = null;
private Color color = Color.yellow;
private Container c;
JTextArea textArea;
public MyFrame(Framework controller) {
super("New Frame");
framework = controller;
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setSize(defaultSize);
//Create a text area.
textArea = new JTextArea(
"This is an editable JTextArea " +
"that has been initialized with the setText method. " +
"A text area is a \"plain\" text component, " +
"which means that although it can display text " +
"in any font, all of the text is in the same font."
textArea.setFont(new Font("Serif", Font.ITALIC, 16));
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
textArea.setBackground ( Color.yellow );
JScrollPane areaScrollPane = new JScrollPane(textArea);
//Create the status area.
JPanel statusPane = new JPanel(new GridLayout(1, 1));
ImageIcon icoOpen = null;
URL url = null;
try
icoOpen = new ImageIcon("post_it0a.gif"); //("doc04d.gif");
catch(Exception ex)
ex.printStackTrace();
System.exit(1);
setIconImage(icoOpen.getImage());
c = getContentPane();
c.setBackground ( Color.yellow );
c.add ( areaScrollPane, BorderLayout.CENTER ) ;
c.add ( statusPane, BorderLayout.SOUTH );
c.repaint ();
}Yeah!!! It works. Turned out to be a combination of DrKlap's and Martisan's suggestions -- had to change var frame's declaration from JFrame to MyFrame:
MyFrame frame;Next, created the external class -- but again changed JFrame references to MyFrame:
public class ShowOnExit extends WindowAdapter {
// JFrame aFrame;
MyFrame aFrame;
public ShowOnExit(MyFrame f) {
aFrame = f;
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + aFrame.textArea.getText()); // aFrame here not frame !!!
}This worked. So looks like even though the original code added a WindowListener to 'frame', the listener didn't couldn't access frame's methods unless it was explicitly passed in as a parameter. Let me know if that's wrong.
Thanks again, all. -
GetAudioClip() not found in class . Help !
Dear People,
I have one error message "getAudioClip() not found in class.
I investigated in the AppletContext interface for the signature of the
method. It says that the signature of the "getAudioClip()" method has
one parameter. That parameter is the url which has the audio clip.
I did include the address to the audio clip presently on my hard drive
c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk
below is the program
Thank you for your advice
Norman
import java.util.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.applet.*;
import java.awt.event.*;
public abstract class MyMusicApplet_1 extends JApplet implements ActionListener, AppletContext
//AppletContext myAppletContext = new AppletContext();
//Iterator i = myAppletContext.getStreamKeys();
JButton myJButton;
AudioClip acSound_1 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk");
AudioClip acSound_2 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_3 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_4 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_5 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_6 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_7 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_8 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_9 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
JButton myJButtonSound1;
JButton myJButtonSound2;
JButton myJButtonSound3;
JButton myJButtonSound4;
JButton myJButtonSound5;
JButton myJButtonSound6;
JButton myJButtonSound7;
JButton myJButtonSound8;
JButton myJButtonSound9;
public void init()
Container myContentPane = getContentPane();
myContentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
Dimension buttonSize = new Dimension(190,100);
Font myFont = new Font("Arial", Font.BOLD,14);
Border myEdge = BorderFactory.createRaisedBevelBorder();
//create 1st button's object
myJButtonSound1 = new JButton("sound #1");
myJButtonSound1.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound1.setBorder(myEdge);
myJButtonSound1.setPreferredSize(buttonSize);
myJButtonSound1.setFont(myFont);
myJButtonSound1.setBackground(Color.orange);
myJButtonSound1.setForeground(Color.black);
//create 2nd button's object
myJButtonSound2 = new JButton("sound #2");
myJButtonSound2.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound2.setBorder(myEdge);
myJButtonSound2.setPreferredSize(buttonSize);
myJButtonSound2.setFont(myFont);
myJButtonSound2.setBackground(Color.blue);
myJButtonSound2.setForeground(Color.black);
//create 3rd button's object
myJButtonSound3 = new JButton("sound #3");
myJButtonSound1.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound3.setBorder(myEdge);
myJButtonSound3.setPreferredSize(buttonSize);
myJButtonSound3.setFont(myFont);
myJButtonSound3.setBackground(Color.cyan);
myJButtonSound3.setForeground(Color.black);
//create 4th button's object
myJButtonSound4 = new JButton("sound #4");
myJButtonSound4.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound4.setBorder(myEdge);
myJButtonSound4.setPreferredSize(buttonSize);
myJButtonSound4.setFont(myFont);
myJButtonSound4.setBackground(Color.pink);
myJButtonSound4.setForeground(Color.black);
//create 5th button's object
myJButtonSound5 = new JButton("sound #5");
myJButtonSound5.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound5.setBorder(myEdge);
myJButtonSound5.setPreferredSize(buttonSize);
myJButtonSound5.setFont(myFont);
myJButtonSound5.setBackground(Color.red);
myJButtonSound5.setForeground(Color.black);
//create 6th button's object
myJButtonSound6 = new JButton("sound #6");
myJButtonSound6.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound6.setBorder(myEdge);
myJButtonSound6.setPreferredSize(buttonSize);
myJButtonSound6.setFont(myFont);
myJButtonSound6.setBackground(Color.pink);
myJButtonSound6.setForeground(Color.black);
//create 7th button's object
myJButtonSound7 = new JButton("Choice #7");
myJButtonSound7.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound7.setBorder(myEdge);
myJButtonSound7.setPreferredSize(buttonSize);
myJButtonSound7.setFont(myFont);
myJButtonSound7.setBackground(Color.cyan);
myJButtonSound7.setForeground(Color.black);
//create 8th button's object
myJButtonSound8 = new JButton("Choice #8");
myJButtonSound8.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound8.setBorder(myEdge);
myJButtonSound8.setPreferredSize(buttonSize);
myJButtonSound8.setFont(myFont);
myJButtonSound8.setBackground(Color.yellow);
myJButtonSound8.setForeground(Color.black);
//create 9th button's object
myJButtonSound9 = new JButton("Choice #9");
myJButtonSound9.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound9.setBorder(myEdge);
myJButtonSound9.setPreferredSize(buttonSize);
myJButtonSound9.setFont(myFont);
myJButtonSound9.setBackground(Color.blue);
myJButtonSound9.setForeground(Color.black);
//add the buttons to the content pane
myContentPane.add(myJButtonSound1);
myContentPane.add(myJButtonSound2);
myContentPane.add(myJButtonSound3);
myContentPane.add(myJButtonSound4);
myContentPane.add(myJButtonSound5);
myContentPane.add(myJButtonSound6);
myContentPane.add(myJButtonSound7);
myContentPane.add(myJButtonSound8);
myContentPane.add(myJButtonSound9);
public void actionPerformed(ActionEvent e)
myJButton = (JButton)e.getSource();
if(myJButton == myJButtonSound1)
acSound_1.play();
if(myJButton == myJButtonSound2)
acSound_2.play();
if(myJButton == myJButtonSound3)
acSound_3.play();
if(myJButton == myJButtonSound4)
acSound_4.play();
if(myJButton == myJButtonSound5)
acSound_5.play();
if(myJButton == myJButtonSound6)
acSound_6.play();
if(myJButton == myJButtonSound7)
acSound_7.play();
if(myJButton == myJButtonSound8)
acSound_8.play();
if(myJButton == myJButtonSound9)
acSound_9.play();You are passing a String. A String is not an instanceof the URL class. Look at the java.net.URL class. Dear BBrita,
I looked at the URL class in the Java API and did not find anything that told me how to pass the URL
"c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"
which is stored on my hard drive.
Thank you in advance
Norman -
Junit AssertionFailedError - method 'null' not found
After running the TestSuite, everytime I click on "null" in Eclipse under Failures, I get "method 'null' not found".
The Failure Trace says "junit.framework.AssertionFailedError".
just running one class through the TestSuite and have commented all my assertion statements but still get this error. Any pointers ?
Thanking youI once encountered this issue. The cause was I put some code in the class (which inherits from TestCase) constructor.
After I remove the constructor, everything went OK. Hope this help.
Maybe you are looking for
-
Display emails by date received
until today my emails were displayed by date received with most current ones at the bottom of the list. This has changed to display in alphabetical order according to the sender. Why????? I need it to change back to the original.
-
Is there any possiblity to write and execute code before nodes get created in the content?
Hi, I have created a dialog and after clicking OK the data is stored in the content. But I've the following requirement: "After clicking OK button on the dialog and before the data stored into the content, I've to do some action(I want to write
-
Mail won't open in Snow Leopard
Ever since i installed the snow leopard upgrade i can't open apple Mail. When I try to open the application it comes up with a message: "You can't use this version of the application Mail with this version of Mac OS X. You have Mail 3.6." I tried loo
-
Time Capsule fail to connect in Finder
Upon system bootup - I can see the Time Capsule drive as a "shared" drive in the Finder application. However, it doesn't automatically connect. The status reads "Connection Failed". The then have to press connect - a page loads that asks for a passwo
-
When I open a template from one of "My Templates" (to prepare a new edition of a newsletter), how do I save it under a new title to the desktop? The options 'Save a version', Duplicate or 'Export' do not give me the opportunity to write a new title