Problems with dynamic resize of JTextPane...
Dear Java Gurus,
I am quite new to Java, so I am strill struggling to understand the details about it all...but thanks
to a lot of very helpful people in this forum, the bits and pieces start to come together, even
though it's obvious that I now need guidance again :-)
I posted yesterday regarding how I could implement a JTextPane that dynamically would change
its height. This means that the JTextPane has a fixed width, but when the user types in text, its sets
its own height to fit the enterred text. A very kind person posted some code that more or less looks
like the code below, with a few changes:
package test;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.awt.*;
public class test {
public static void main(String[] argv)
final JFrame frame = new JFrame();
JTextPane pane= new JTextPane("Test ");
pane.getDocument().addDocumentListener(new DocumentListener()
public void insertUpdate(DocumentEvent e) {proccess(e.getDocument());}
public void removeUpdate(DocumentEvent e) {proccess(e.getDocument());}
public void changedUpdate(DocumentEvent e) {proccess(e.getDocument());}
private void proccess(Document doc)
Dimension size = pane.getPreferredSize();
pane.setSize(150, (int)size.getHeight());
frame.validate();
frame.getContentPane().add(new JScrollPane(pane), BorderLayout.SOUTH);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 300);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}The code works just fine, but has a small "feature" in it that I don't understand. It appears
like the resizing has a delay in it. If you enter the JTextPane and press return once, the text
pane will not resize. If you press backspace, the cursor will move back up, but now the
text pane will increase its size, to fit the size of the previos text size. If you now press the
return key again, the text pane shrinks by one line.
In other words...it seems the resizing is always delayed by one, as if the last entered
character is not taken into account when preferredSize() returns the value. As I don't yet
understand in which order events are generated and handled, does anybody see what I
need to change in order to get rid of this slightly disturbing delay? :-)
Any comments would be highly appreciated!
Best regards,
Xxodus.
You try to ask size before edition process is complete.
Try to change size after finishing processing of document change event.
Like this.
private void proccess(Document doc)
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Dimension size = pane.getPreferredSize();
pane.setSize(150, (int)size.getHeight());
frame.validate();
}regards,
Stas
Similar Messages
-
After Effects won't close/Problems with dynamic links
When I quit After Effects the icon still shows up and it says that it is still open, even force quit will not work. Also having problems with dynamically linked files between after effects and Premiere pro. Rendering in Premiere doesn't work unless I go to AE, save the project, then go back to Premiere. I have OSX Mavericks 10.9.2, a late 2012 mac pro, and AE CC 12.2.1.5
Kevin: would appreciate further thoughts on this.
I am using Pr2014, version 8.0.0 I am using AE2014, version 13.0.2.3. When I was on earlier versions of each, I had no problem importing AE comps into Pr. I'd choose import in Pr, then select the AE project, then select the comp. But with my new and improved versions of AE and Pr, I keep getting "importer reported a generic error."
I also tried to go the other way. I selected in Pr the clips I wanted to work on in AE, and then tried "replace with AE comp" but got the "generic error" message again..
Finally, I attempted to create a Dynamic Link from Pr via the File menu, but with each of the options from there, I got "failed to connect to AE Dynamic Link"
Any advice you can share, would be most welcome. -
Problem with dynamic LOV and function
Hello all!
I'm having a problem with a dynamic lov in APEX 3.0.1.00.08. Hope you can help me!
I have Report and Form application. On the Form page i have a Page Item (Popup Key LOV (Displays description, returns key value)).
When i submit the sql code in the 'List of vaules defention' box. I get the following message;
1 error has occurred
LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
When i excecute the code below in TOAD or in the SQL Workshop it returns the values i want to see. But somehow APEX doesn't like the sql....
SELECT REC_OMSCHRIJVING d, REC_DNS_ID r FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
returns_dns_lov_fn is a function, code is below;
CREATE OR REPLACE FUNCTION DRSSYS.return_dns_lov_fn (p2_dns_id number)
RETURN dns_table_type
AS
v_data dns_table_type := dns_table_type ();
BEGIN
IF p2_dns_id = 2
THEN
FOR c IN (SELECT dns_id dns, omschrijving oms
FROM d_status dst
WHERE dst.dns_id IN (8, 10))
LOOP
v_data.EXTEND;
v_data (v_data.COUNT) := dns_rectype (c.dns, c.oms);
END LOOP;
RETURN v_data;
END IF;
END;
and the types;
CREATE OR REPLACE TYPE DRSSYS.dns_rectype AS OBJECT (rec_dns_id NUMBER, rec_omschrijving VARCHAR2(255));
CREATE OR REPLACE TYPE DRSSYS.dns_table_type AS TABLE OF dns_rectype;
I tried some things i found on this forum, but they didn't work as well;
SELECT REC_OMSCHRIJVING display_value, REC_DNS_ID result_display FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
SELECT REC_OMSCHRIJVING display_value d, REC_DNS_ID result_display r FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
SELECT a.REC_OMSCHRIJVING display_value, a.REC_DNS_ID result_display FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) a order by 1
Edited by: rajan.arkenbout on 8-mei-2009 14:41
Edited by: rajan.arkenbout on 8-mei-2009 14:51I just had the same problem when I used a function in a where clause.
I have a function that checks if the current user has acces or not (returning varchar 'Y' or 'N').
In where clause I have this:
where myFunction(:user, somePK) = 'Y'
It seems that when APEX checked if my query was valid, my function triggered and exception.
As Varad pointed out, check for exception that could be triggered by a null 'p2_dns_id'
Hope that helped you out.
Max -
Problem with JFrame resizing at runtime
Hi All,
I have a problem with resizing the JFrame at runtime. Even if i resize the JPanel. It is not affection on all the components over the frame. How can i solve that I am using AbsoluteLayout(jre1.6) and here i am going to provide you code snippet. My requirement is to resizt the form. If form is small in size then all the component should also be according tothe size of the form.
public void initComponents(int size) {
if(size >= 50) {
x_co_or = 300;
y_co_or = 300;
} else if(size < 50) {
x_co_or = 200;
y_co_or = 200;
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jButton1.setText("jButton1");
jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 40, 110, 40));
getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, x_co_or, y_co_or));
pack();
Can anybody suggest any idea/solution.
Any idea/solution are most welcome.
Regards,
Pradeep DubeyHow can i solve that I am using AbsoluteLayout(jre1.6)
and here i am going to provide you code snippet.no need for the snippet, you're using absolute positioning, which means you're responsible for location and size on every single change.
start coding now, take about a week, or you could use a layout manager, take maybe, 5 minutes -
Problem with getting resized image's bytes
I've got a problem with getting correct bytes of a newly resized image. The flow is that I retrive an image from the filesystem. Due to the fact that it is large I resize it to a 50x50px thumbnail. I can display this thumbnail in #benchmark1 (see code below). Unfortunately something's wrong with my imageToBytes funtion which returns reasonably small size of image but is totally useless - I can't make an image of it anymore so at #benchmark2 the application either crashes or keeps freezing. I saved this byte array on my disk and tried to preview under Windows how does it look but I got a message "Preview unavailabe". I did some digging in the Internet and I supposed that it's because I don't use any jpg or png encoders to save the file. Actually I think that it's not the case, as the bytes returned from method imageToBytes look weird - I cannot even make a new image of them and display it without any saving in memory.
byte[] bytes = FileHandler.readFile (
FileHandler.PHOTOS_PATH, fileName);
Image img2 = Image.createImage (bytes, 0, bytes.length);
img2 = ImageHandler.getInstance ().resize (img2);
//#benchmark1
bytes = ImageUtils.imageToBytes (img2);
img2 = Image.createImage (bytes, 0, bytes.length);
//#benchmark2my imageToBytes function is as follows:
public static byte[] imageToBytes (Image img)
int[] imgRgbData = new int[img.getWidth () * img.getHeight ()];
byte[] imageData = null;
try
img.getRGB (imgRgbData, 0, img.getWidth (), 0, 0, img.getWidth (),
img.getHeight ());
catch (Exception e)
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
DataOutputStream dos = new DataOutputStream (baos);
try
for (int i = 0; i < imgRgbData.length; i++)
dos.writeInt (imgRgbData);
imageData = baos.toByteArray ();
baos.close ();
dos.close ();
catch (Exception e)
return imageData;
I've run totally out of any idea what's wrong, please help!
Edited by: crawlie on Jul 17, 2010 6:21 PMHey Crawlie,
Please note that simply writing int values into ByteArrayOutputStream will not suffice. Please have a look at the following conversion from int pixel value into byte[4]:
public static final byte[] intToByteArray(int value) {
return new byte[] {
(byte)(value >>> 24),
(byte)(value >>> 16),
(byte)(value >>> 8),
(byte)value
}Good Luck!
Daniel -
CS3 - Problem with dynamic text -
Hello,
I have a problems with my text, when i write a few ligne inside a dynamic text box, if i selec the text and by the way drag it down the first line goes up and disapear. Is there any way to solve this?This is the Flash Player forum; please post your question in the appropriate product forum.
-
Oracle 9i, Rel.2 - Problems with dynam statement and cursor
Hello,
I have the following problem with Oracle 9i, Release 2:
I have a SQL-statement, which I create with the help of a configuration table. That means I don’t know how this statement looks at runtime. It could be look like this:
SELECT Att1, Att2, Att3
FROM Tab1
or this…
SELECT Att1, Att2
FROM Tab1
or this…
SELECT Att1
FROM Tab1
etc.
That means I don’t know in advance how many columns will be in the select-clause.
Here my code snippet until here:
v_query_str := 'SELECT ' || v_select_clause_str
|| ' FROM cb.' || v_table;
,,v_select_clause_str" willl be created dynamically
,,v_table" is as well from the config-table
Now I want to iterate through the result of the query and do further processing.
For this reason I wanted to use a cursor, iterate through the rows and save every value of each row in an own variable (but I don’t know the number of columns!!!).
But how can I open a cursor and iterate through it without knowing the number of columns???
The following code is NOT working:
TYPE t_dataColumnComp IS TABLE OF VARCHAR2(200);
a_dataColumnComp t_dataColumnComp;
--here I create the query…
v_query_str := 'SELECT ' || v_select_clause_str
|| ' FROM cb.' || v_table;
OPEN c_tempAtt FOR v_query_str;
LOOP
FETCH c_tempAtt INTO a_dataColumnComp; --THIS DON’T WORK
EXIT WHEN c_tempAtt%NOTFOUND;
FOR i IN 1..a_dataColumnComp.COUNT
LOOP
DBMS_OUTPUT.PUT_LINE(a_dataColumnComp(i));
END LOOP;
END LOOP;
CLOSE c_tempAtt; --close cursor variable
Regards
HomerYou will need to use DBMS_SQL to handle this since the number of columns in the result set is not known until runtime.
See here for an example of using DBMS_SQL:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:235814350980 -
Does anyone out there use dynamic SQL with DB2? If so, are the sql statements causing a PreparedStatement to be executed on DB2. I posted this question similarly before, but never resolved it, and it is killing me. I have to resolve this ASAP!
Here is the problem: My DB2 Admin says that EVERY TIME I access the database, my Java app is causing the database to create a PreparedStatement. However, I'm using Statement objects exclusively, with dynamic SQL. He says that DB2 needs an "access path" for the client, and that it converts the Statement to a PreparedStatement, as this is the only way to get this "access path". He says the only solution is either stored procedures or SQLJ, which will do the binding in advance, and increase performance tremendously. However, I am STRONGLY opposed to using SQLJ, and if we do stored procedures, we'd have to write one for every possible SQL statment! I KNOW there is a better solution.
Is anyone out there having these problems with JDBC and DB2? Surely someone out there uses DB2 and JDBC and either has these problems or can confirm that something is incorrectly configured on the database side.
Any help would be great. Thanks, WillNow I'm wondering if maybe the PreparedStatements are ONLY being called on the database when I call getConnection(), and not when I call executeQuery() or executeUpdate() from the Statement object. I just can't see why the database would have to make an access path for every SQL statement executed, but I could see it creating an access path for every connection requested. Any thoughts on that theory?
-
URGENT: Heap space problems with image resizing
I'm creating a Swing program, with an InternalFrame-type interface. One of the frames contains a .gif file background and then primitive G2D objects are drawn on top of it.
The background image loads and displays fine at its original size, but I've added code for when the window resizes, and resizing the image causes the VM to give me an OutOfMemory exception.I tried this without any problem (with a gif of 137 kb):
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ImageFrame extends JFrame {
public ImageFrame() {
initComponents();
Toolkit T=this.getToolkit();
im0=T.getImage("C:\\sophie.gif");
MediaTracker mediaTracker = new MediaTracker(this);
mediaTracker.addImage(im0, 1);
try {
mediaTracker.waitForID(1);
} catch (InterruptedException ie) {
System.err.println(ie);
jInternalFrame1.add(new MyPanel());
private void initComponents() {
jDesktopPane1 = new JDesktopPane();
jInternalFrame1 = new JInternalFrame();
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
jInternalFrame1.setResizable(true);
jInternalFrame1.setVisible(true);
jInternalFrame1.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent evt) {
jInternalFrame1ComponentResized(evt);
jInternalFrame1.setBounds(0, 0, width, height);
jDesktopPane1.add(jInternalFrame1, JLayeredPane.DEFAULT_LAYER);
getContentPane().add(jDesktopPane1, BorderLayout.CENTER);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-800)/2, (screenSize.height-500)/2, 800, 500);
private void jInternalFrame1ComponentResized(ComponentEvent evt) {
width=jInternalFrame1.getWidth();
height=jInternalFrame1.getHeight();
public static void main(String args[]) {
new ImageFrame().setVisible(true);
private int width=500,height=300;
private Image im0;
private JDesktopPane jDesktopPane1;
private JInternalFrame jInternalFrame1;
class MyPanel extends JPanel {
public void paint(Graphics g1) {
g1.drawImage(im0,0,0,width,height,this);
g1.dispose();
} -
Problem with Dynamic Node & UI Elements
Hi,
The scenario is to create an Questioaire.Since the number questions which I get from R/3 may vary, I have created the Dynamic Node which is mapped with Dynamic set of Radio button Group by index for options & Dynamic text view for displaying Questions.. A New Dynamic Node will be created for each set of Questions .The Number of questions displayed per page is controlled by the Static Counter Variable....
Now the issue is ,if i click back button the count will be initialized so again it needs to trigger the DoModifyView(). at that time It is arising an exception "Duplicate ID for view & Radio button ..." because while creating Dynamic node i used to have "i" value along the Creation of node name...
for(i=Count;i<i<wdContext.nodeQuestions().size();i++)
customnod=<b>nodeinfo.getChild("Questionaire"+i);</b>
if(customnod==null)
Its not possible to create a new node whenever i click the Back button.
At the same time i am not able to fetch the elements which had already created Dynamically...
How do i make the Next & back button work?
If anyone bring me the solution It would be more helpful to me.
Thanks in advance..
Regards,
MalarHi,
We can Loop through the Node Elements but how can we do Option Button Creation for each set of question Options?. At design time we can not have the radio buttons,because we do not know how many set of questions are available at the Backend. -
Problem with Dynamically accessing EJB Class objects in WL 7.0 SP1
I am trying to build a component which has the ability to instantiate and execute
an known EJB method on the fly.
I have managed to build the component but when I try and execute it I get a ClassNotFoundException.
I know that the EJB I am trying to invoke is deployed and available on the server,
as I can see it in the console, I also seen to have been able to get the remote
interface of the object, my problem occurs when I try and access the class object
so I can perform a create on the object and then execute my method
The code I have written is below:
private Object getRemoteObject(Context pCtx, String pJNDIName, String pHomeBean)
throws Exception {
String homeCreate = "create";
Class []homeCreateParam = { };
Object []homeCreateParamValues = {};
try {
//This call seems to work and doesn't throw an exception
Object home = pCtx.lookup(pJNDIName);
//However this call throws a java.lang.ClassNotFoundException
Class homeBean = Class.forName(pHomeBean);
Method homeCreateMethod = homeBean.getMethod(homeCreate,homeCreateParam);
return homeCreateMethod.invoke(home, homeCreateParamValues);
} catch (NamingException ne) {
logStandardErrorMessage("The client was unable to lookup the EJBHome.
Please make sure ");
logStandardErrorMessage("that you have deployed the ejb with the JNDI
name "+pJNDIName+" on the WebLogic server ");
throw ne;
} catch (Exception e) {
logStandardErrorMessage(e.toString());
throw e;
Any advice would be really appreciated, I'm fast running out of ideas, I suspect
it has something to do with the class loader but I'm not sure how to resolve it
Regards
Jo CorlessHello Joanne,
Congratulations! I'm very happy that you've managed to fix your problem. It's
always essential to understand how to package applications when deploying on BEA
WebLogic. Usually, by throwing everything into an EAR file solves just about all
the class loader problems. :-) Let us know if you have any further problems that
we can assist you with.
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
"Joanne Corless" <[email protected]> wrote:
>
>
I've fixed it!!!!!!!!
Thanks to everyone who gave me help!!!!
The class loader was the culprit which is what I suspected all along.
As soon
as I put the 2 jar files I was using into an EAR file the problem went
away!!!!!
Thanks again
Jo Corless
"Ryan LeCompte" <[email protected]> wrote:
Hello Joanne,
As Mr. Woollen mentioned, I also believe it's a problem with the class
loader.
You need to be careful how you arrange your EJBs, because WebLogic has
a specific
method in which it loads classes in an EAR, JAR, and WAR file(s). Please
refer
to http://dev2dev.bea.com/articles/musser.jsp for more information about
BEA WebLogic
class loading mechanisms and caveats. Also, try printing out the various
methods
that are available on the object that was returned to you via reflection.
For
example, use the getMethods() method, which returns an array of Method
objects
that you can subsequently cycle through and print out the various method
names.
This way you can discover if the class found/returned to you is indeed
the one
you intend to locate.
Hope this helps,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
Rob Woollen <[email protected]> wrote:
I believe the issue is the home interface class for this EJB is not
available in the class loader which is doing the reflection.
If you do:
getClass().getClassLoader().loadClass(homeInterfaceClassName)
I suspect it will fail. Reflection still requires that the class be
loadable.
-- Rob
Joanne Corless wrote:
Hi Slava,
If I make my code look like you describe below I get a compliationerror telling
me that
home.getMethod() is not recognised (no such method)
If I change it slightly and use
Method homeCreateMethod =
home.getClass().getMethod(homeCreate,homeCreateParam);
The code will compile OK but when executed it still throws a NoSuchMethodException
Any ideas ?
Thanks for your help so far
Regards
Jo Corless
Your code should look like
Object home = pCtx.lookup(pJNDIName);
Method homeCreateMethod =
home.getMethod(homeCreate,homeCreateParam);
return homeCreateMethod.invoke(home, homeCreateParamValues);
Regards,
Slava Imeshev
"Joanne Corless" <[email protected]> wrote in message
news:[email protected]...
Hi Ryan,
I also wanted to mention that if you do a "header search" in this
particular
newsgroup
with the search query as "reflection", you will see many previousmessages
regarding
reflection and EJBs. I believe you could learn a lot from thedifficulties
that
others have faced and solved.I tried that and although there was a number of similar cases noneof them
actually
seem to fix my issue. Thanks for the suggestion though
Are the EJBs that you are trying to access accessible via your
system
classpath?
Try to avoid having them accessible via the main system classpath,and
only bundle
them in your appropriate EJB jar files (contained in an EAR file,for
example).Maybe I should have laid the problem out a little clearer.
I have a number of EJB's bundled up in a JAR file which is hot deployedto
the
server. Within this first JAR file is an EJB (SSB) component that
needs
to
be
able to invoke a known method on another EJB. This second EJB may
or
may
not be
within the first JAR file but it also will be hot deployed.
The component trying to invoke the method on the 2nd EJB has to
be
able to
create
an instance of the 2nd EJB without actually knowing anything bar
a
JNDI
Name which
is passed in at runtime.
I can get as far as doing the
Object home = pCtx.lookup(pJNDIName);
This returned a class with the name
"com.csc.edc.projects.allders.httppostoffice.postman.PostmanBean_mp8qy2_Home
Impl_WLStub"
My problem seems to occur when I try and invoke the create method
Method homeCreate = home.getClass().getMethod("create", new Class[0]);
My code throws a java.lang.NoSuchMethodException at this point so
I
am
unable
to progress to the next step of :
Object bean = homeCreate.invoke(home, null);
So I can return the instantiated bean back to the calling client.
Why am I getting the NoSuchMethodException, is is because I am gettinga
stub
back rather than the home interface and if so how do I get the truehome
interface
from the bean
Thanks in advance
Jo Corless -
One of my customers is having severe RAC performance issues, which appeared three times so far. Each time, the performance impact lasted around 10 minutes and caused basically a hang of the application. ASH investigation revealed that the time frame of performance issues exactly matches a DRM operation of the biggest segment of the database. During the problematic time period, there are +50 instead of 2-3 active sessions and they are mostly waiting for gc related events: "gc buffer busy","gc cr block busy", "gc cr block 2-way", "gc current block 2-way", "gc current request", "gc current grant busy", etc.
In addition, there is one single session which has wait event "kjbdrmcvtq lmon drm quiesce: ping completion" (on instance 1) and 1-3 sessions with wait event "gc remaster". (on instance 2)
Does anybody have any experience with DRM problems with 10.2.0.4 on Linux Itanium?
I know that it is possible to deactive DRM, but usually it should be beneficial to have it enabled. I could not find any reports of performance impact during DRM operation on metalink. Support is involved but clueless.
Regards,
MartinOracle Support has requested stacktraces of lms processes during the period of performance degradation. We decided to enable OSWatcher to get systemwide linux data and procwatcher to get lms process stacktraces. We created a Grid Control User Defined Metric to check whether the symptoms of a DRM performance problem is taking place. Then we triggered the lms stacktraces with a Grid Control Response Action script of the UDM.
Oracle Support has also requested global hanganalyze and system state dumps but we decided not to collect system state dumps because of the big additional performance impact.
The oswatcher data showed that during the drm period, the lms processes had very high CPU resource utilization.
In the meantime Oracle Support has confirmed that we are hitting 6960699. We have received patch 8516675 which includes the bugfix and have installed it. Now, we are waiting to see whether this indeed fixes the issue. -
Problem with Dynamic Table Name
Hello all,
I am having trouble using a dynamic table name. I have the following code.....
declare l_cur sys_refcursor;
l_ID int;
l_tableName varchar(30);
BEGIN
open l_cur for
select hkc.ColumnID, mapping from &HKAPPDB_Schema_Name..doctablemapping ddm
inner join &HKDB_Schema_Name..HKColumns hkc on hkc.doctablemappingid = ddm.id
where ddm.id > 0;
LOOP
FETCH l_cur into l_ID, l_tableName;
EXIT WHEN l_cur%notfound;
-- update missing VerbID in DocumentDocMapping table
UPDATE &HKAPPDB_Schema_Name..IndexedDocument
SET VerbID = (SELECT t.VerbID
FROM (SELECT DocRef, VerbID, DateUpdated
FROM &HKAPPDB_Schema_Name..l_tableName dd - this is where the dynamic table name is used
WHERE dd.VerbID is not NULL))
WHERE HKColumnID = l_ID AND VerbID is NULL;
END loop;
end;
/When I try to execute this i get an error
ORA-00942: table or view does not exist
What am I doing wrong?
Regards,
Tobyredeye wrote:
I only started about 6 weeks ago, with no tutorials and learning it on the fly; Same here.. only my introduction was to a 12 node Oracle OPS cluster all those years ago.. and required a whole new mind set after using SQL-Server extensively. But it was fun. Still is. :-)
but thats what you get when a company throws you in at the deep end with a ridiculous time constraint to migrate a whole MSSQL DB.Migrating SQL-Server to Oracle is not a simple thing. A lot of best practices in SQL-Server are absolutely worse practices in Oracle - they are that different. Simple example is lock escalation - an issue in SQL-Server. In Oracle, the concept of a lock being escalated into a page lock simply does not exist.
In terms of getting the migration done as quickly and painlessly as possible I try to reuse all the logic as it appears in the MSSQL code - in this case it was using dynamic table names. I do not doubt that i am probably shooting myself in the foot in the long run.....As long as you do not splatter too much blood on us here.. not a problem :D
Seriously though - just keep in mind that what works in SQL-Server may not work as well (or even at all) in Oracle. So do not hesitate to refactor (from design to code to SQL) mercilessly when you think it is warranted. -
Problem with Dynamic Configuration in SOAP-AXIS adapter..!!!
Hi ,
Idoc> XI>SOAP-AXIS
I am doing a scenario where I need to pass the URL dynamically in SOAP-AXIS adapter by taking the SNDPRN of Idoc.
If SNDPRN = 100 , message has to go to http://10.190.25.16:8210/file/receiver
SNDPRN = 200 , message has to go to http://20.180.26.16:8210/file/receiver
It is working correctly when I tried for single receiver. When I' tried to use DynamicConfiguration, it is coming in SOAP document but it is not working and not passing to correct channel. According to this note 1039369, I mentioned the following modules.
AF_Adapters/axis/AFAdapterBean ---> afreq
AF_Adapters/axis/HandlerBean ---> xireq
AF_Adapters/axis/HandlerBean ---> dc
AF_Adapters/axis/HandlerBean ---> remover
AF_Adapters/axis/HandlerBean ---> trp
AF_Adapters/axis/HandlerBean ---> xires
AF_Adapters/axis/AFAdapterBean ---> afres
xireq -> handler.type-> java:com.sap.aii.axis.xi.XI30OutboundHandler
dc -> handler.type-> javasap.aii.axis.xi.XI30DynamicConfigurationHandler
dc ---> key.1 ---> write http://sap.com/xi/XI/System/SOAP TServerLocation
dc ---> location.1 ---> context
dc ---> value.1 ---> transport.url
remover ---> handler.type ---> java:com.sap.aii.axis.soap.HeaderRemovalHandler
remover ---> namespace ---> http://sap.com/xi/XI/Message/30
trp ---> handler.type ---> java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender
trp ---> module.pivot ---> true
xires ---> handler.type ---> java:com.sap.aii.axis.xi.XI30OutboundHandler
and I am getting the below error in SOAP-AXIS channel
Error Axis: error in invocation: java.lang.IllegalArgumentException: object type invalid: class com.sap.aii.adapter.xi.ms.XIMessage
Error MP: Exception caught with cause java.lang.IllegalArgumentException: object type invalid: class com.sap.aii.adapter.xi.ms.XIMessage
Error Exception caught by adapter framework: object type invalid: class com.sap.aii.adapter.xi.ms.XIMessage
Error Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: object type invalid: class com.sap.aii.adapter.xi.ms.XIMessage: java.lang.IllegalArgumentException: object type invalid: class com.sap.aii.adapter.xi.ms.XIMessage
Kindly let me know if anyone has any idea what might be wrong?
Thanks
DeepthiI have a similar problem. I also like to add some header fields to my message und that's way I'm trying to use the AXIS adapter. (Axis adapter FAQ question 30) Unfortunately I'm getting exactly the same error message:
com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.IllegalArgumentException: object type invalid: class com.sap.aii.adapter.xi.ms.XIMessage
Deepthi, you wrote that you have missed one jar file. Can you remember which file it was? -
Problem with dynamic columns in smartforms.
Dear SDN Experts,
I have a requirement in smartforms for dynamic columns.
i have used template with 10 columns, So from these 10 columns,Columns may vary monthly MIN 2 to MAX 10 depending on
readings with them for that month.
i cannot fix column headings also,Because headings also changes dynamically.
So Problem is if there is no data in columns,Columns is displayng empty.
For EX: In this month i have 2 columns data remaining all columns is displaying empty boxes.
Please suggest me a solution is this posible in smartforms if i use table also.
<removed by moderator>
Regrds,
MNR
Edited by: Thomas Zloch on Sep 11, 2011 3:50 PMHi friend,
See the link below it is having the solution of hiding the columns in smart forms
Hide table columns in smart form?
Create a table to display your values with 12 col and hide the columns based on the idea provided in the link above.
I think this will solve your issue if you still have queries please revert back to me i will help you.
Thanks,
Sri Hari
Maybe you are looking for
-
F110 - Issue with creation of wire file
Hi Sap gurus, May be someone could guide me through this issue. Iam using the payment program (F110) to pay the vendors. I have Bank 1 and Bank 2 which are used for wire Payments. The ranking order is 1 for Bank 1 and Bank 2 has ranking order 2.
-
Windows 8.1 on a MacBook Pro 13" Retina without bootcamp
Hi, I have a Retina MacBook Pro 13" haswell, can I replace OS X 10.9 with Windows 8.1 without bootcamp?
-
Complete Frustration with these wireless products
The problems are - Most of the time the type of security detected by the WPN111/windows in my PC is incorrect, it detects the opposite of whatever I have set in the Extreme, and when I try to change it in windows it just defaults back to the opposite
-
Write HTML Files from java application
Hello, i have to write HTML files from a java application. I am asking if anybody can give me a hint about a good simple solution (library) which can do some of the job for me. i know FOP for example is good to create pdf or html from xml, but i dont
-
System status ISBD Insufficient budgeting
Please advise , what is tis mean System status ISBD Insufficient budgeting Thank you