Passing methods to methods?
I use to program in C++ once upon a time, and one of my favorite tricks was storing procedures in pointers so I could call procedures in parent classes from a sub class.
Parent (say a scroll bar)
updatePosition(int)
child (one of the buttons)
The child could call the updatePosition() procedure because I would pass it into the child class when I made it. It allowed me to make a button that could activate anything in my code, which was useful.
Now I'm using Java and I wanted to do something similiar. I'm trying to make a graphical scroll bar (I plan on it's dimensions to change while it's in use, so it can't be an AWT or Swing scrollbar), and I've got some buttons made. I want to do this:
MyScrollBar {
int position = 0;
void updatePosition(int amount) {
position += amount;
MyButton upbtn = new MyButton(updatePosition);
MyButton downbtn = new MyButton(updatePosition);
Just assume MyButton will respond to mouse clicks (it's workings doesn't matter really). When upbtn is clicked, I want it to be able to call the method in MyScrollBar that I passed into it when it was made. Short of making a MyButton that accepts a MyScrollBar passed to it, is there a way to call the procedure in it's parent?
I ran into a similar problem, but I used a little trick. Make another class in that same .java file that your making which holds a static variable, where your main method sets up that JScrollbar, assigns it as a variable in that class, then other parts of your code access that JScrollBar through that class.
class MyScrollBarHolder
public static MyScrollBar msb;
public static void setScrollBar(MyScrollBar msbTemp)
{msb = msbTemp;}
public void updatePosition()
{//your code for handling that
}this just goes at the end of your code. Then when a button wishes to access it, you just call MyScrollBarHolder.updatePosition() or you can get the ScrollBar itself with MyScrollBarHolder.msb
Hope this helps
Cheers
Similar Messages
-
Urgent help req : work item id not getting passed in the method
Hi ,
I have created a subtype zcats of business object CATS and delegated it .
I have created a new method Approve1 ( with attributes SYNCRONUS & DIALOG ) in zcats which is similar in coding to Approve method of CATS ( DIALOG) .
I have include the method Approve1 of business object zcats in a standard task .
The problem is that when the eorkflow gets triggered , the workitem id is not getting passed in the method APProve1 of zcats.
Can someone please help me with this .
Points would surely be awarded .BEGIN_METHOD APPROVE1 CHANGING CONTAINER.
DATA: WORKITEMID_IMP LIKE OBJECT-KEY-ITEMID.
DATA: WI_CHCKWI LIKE SWWWIHEAD-WI_ID.
DATA: WORKITEM TYPE SWC_OBJECT.
<u> WORKITEMID_IMP = OBJECT-KEY-ITEMID</u>.
SWC_GET_ELEMENT CONTAINER '_WORKITEM' WORKITEM.
SWC_GET_PROPERTY WORKITEM 'WorkitemReference' WI_CHCKWI.
IF SY-SUBRC EQ 0 AND NOT WI_CHCKWI IS INITIAL.
WORKITEMID_IMP = WI_CHCKWI.
ENDIF.
CALL FUNCTION 'CATS_WF_APPROVAL'
EXPORTING
WORKITEMID_IMP = WORKITEMID_IMP
TABLES
CONT_IMP = CONTAINER.
END_METHOD.
hi ,
the above is the code in the method .
At the first step of execution underlined above , the work item id is appearing blank .
I think that the value is not passed to the container , but i am not sure og how to pass data to this conatiner -
Passing Parameter between Methods
I have some problems because i don't really know how to pass parameter between methods in a java class.
How can i do that? below is the code that i did.
I want to pass in the parameter from a method called dbTest where this method will run StringTokenizer to capture the input from a text file then it will run storeData method whereby later it will then store into the database.
How can i pass data between this two methods whereby i want to read from text file then take the value to be passed into the database to be stored?
Thanks alot
package com;
import java.io.*;
import java.util.*;
import com.db4o.ObjectContainer;
import com.db4o.Db4o;
import com.db4o.ObjectSet;
class TokenTest {
private final static String filename = "C:\\TokenTest.yap";
public String fname;
public static void main (String[] args) {
new File(filename).delete();
ObjectContainer db=Db4o.openFile(filename);
try {
String fname;
String lname;
String city;
String state;
dbStore();
storeData();
finally {
db.close();
public String dbTest() {
DataInputStream dis = null;
String dbRecord = null;
try {
File f = new File("c:\\abc.txt");
FileReader fis = new FileReader(f);
BufferedReader bis = new BufferedReader(fis);
// read the first record of the database
while ( (dbRecord = bis.readLine()) != null) {
StringTokenizer st = new StringTokenizer(dbRecord, "|");
String fname = st.nextToken();
String lname = st.nextToken();
String city = st.nextToken();
String state = st.nextToken();
System.out.println("First Name: " + fname);
System.out.println("Last Name: " + lname);
System.out.println("City: " + city);
System.out.println("State: " + state + "\n");
} catch (IOException e) {
// catch io errors from FileInputStream or readLine()
System.out.println("Uh oh, got an IOException error: " + e.getMessage());
} finally {
// if the file opened okay, make sure we close it
if (dis != null) {
try {
dis.close();
} catch (IOException ioe) {
System.out.println("IOException error trying to close the file: " +
ioe.getMessage());
} // end if
} // end finally
return fname;
} // end dbTest
public void storeData ()
new File(filename).delete();
ObjectContainer db = Db4o.openFile(filename);
//Add data to the database
TokenTest tk = new TokenTest();
String fNme = tk.dbTest();
db.set(tk);
// try {
//open database file - database represented by ObjectContainer
// File filename = new File("c:\\abc.yap");
// ObjectContainer object = new ObjectContainer();
// while ((dbRecord = bis.readLine() !=null))
// db.set(fname);
// db.set(lname);
// db.set(city);
// db.set(state);
} // end class
Message was edited by:
erickhIn a nutshell, you don't "pass" parameters. You simply call methods with whatever parameters they take. So, methods can call methods, which can call other methods, using the parameters in question. Hope that makes sense.
-
Unable to detect any parameter in html (webresource) when value is passed from onload method of form
I am trying out some stuff. For which I created a simple Entity. In the form of the entity I have added a simple web resource (html). And for the onload of the form I am calling the following function
function HelpDeskActivityOnLoadhandler()
var customParameters = encodeURIComponent("first=First Value&second=Second Value&third=Third Value");
Xrm.Utility.openWebResource("tsi_scriptzz",customParameters);
Here is the code for the tsi_scriptzz.html
<html>
<body>
<script type="text/javascript">
var vals = new Array();
if (location.search != "") {
vals = location.search.substr(1).split("&");
for (var i in vals) {
vals[i] = vals[i].replace(/\+/g, " ").split("=");
</script>
</body>
</html>
MY PROBLEM IS -> location.search is always coming back with empty string. So, it not getting the parametrs I am passing from the load method of the form.
Could someone kindly help me.
Thanks,
HasibHello, I tried it myself. I got a new_test.htm file and a new_test.js file. The loadWebResource function is called on the OnLoad event of an Entity.
function loadWebResource()
var params = encodeURIComponent('param1=value one¶m2=value two¶m3=value three');
Xrm.Utility.openWebResource('new_test.htm', params);
<html>
<head>
<title>Web Resource Parameter Example</title>
<!-- Use ../ClientGlobalContext.js.aspx if your webresource is in a deeper folder on CRM -->
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script type="text/javascript">
document.onreadystatechange = function () {
if (document.readyState == 'complete') {
var params = getParams();
for(var i=0; i<params.length; i++)
log(params[i].name + ' ' + params[i].value);
// this functions puts the params in a 'dictionary format'
// f.e params[0].name = param1 & params[0].value = 'value one'
// You could customize this function or find some on the internet to retrieve a param fe by name...
// This is just an example how to get the name and values
function getParams(){
var params = [];
var querystring = Xrm.Page.context.getQueryStringParameters().Data;
var querystringparts = querystring.split('&');
for(var i=0; i<querystringparts.length;i++)
var split = querystringparts[i].split('=');
params.push({
name: split[0],
value: split[1]
</script>
</head>
<body>
</body>
</html>
Hope it helps now. Kind Regards -
Call Paje jsp passing parameters with method post
How can I call a jsp page with outputlink, passing parameters with method post ?
Ex: I need that the word "?pNumMensagem=#{currentRow["NumMensagem"]}" not was exposed when a call P0077_2.jsp.
<h:outputLink binding="#{P0077.hyperlink1}" id="hyperlink1" target="t1" value = "#{facesContext.externalContext.requestContextPath}/faces/P0077_2.jsp?pNumMensagem=#{currentRow["NumMensagem"]}">
<h:outputText binding="#{P0077.outputText14}" id="outputText14" value="#{currentRow['NumMensagem']}"/>
</h:outputLink>
Thanks.
Heitor.Any body have an idea ?
-
Passing methods as methods arguments
Hi,
how can I pass a method to another method?
I need something like this:
public void methodA() {
System.out.println("Hallo world");
public void methodB( Method method ) {
method();
// or
method.invoke();
and in my app:
methodB( methodA );
...of course the code below didn't work :-D
Thanks.sorry, I didn't understood very well the 'inteface
aproach'. Do you have some example code?If the name of the method to be called truly needs to be dynamic, then this won't work but if you just want different behaviors, then you could do something like this: public interface Doer {
void doIt();
public class Doer1 implements Doer {
void doIt() {
// do some stuff
public class Doer2 implements Doer {
void doIt() {
// do some other stuff
public class DoerDriver {
public static void main(String[] args) {
for (int ix = 0; ix < args.length; ix++) {
try {
Class klass = Class.forName(args[ix]);
Doer doer = (Doer)klass.newInstance();
doStuff(doer);
catch (Exception exc) {
System.out.println("Couldn't do " + args[ix]);
exc.printStackTrace();
* This method only exists to follow your model of passing the "method"--i.e., they dynamic
* bit--to another method. We could just call doer.doIt() right inside the loop in main.
private static void doStuff(Doer doer) {
doer.doIt();
java DoerDriver Doer1 Doer2 Doer2 Doer1
Whether this works for you depends on what you're really trying to do. -
Error passing paremeter in method from the database
hi am having error when testing this method am in jdeveloper Studio 11.1.2.1.0
public void PerformAgrSubmit(String par_id,String dref_id,String tas_id,String agr_id){
ViewObject sub = this.findViewObject("AGR1");
Row row = sub.first();
sub.setNamedWhereClauseParam("tas_id", new Number(10));
sub.setNamedWhereClauseParam("dref_id", new Number(10));
par_id = (String)row.getAttribute("par_id");
agr_id = (String)row.getAttribute("id");
sub.executeQuery();
callPerformSdmsLogon("SMS_FORM_TO_ADf.submit_agr(?)", new Object[] {par_id,dref_id,tas_id,agr_id});
}the error is (oracle.jbo.NoDefException) JBO-25058: Definition tas_id of type Variable is not found in AGR1.
but i do have tas_id in my AGR1 view,it is define as transient its not from database
<ViewAttribute
Name="tas_id"
IsSelected="false"
IsPersistent="false"
PrecisionRule="true"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="VIEW_ATTR"
SQLType="VARCHAR"/>Edited by: Tshifhiwa on 2012/07/03 4:38 PMhi i try this
public void PerformAgrSubmit(String par_id,String dref_id,String tas_id,String agr_id){
ViewObject sub = this.findViewObject("AGR1");
Row row = sub.first();
//sub.setNamedWhereClauseParam("tas_id", new Number(10));
// sub.setWhereClause("tas_id");
sub.setWhereClause("tas_id = :tas_id");
//sub.setNamedWhereClauseParam("dref_id", new Number(10));
sub.defineNamedWhereClauseParam("dref_id", null, null);
par_id = (String)row.getAttribute("ParId");
agr_id = (String)row.getAttribute("id");
sub.executeQuery();
callPerformSdmsLogon("SMS_FORM_TO_ADf.submit_agr(?,?,?,?)", new Object[] {par_id,dref_id,tas_id,agr_id});
}but now am geting this errror java.lang.NullPointerException which is at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239) line 1239 is par_id = (String)row.getAttribute("ParId");
my parid is
<ViewAttribute
Name="ParId"
IsPersistent="false"
IsNotNull="true"
PrecisionRule="true"
Type="java.lang.Integer"
ColumnType="NUMBER"
AliasName="PAR_ID"
Expression="PAR_ID"
SQLType="INTEGER"/>stack trace is
oracle.jbo.jbotester.ErrorHandler$ExceptionWrapper
at oracle.jbo.jbotester.ErrorHandler.displayError(ErrorHandler.java:96)
at oracle.jbo.jbotester.ErrorHandler.displayError(ErrorHandler.java:89)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:336)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:697)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:324)
... 25 more
Caused by: java.lang.NullPointerException
at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
... 31 more
## Detail 0 ##
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:697)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:324)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
... 31 more
## Detail 0 ##
java.lang.NullPointerException
at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:324)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
----- Level 1: Detail 0 -----
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:697)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:324)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
... 31 more
## Detail 0 ##
java.lang.NullPointerException
at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:324)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
----- Level 2: Detail 0 -----
java.lang.NullPointerException
at sms1405.sms1405ModuleImpl.PerformAgrSubmit(sms1405ModuleImpl.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.jbotester.panel.MethodPanel$6.actionPerformed(MethodPanel.java:324)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Edited by: Tshifhiwa on 2012/07/03 5:42 PM
Edited by: Tshifhiwa on 2012/07/03 5:55 PM -
FATAL ERROR in native method: Wrong Method ID
I have a piece of C code from which I am trying to launch a piece of Java, but I am having severe problems just trying to get a simple integer value returned from any Java function. I keep getting the error message "FATAL ERROR in native method: Wrong method ID used to invode a Java method"
My C code looks like :
JNIEnv *env;
long result;
jmethodID mid;
jclass cls;
jobjectArray args;
jstring jstr;
jint res;
jobject myObj;
options[0].optionString = "-Djava.class.path=.";
options[1].optionString = "-Djava.compiler=NONE";
options[2].optionString = "-verbose:jni";
vm_args.version = JNI_VERSION_1_2;
vm_args.options = options;
vm_args.nOptions = 2;
vm_args.ignoreUnrecognized = JNI_FALSE;
// Create the Java VM
result = JNI_CreateJavaVM(&jvm,(void **)&env, &vm_args);
if (result == JNI_ERR )
printf("Can't create Java VM\n");
exit(1);
else
printf("Java VM created successfully\n");
cls = (*env)->FindClass(env, "Example1");
if (cls == 0){
printf("Can't find Class\n");
exit(1);
else
printf("Class Found\n");
mid = (*env)->GetMethodID(env, cls, "GetIntValue", "()I" );
if (mid == 0) {
printf("Can't find function\n");
exit(1);
else
printf("Function Found\n");
res = (*env)->CallIntMethod(env, cls, mid);
if (res != 0)
char pszTempString[256] = {'\0'};
sprintf (pszJavaString, "Returned from Java the value of %d", res);
printf("Returned from Java with ");
printf(pszJavaString);
My GetMethodID call works correctly and I have checked the signature (using javap -s) and that works fine. I've seen many references on these forums about using NewObject prior to calling CallIntMethod, but if I try to use that I then get the error message "FATAL ERROR in native method: a non-constructor passed to NewObject".
Any body got any ideas please.
ThanksWhat I couldn't figure out from your code is where you create the java object that is supposed to return the integer to your C code.
Alternatives:
o This is just code snippets, and you really are creating the object.
o Error - the object should have been created.
o Error - it is a static method, and you should be finding a static method and calling it on a class object.
(Other than that, I didn't see anything obviously wrong. -
ABAP OO: methods as method params, method chains
Hello all,
I am currently developing quite much ABAP OO and wonder if this is possible, because I got compilation errors.
a) Methods as method params w/o temp vars:
I have a method whose parameter shall be the return value (let s say a string) shall be the parameter:
document->set_owner( owner = person->get_name( ) ).
This throws an error and I have to code this instead
data: owner type String.
ownerString = person->get_owner( ).
document->set_owner( owner = ownerString ).
... so I have always a temp variable which is getting MUCH overhead when having such stuff often...
Am I doing wrong or is this impossible in ABAP OO? ...am used to do such things in all other languages I know... mean, that methods can be params of other methods.
b) "chaining of methods"
Is this possible somehow?:
data: tmp type String.
tmp = employee->get_orgUnit( )->get_name( ).
Calling one level (the get_OrgUnit() method) works fine, but an immediate call to the second level ( get_name() method) fails and I have to code this:
data: tmp type String,
orgUnit type ZOrgUnit.
orgUnit = employee->get_orgUnit( ).
tmp = orgUnit->get_name( ).
This also very annoying to have so much temporary help variables on the way.
Is there any help for me?
Thank you for any hints and reagrds,
TimoHi Timo,
as Richard's reply says it's impossible in ABAP-OO. The nature of this language is ABAP not OO
Only helpful for you, could be the returning parameter. It's very useful in conditional expressions like
if m1->a() = '2'.
A preferred parameter to avoid writing parameter names like
m1->b( '2' ).
All other useful stuff of method or parameter chaining, and so on is NOT possible. Sorry. -
Getting problem with DOMImplementation classes method getFeature() method
hi
getting problem with DOMImplementation classes method getFeature() method
Error is cannot find symbol getFeature()
code snippet is like...
private void saveXml(Document document, String path) throws IOException {
DOMImplementation implementation = document.getImplementation();
DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
LSSerializer serializer = implementationLS.createLSSerializer();
LSOutput output = implementationLS.createLSOutput();
FileOutputStream stream = new FileOutputStream(path);
output.setByteStream(stream);
serializer.write(document, output);
stream.close();
problem with getFeature() methodYou are probably using an implementation of DOM which does not implement DOM level-3.
-
FATAL ERROR in native method: Wrong method ID used to invoke a Java method
When calling the same method second time , I get message ::
<FATAL ERROR in native method: Wrong method ID used to invoke a Java method>
void myFunction(int myVal)
JNIEnv *env = NULL;
jclass odbcconnls;
jint res;
printf("\nInitilaizing class ");
res = (jvm)->AttachCurrentThread((void **)&env,NULL);
if (res < 0) {
fprintf(stderr, "Can't get Env \n");
(jvm)->DestroyJavaVM();
return SQL_ERROR;
if(res == JNI_OK)
printf("\nThe env is initialized ");
if(*(&env) == NULL)
printf(" the env is NULL ");
printf("\nenv :::::: %s ", env);
// the jobject (dbc->actualConn) is a global reference
odbcconnls = (env)->GetObjectClass(dbc->actualConn);
if (odbcconnls == NULL) {
goto destroy;
switch(myVal){
case 1:
jmethodID methodId ;
jboolean jbool;
SQLINTEGER Val = (SQLINTEGER )Value;
SQLINTEGER val1 = *Val;
methodId = (env)->GetMethodID( odbcconnls,"myFun1","(Z)V");
if(methodId == NULL){
goto destroy;
if(val1 == SQL_FALSE )
jbool = 0;
else
jbool =1;
env->CallVoidMethod(dbc->actualConn,methodId,jbool);
env->DeleteLocalRef((jobject)res);
env->DeleteLocalRef((jobject)odbcconnls);
env->DeleteLocalRef((jobject)methodId);
jvm->DetachCurrentThread();
return ;
case 2 :
jmethodID methodId1 ;
SQLUINTEGER* Level;
methodId1 = (env)->GetMethodID( odbcconnls,"myFun2","(I)V");
if(methodId1 == NULL){
goto destroy;
Level = (SQLUINTEGER *)Value;
env->CallVoidMethod(dbc->actualConn,methodId1,(int)*Level);
dbc->txn_isolation = (SQLUINTEGER)Value;
env->DeleteLocalRef((jobject)res);
env->DeleteLocalRef((jobject)odbcconnls);
env->DeleteLocalRef((jobject)methodId1);
jvm->DetachCurrentThread();
return ;
case 3 :
SQLCHAR* Cate;
jmethodID methodId2 ;
jstring jStrCat;
methodId2 = (env)->GetMethodID(odbcconnls,"myFun3","(Ljava/lang/String;)V");
if(methodId2 == NULL){
goto destroy;
Cate = new SQLCHAR[20];
strcpy((char *)CCatalog,(char *)Value);
jStrCat = env->NewStringUTF((char *) Cate);
printf("\n got jSTring ");
env->CallVoidMethod(dbc->actualConn,methodId2,jStrCat);
printf("\n after called method ");
int len = strlen((char *)Cate);
dbc->Cate = new SQLCHAR[len+1];
strcpy((char *)dbc->Cate,(char *)Cate);
printf("\n copied result ");
env->DeleteLocalRef((jobject)res);
env->DeleteLocalRef((jobject)odbcconnls);
env->DeleteLocalRef((jobject)methodId2);
jvm->DetachCurrentThread();
return ;
destroy:
if ((env)->ExceptionOccurred()) {
(env)->ExceptionDescribe();
jvm->DetachCurrentThread();
(jvm)->DestroyJavaVM();
return SQL_ERROR;
When case 1 is called second time this error is thrown..
plz help me..
Thanx
MittalSunita.When calling the same method second time , I get
message ::
<FATAL ERROR in native method: Wrong method ID used
d to invoke a Java method>
void myFunction(int myVal)
JNIEnv *env = NULL;
jclass odbcconnls;
jint res;
printf("\nInitilaizing class ");
res = (jvm)->AttachCurrentThread((void **)&env,NULL);
if (res < 0) {
fprintf(stderr, "Can't get Env \n");
(jvm)->DestroyJavaVM();
return SQL_ERROR;
if(res == JNI_OK)
printf("\nThe env is initialized ");
if(*(&env) == NULL)
printf(" the env is NULL ");
printf("\nenv :::::: %s ", env);
// the jobject (dbc->actualConn) is a global
reference
odbcconnls = (env)->GetObjectClass(dbc->actualConn);
if (odbcconnls == NULL) {
goto destroy;
switch(myVal){
case 1:
jmethodID methodId ;
jboolean jbool;
SQLINTEGER Val = (SQLINTEGER )Value;
SQLINTEGER val1 = *Val;
methodId = (env)->GetMethodID(
( odbcconnls,"myFun1","(Z)V");
if(methodId == NULL){
goto destroy;
if(val1 == SQL_FALSE )
jbool = 0;
else
jbool =1;
env->CallVoidMethod(dbc->actualConn,methodId,jbool);
env->DeleteLocalRef((jobject)res);
env->DeleteLocalRef((jobject)odbcconnls);
env->DeleteLocalRef((jobject)methodId);
jvm->DetachCurrentThread();
return ;Why do you delete a local reference???
Did you ever call the get local reference?
case 2 :
jmethodID methodId1 ;
SQLUINTEGER* Level;
methodId1 = (env)->GetMethodID(
( odbcconnls,"myFun2","(I)V");
if(methodId1 == NULL){
goto destroy;
Level = (SQLUINTEGER *)Value;
env->CallVoidMethod(dbc->actualConn,methodId1,(int)*Le
el);
dbc->txn_isolation = (SQLUINTEGER)Value;
env->DeleteLocalRef((jobject)res);
env->DeleteLocalRef((jobject)odbcconnls);
env->DeleteLocalRef((jobject)methodId1);
jvm->DetachCurrentThread();
return ;
case 3 :
SQLCHAR* Cate;
jmethodID methodId2 ;
jstring jStrCat;
methodId2 =
(env)->GetMethodID(odbcconnls,"myFun3","(Ljava/lang/St
ing;)V");
if(methodId2 == NULL){
goto destroy;
Cate = new SQLCHAR[20];
strcpy((char *)CCatalog,(char *)Value);
jStrCat = env->NewStringUTF((char *) Cate);
printf("\n got jSTring ");
env->CallVoidMethod(dbc->actualConn,methodId2,jStrCat)
printf("\n after called method ");
int len = strlen((char *)Cate);
dbc->Cate = new SQLCHAR[len+1];
strcpy((char *)dbc->Cate,(char *)Cate);
printf("\n copied result ");
env->DeleteLocalRef((jobject)res);
env->DeleteLocalRef((jobject)odbcconnls);
env->DeleteLocalRef((jobject)methodId2);
jvm->DetachCurrentThread();
return ;
destroy:
if ((env)->ExceptionOccurred()) {
(env)->ExceptionDescribe();
jvm->DetachCurrentThread();
(jvm)->DestroyJavaVM();
return SQL_ERROR;
When case 1 is called second time this error is
thrown..
plz help me..
Thanx
MittalSunita. -
How to get string which is return from a method and method is called from a filter
Can anyone please guide me how i will get a string on a template, this string value is return by method which is called through 'ValidateStandered' filter.
My problem is when i CheckIn a document, i am implementing some validation of duplicated document and duplicated document is identified by some metadata value.
if metadata value of CheckIn document(current document) is same with existing document then filter will return ddocname and ddoctitle of existing document on a template(user can see the ddocname of existing item).please find error logs also:
intradoc.data.DataException: !csDbCouldNotBind,getValueOfDuplicateDocument
at intradoc.jdbc.JdbcQueryUtils.buildQuery(JdbcQueryUtils.java:107)
at intradoc.jdbc.JdbcWorkspace.buildQuery(JdbcWorkspace.java:736)
at intradoc.jdbc.JdbcWorkspace.createResultSet(JdbcWorkspace.java:639)
at CheckInRestrictionFilter.CheckInRestrictionFilter.getResultSet(CheckInRestrictionFilter.java:108)
at CheckInRestrictionFilter.CheckInRestrictionFilter.doFilter(CheckInRestrictionFilter.java:57)
at intradoc.shared.PluginFilters.filterWithAction(PluginFilters.java:114)
at intradoc.shared.PluginFilters.filter(PluginFilters.java:68)
at intradoc.server.DocServiceHandler.validateStandard(DocServiceHandler.java:1251)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
at intradoc.server.Service.doCodeEx(Service.java:620)
at intradoc.server.Service.doCode(Service.java:592)
at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
at intradoc.server.Service.doAction(Service.java:564)
at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1483)
at intradoc.server.Service.doActions(Service.java:559)
at intradoc.server.ServiceRequestImplementor.executeSubServiceCode(ServiceRequestImplementor.java:1346)
at intradoc.server.Service.executeSubServiceCode(Service.java:4109)
at intradoc.server.ServiceRequestImplementor.executeServiceEx(ServiceRequestImplementor.java:1222)
at intradoc.server.Service.executeServiceEx(Service.java:4104)
at intradoc.server.Service.executeService(Service.java:4088)
at intradoc.server.Service.doSubService(Service.java:3998)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:310)
at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)
at intradoc.server.Service.doCodeEx(Service.java:637)
at intradoc.server.Service.doCode(Service.java:592)
at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
at intradoc.server.Service.doAction(Service.java:564)
at intradoc.server.Service.doScriptableAction(Service.java:4050)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:310)
at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)
at intradoc.server.Service.doCodeEx(Service.java:637)
at intradoc.server.Service.doCode(Service.java:592)
at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
at intradoc.server.Service.doAction(Service.java:564)
at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1483)
at intradoc.server.Service.doActions(Service.java:559)
at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1415)
at intradoc.server.Service.executeActions(Service.java:545)
at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:751)
at intradoc.server.Service.doRequest(Service.java:1974)
at intradoc.server.ServiceManager.processCommand(ServiceManager.java:486)
at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
at intradoc.idcwls.IdcServletRequestUtils.doRequest(IdcServletRequestUtils.java:1355)
at intradoc.idcwls.IdcServletRequestUtils.processFilterEvent(IdcServletRequestUtils.java:1732)
at intradoc.idcwls.IdcIntegrateWrapper.processFilterEvent(IdcIntegrateWrapper.java:223)
at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at idcservlet.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:87)
at idcservlet.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:305)
at idcservlet.common.ClassHelperUtils.executeMethodWithArgs(ClassHelperUtils.java:278)
at idcservlet.ServletUtils.executeContentServerIntegrateMethodOnConfig(ServletUtils.java:1680)
at idcservlet.IdcFilter.doFilter(IdcFilter.java:457)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3739)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3705)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2282)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2181)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1491)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) -
How to construct a standard rowKeyStr based on a value passed to a method ?
Hi to all im on a proyect and i really appreciate some people can help with this
looking ADF joins all use rowKey values and i need to know how to generate a standard rowKeyStr based on a value passed to an event, so it let me access any page on my Jsp ADF application and pass some values to a method and get the rowKeyStr.
i have this method actually getting the current row, how i can generate a standard rowKeyStr value.
public String myrowKeyStr(String id) {
if (id != null) {
PbeVisitasViewImpl vo = (PbeVisitasViewImpl)getPbeVisitasView1();
Key k = new Key(new Object[]{id});
Row[] found = vo.findByKey(k,1);
vo.setCurrentRow(vo.findByKey(k,1)[0]);
return someRowKeyStr;
}once you do the
Key k = new Key ( new Object[] { p1 } );
The rowkeystring comes from:
String strRowKeyStr = k.toStringFormat();
Just type k. and press ctrl-space to see the list of methods. -
Passing values from method array to class array
HELP!! Plz excuse any ignorance. Am a noob and have created an array within my class. I then try to alter those array values from inside one of the classes methods. When I try to access the new values from the class array, they don't exist. I think it's a duration/scope issue and am struggling to get around it. This is the only way I can implement the task required and would appreciate any advice you can thorw. cheers in advance.. =~D
I suspect that you're altering an array passed as a parameter, rather than array that's a field of the instance, but as you didn't post any of your code, that can only be a guess.
-
ABAP OO - Passing Internal Tables from Method to Method
I'm new to writing methods.
I have a need to build an internal table in METHOD1 and pass the internal table to METHOD2. I'm confused how to declare the table in 'Parameter' section of the METHOD2. I have specified the following:
Parameter = WTAB1
Type = Import
Pass value = blank
Optonal = Blank
Typing Method = Type
Associated type = ZSCIW and this is declared in DDIC as a data type with fields ZZLINE(72) and ZZPOS(4)
Default value = blank
METHOD1 (simplified example)
method METHOD1.
Table of individual words from source code
types: begin of wline,
WORD(72),
POSN(4),
end of wline,
wlines type standard table of wline with default key.
data: wx type wlines,
wa like line of wx.
Clear past results
REFRESH: Wx.
Look through source code...
LOOP AT ref_include->lines into wa.
APPEND wa.
ENDLOOP.
Call METHOD2 and pass internal table wa
METHOD2 ( ).
1. How to you define the parameters in METHOD2.
2. What is the coding in METHOD1 to call METHOD2.
Your help will really be appreciated.
Thanks.
SoyabFor funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
Check these links.
http://www.henrikfrank.dk/abapuk.html
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
Go through the below links,
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
OO ABAP links:
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
go through these links
http://www.erpgenie.com/abap/index.htm
http://sic.fh-lu.de/sic/bic.nsf/(vJobangebote)/EC8AD2AE0349CE92C12572200026FDB8/$File/Intern%20or%20Working%20Student%20as%20ABAB%20OO%20Developer.pdf?Open
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
check the below links lot of info and examples r there
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
<b>good book on ABAP objects(OOPS)
http://www.esnips.com/doc/bc475662-82d6-4412-9083-28a7e7f1ce09/Abap-Objects---An-Introduction-To-Programming-Sap-Applications</b>
Rewards if useful..............
Minal -
import java.util.*;
public class usingVectors
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
int VECTOR_SIZE;
System.out.print("Enter the size of the array: ");
VECTOR_SIZE = console.nextInt();
System.out.println();
Vector<Integer> listA = new Vector<Integer>();
System.out.print("Enter " + VECTOR_SIZE + " integers: ");
fillArray(listA, VECTOR_SIZE);
System.out.println();
System.out.print("List of Integers that you inputted: \n ");
printArray(listA, VECTOR_SIZE);
System.out.println();
System.out.println("The position of the smallest integers in the array is: " + indexSmallest(listA, VECTOR_SIZE));
System.out.println("The smallest integer in the array is: " + listA[indexSmallest(listA, VECTOR_SIZE)]);
public static void fillArray(int list, int sizeOfVector)
int index;
for (index = 0; index < sizeOfVector; index++)
list[index] = console.nextInt();
public static void printArray(int list, int sizeOfVector)
int index;
for (index = 0; index < sizeOfVector; index++)
System.out.print(list[index] + " ");
public static int indexSmallest(int list, int sizeOfVector)
int index;
int smallIndex = 0;
for (index = 0; index < sizeOfVector; index++)
if (list[smallIndex] > list[index])
smallIndex = index;
return smallIndex;
Im trying to pass a vector to a method. Im not sure what i am doing wrong if anyone could look at what im doing wrong i would appreciate it.
ER:usingVectors.java:19: fillArray(int,int) in usingVectors cannot be applied to (java.util.Vector<java.lang.Integer>,int)
fillArray(listA, VECTOR_SIZE);My first problem was to write a method, smallestIndex that takes as its parameters an int array and its size. Return the smalles element in the array and its postion. Now i have that done and it was good. He wants us to change that program to use vectors. So i feel like i have done most of it right but like you said the error. It won't pass the vector through to the method. I believe
ok thank you. I guess what i should ask you now. In my line of code. How do i set the parameters to pass a Vector instead of the int?
THANK YOU FOR YOU HELP
Vector<Integer> listA = new Vector<Integer>();
System.out.print("Enter " + VECTOR_SIZE + " integers: ");
fillArray(listA, VECTOR_SIZE); **This is where i call my method with the vector name listA, and the int VECTOR_SIZE, it pops the problem here or would it be in the declaring the new varibles at the start of the method**
System.out.println();
System.out.print("List of Integers that you inputted: \n ");
printArray(listA, VECTOR_SIZE);
System.out.println();
System.out.println("The position of the smallest integers in the array is: " + indexSmallest(listA, VECTOR_SIZE));
System.out.println("The smallest integer in the array is: " + listA[indexSmallest(listA, VECTOR_SIZE)]);
public static void fillArray(int list, int sizeOfVector) *Or would it be here?*
int index;
for (index = 0; index < sizeOfVector; index++)
list[index] = console.nextInt();
}
Maybe you are looking for
-
I recently found my phone outside in light rain (it had been there about 20 minutes). It had some glitches at first, however after letting it rest overnight it seemed to mostly recover. The one problem I am having is that I no longer have sound for
-
How do you sync rented movies with Apple Tv software version 2.4 and Itunes 8?
-
Middle Name appearing twice in CRM
Hi everyone, I created a custom CRM form containing just a "Middle Name" Field. I noticed though in the admin under CRM > Customers that there is a "Middle Name" appearing under "Contact Details" and then a second "Middle Name" that appears further d
-
How to make T410 combo jack working with 4 ring headset?
This has puzzled me for a while - the mic part of the combo jack does not work. I have a headset which works properly with my Nokia E63 phone. the connector looks like http://commons.wikimedia.org/wiki/File:IPod_and_iPhone_audio_plugs.JPG although I
-
Extract 'File Properties' Metadata
I am looking for a way to extract all the information in the File Properties to a .csv. I have downloaded the Export Metadata script and it, works except I cannot include the File Properties in the Schema field. I hope there is a way to modify this s