Getting error while compiling this pl/sql code
Hi,
I am trying to execute the below block of pl/sql code and i encountering an error. i tried all possible combination of paranthesis and quotes. still giving error. can someone please help?
IF inserting THEN
pk_imdb_audit.p_ins_characteristic_a_t
(in_'||rpad(column_name,35,' ')||'=> pk_imdb_audit.v_action_inserting,'
WHEN max_col = column_id THEN
in_'||rpad(column_name,35,' ')||'=> '||lower(in_col_value)||');'
ELSE
' in_'||rpad(column_name,35,' ')||'=> '||lower(in_col_value)||','
END text,
table_name,
column_id,
2 disp_ord
error snapshot:-
ORA-06550: line 14, column 14:
PLS-00103: Encountered the symbol "||rpad(column_name,35," when expecting one of the following:
. ( ) , * @ % & | = - + < / > at in is mod remainder not
range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
and or like LIKE2_ LIKE4_ LIKEC_ as between from using ||
multiset member SUBMULTISET_
The symbol "( was inserted before "||rpad(column_name,35," to continue.
ORA-06550: line 15, column 13:
PLS-00103: Encountered the symbol "WHEN" when expecting one of th
Hi,
here is a 'parseable' version of your query, but there is numerous ways to improve what you want to do (not sure even if the query is giving you what you're expecting from it):
SELECT text
FROM (SELECT (CASE
WHEN min_col = max_col THEN 'CREATE OR REPLACE TRIGGER '
|| SUBSTR(column_name,
1,
4
|| 'aud
AFTER INSERT
OR UPDATE
OF '
|| column_name
|| ',
OR DELETE ON imdb.'
|| table_name
|| '
FOR EACH ROW'
ELSE(CASE
WHEN min_col = column_id THEN 'CREATE OR REPLACE TRIGGER '
|| SUBSTR(column_name,
1,
4
|| 'aud
AFTER INSERT
OR UPDATE
OF '
|| column_name
|| ','
ELSE(CASE
WHEN max_col = column_id THEN ' '
|| column_name
|| '
OR DELETE ON imdb.'
|| table_name
|| '
FOR EACH ROW'
ELSE(CASE
WHEN column_id IS NULL THEN 'CREATE OR REPLACE TRIGGER '
|| SUBSTR
(column_name,
1,
4
|| 'aud
AFTER INSERT
OR UPDATE
OR DELETE ON imdb.'
|| table_name
ELSE ' '
|| column_name
|| ','
END
END
END
END
) text,
table_name1 table_name,
column_id,
1 disp_ord
FROM (SELECT LOWER(REPLACE(column_name,
'O_',
)) column_name, /*changing O to O_*/
LOWER(REPLACE(t.table_name,
'_A_',
)) table_name,
LOWER(t.table_name) table_name1,
c.column_id,
MIN(column_id) OVER(PARTITION BY c.table_name) min_col,
MAX(column_id) OVER(PARTITION BY c.table_name) max_col
FROM all_tab_columns c,
(SELECT object_name table_name
FROM all_objects
WHERE TRUNC(created) = TRUNC(SYSDATE)
AND object_name = 'CHARACTERISTIC_A_T') t
--AND object_name LIKE 'IMDB/_A/_%' ESCAPE '/') t /*commented this line for testing*/
WHERE c.table_name(+) = t.table_name
AND SUBSTR(column_name(+),
1,
2
) = 'O_'))
/*changed the substring condition to match new changes*/
UNION ALL
SELECT (CASE
WHEN min_col = column_id THEN 'DECLARE
BEGIN
IF inserting THEN
pk_imdb_audit.p_ins_characteristic_a_t
(in_'
|| RPAD(column_name,
35,
|| '=> pk_imdb_audit.v_action_inserting,'
ELSE(CASE
WHEN max_col = column_id THEN 'in_'
|| RPAD(column_name,
35,
|| '=> '
|| LOWER(in_col_value)
|| ');'
ELSE ' in_'
|| RPAD(column_name,
35,
|| '=> '
|| LOWER(in_col_value)
|| ','
END
END
) text /*,
table_name,
column_id,
2 disp_ord*/
FROM (SELECT table_name,
column_name,
column_id,
min_col,
max_col,
in_col_value,
trg_header,
'in_'
|| RPAD(column_name,
35,
|| '=> '
|| LOWER(in_col_value)
|| ',' in_col
FROM (SELECT LOWER(c.column_name) column_name,
LOWER(c.table_name) table_name,
c.column_id,
(CASE
WHEN SUBSTR(column_name,
1,
2
) = 'N_' THEN
/*changed the substring condition to match the new change*/
':NEW.'
|| REPLACE
(column_name,
'N_',
'N_'
/*changed the condition to match new requirement*/
WHEN SUBSTR(column_name,
1,
2
) = 'O_' THEN
/*changed the substring condition to match the new change*/
'NULL'
ELSE ':NEW.'
|| REPLACE(column_name,
'_A_',
END
) in_col_value,
LOWER(SUBSTR(column_name,
1,
3
)) trg_header,
MIN(column_id) OVER(PARTITION BY c.table_name) min_col,
MAX(column_id) OVER(PARTITION BY c.table_name) max_col
FROM all_tab_columns c
WHERE c.table_name IN(
SELECT object_name
FROM all_objects
WHERE TRUNC(created) = TRUNC(SYSDATE)
AND object_name = 'CHARACTERISTIC_A_T')
ORDER BY c.table_name,
c.column_id))
Similar Messages
-
Getting error while calling this BAPI:Field MATNR has been transferred inco
Hi,
I have a rquirement to upload material master data into sap for Plant 1251.(For plant 1251 we need to upload both Basi veiw and Extended View).
I am getting the following error while calling this BAPI.Field MATNR has been transferred inconsistently or is blank
the errror is :Field MATNR has been transferred inconsistently or is blank.
I have written the below logic in the program to upload material master data into SAP.
Please help me out to resolve this issue.
Thanks in advance.
Program logic which i have wriiten in the program is
LOOP AT it_rpt.
CLEAR lwa_return.
v_tabix = sy-tabix.
IF ( it_rpt-werks EQ p_werks AND
it_rpt-matnr IS INITIAL ).
retrieve internal number
PERFORM get_internal_number USING lc_mtart
lc_mbrsh
CHANGING it_rpt-matnr.
ENDIF.
IF NOT it_rpt-matnr IS INITIAL.
PERFORM convert_field_input CHANGING it_rpt-matnr.
ENDIF.
Header data
CLEAR lwa_headdata.
lwa_headdata-material = it_rpt-matnr.
lwa_headdata-ind_sector = lc_mbrsh.
lwa_headdata-matl_type = lc_mtart.
lwa_headdata-basic_view = 'X'.
IF NOT it_rpt-vkorg IS INITIAL.
lwa_headdata-sales_view = 'X'.
ENDIF.
lwa_headdata-purchase_view = 'X'.
lwa_headdata-mrp_view = 'X'.
lwa_headdata-storage_view = 'X'.
lwa_headdata-forecast_view = 'X'.
lwa_headdata-work_sched_view = 'X'.
lwa_headdata-account_view = 'X'.
lwa_headdata-cost_view = 'X'.
*Client data
CLEAR: lwa_clientdata, lwa_clientdatax.
IF it_rpt-werks EQ c_1251.
lwa_clientdata-matl_group = it_rpt-matkl.
lwa_clientdata-old_mat_no = it_rpt-bismt.
lwa_clientdata-base_uom = it_rpt-meins.
lwa_clientdata-manu_mat = it_rpt-mfrpn.
lwa_clientdata-mfr_no = it_rpt-mfrnr.
ENDIF.
lwa_clientdata-division = it_rpt-spart.
lwa_clientdata-unit_of_wt = lc_gewei.
lwa_clientdata-trans_grp = lc_tragr.
IF it_rpt-werks EQ c_1251.
lwa_clientdatax-matl_group = 'X'.
lwa_clientdatax-old_mat_no = 'X'.
lwa_clientdatax-base_uom = 'X'.
lwa_clientdatax-manu_mat = 'X'.
lwa_clientdatax-mfr_no = 'X'.
ENDIF.
lwa_clientdatax-unit_of_wt = 'X'.
lwa_clientdatax-trans_grp = 'X'.
lwa_clientdatax-division = 'X'.
Material Description
IF it_rpt-werks EQ c_1251.
lt_matdesc-langu = sy-langu.
lt_matdesc-matl_desc = it_rpt-maktx.
APPEND lt_matdesc.
ENDIF.
*Plant data
CLEAR lwa_plantdata.
lwa_plantdata-plant = it_rpt-werks.
lwa_plantdata-availcheck = lc_mtvfp.
lwa_plantdata-mrp_type = lc_dismm.
lwa_plantdata-mrp_group = lc_disgr.
lwa_plantdata-auto_p_ord = 'X'.
lwa_plantdata-proc_type = 'F'.
IF it_rpt-werks EQ c_1251.
it_rpt-prctr = lc_prctr. "1252
ELSEIF it_rpt-werks EQ c_1261.
it_rpt-prctr = lc_prctr1. "1262
ENDIF.
lwa_plantdata-profit_ctr = it_rpt-prctr.
lwa_plantdata-period_ind = lc_perkz.
lwa_plantdata-max_stock = it_rpt-stawn.
lwa_plantdata-countryori = it_rpt-herkl.
lwa_plantdata-sloc_exprc = it_rpt-lgfsb.
CLEAR lwa_plantdatax.
lwa_plantdatax-plant = it_rpt-werks.
lwa_plantdatax-availcheck = 'X'.
lwa_plantdatax-mrp_type = 'X'.
lwa_plantdatax-mrp_group = 'X'.
lwa_plantdatax-auto_p_ord = 'X'.
lwa_plantdatax-proc_type = 'X'.
lwa_plantdatax-profit_ctr = 'X'.
lwa_plantdata-period_ind = 'X'.
lwa_plantdatax-max_stock = 'X'.
lwa_plantdatax-countryori = 'X'.
lwa_plantdatax-sloc_exprc = 'X'.
*Valuation data
CLEAR lwa_valuationdata.
lwa_valuationdata-val_area = it_rpt-werks.
lwa_valuationdata-price_ctrl = lc_vprsv.
lwa_valuationdata-price_unit = lc_peinh.
lwa_valuationdata-val_class = it_rpt-bklas.
CLEAR lwa_valuationdatax.
lwa_valuationdatax-val_area = it_rpt-werks.
lwa_valuationdatax-price_ctrl = 'X'.
lwa_valuationdatax-price_unit = 'X'.
lwa_valuationdatax-val_class = 'X'.
*Storage location
CLEAR lwa_storagelocation.
lwa_storagelocation-plant = it_rpt-werks.
lwa_storagelocation-stge_loc = it_rpt-lgort.
CLEAR lwa_storagelocationx.
lwa_storagelocationx-plant = it_rpt-werks.
lwa_storagelocationx-stge_loc = it_rpt-lgort.
*Tax Classifications
IF it_rpt-werks EQ c_1251.
it_rpt-tatyp = lc_tatyp. "u2018MWSTu2019
ELSEIF it_rpt-werks EQ c_1261.
it_rpt-tatyp = lc_tatyp1. "u2018UTXJu2019
ENDIF.
lt_taxclass-tax_type_1 = it_rpt-tatyp.
lt_taxclass-taxclass_1 = lc_taxkm.
lt_taxclass-tax_ind = lc_taxim.
APPEND lt_taxclass.
*Sales data
CLEAR: lwa_salesdata, lwa_salesdatax.
IF it_rpt-werks EQ c_1251.
it_rpt-vkorg = lc_vkorg.
ELSEIF it_rpt-werks EQ c_1261.
it_rpt-vkorg = lc_vkorg1.
ENDIF.
lwa_salesdata-sales_org = it_rpt-vkorg.
lwa_salesdata-distr_chan = lc_vtweg.
lwa_salesdata-cash_disc = lc_sktof.
lwa_salesdata-item_cat = lc_mtpos.
lwa_salesdatax-sales_org = it_rpt-vkorg.
lwa_salesdatax-distr_chan = lc_vtweg.
lwa_salesdatax-cash_disc = 'X'.
lwa_salesdatax-item_cat = 'X'.
*Forecast parameters
CLEAR: lwa_forecast, lwa_forecastx.
lwa_forecast-plant = it_rpt-werks.
lwa_forecast-fore_model = lc_prmod.
lwa_forecast-fore_pds = lc_anzpr.
lwa_forecast-hist_vals = lc_peran.
lwa_forecastx-plant = it_rpt-werks.
lwa_forecastx-fore_model = 'X'.
lwa_forecastx-fore_pds = 'X'.
lwa_forecastx-hist_vals = 'X'.
Purchasing long text
IF it_rpt-werks EQ c_1251.
IF it_rpt-tdline1 <> ' '.
lv_tdobject = 'MATERIAL'.
lv_tdid = 'BEST'.
lv_tdname = it_rpt-matnr.
PERFORM fill_longtext TABLES lt_longtext
USING lv_tdobject
lv_tdname
lv_tdid
sy-langu
it_rpt-tdline1.
ENDIF.
Basic long text
IF it_rpt-tdline2 <> ' '.
lv_tdobject = 'MATERIAL'.
lv_tdid = 'GRUN'.
lv_tdname = it_rpt-matnr.
PERFORM fill_longtext TABLES lt_longtext
USING lv_tdobject
lv_tdname
lv_tdid
sy-langu
it_rpt-tdline2.
ENDIF.
*Units of measure
CLEAR : lt_uom,lt_uomx.
lt_uom-alt_unit = it_rpt-meins.
lt_uom-alt_unit_iso = it_rpt-meins.
lt_uom-unit_of_wt = it_rpt-gewei.
APPEND lt_uom.
lt_uomx-alt_unit = it_rpt-meins.
lt_uomx-alt_unit_iso = it_rpt-meins.
lt_uomx-unit_of_wt = 'X'.
APPEND lt_uomx.
ENDIF.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = lwa_headdata
clientdata = lwa_clientdata
clientdatax = lwa_clientdatax
plantdata = lwa_plantdata
plantdatax = lwa_plantdatax
forecastparameters = lwa_forecast
forecastparametersx = lwa_forecastx
storagelocationdata = lwa_storagelocation
storagelocationdatax = lwa_storagelocationx
valuationdata = lwa_valuationdata
valuationdatax = lwa_valuationdatax
salesdata = lwa_salesdata
salesdatax = lwa_salesdatax
IMPORTING
return = lwa_return
TABLES
materialdescription = lt_matdesc
unitsofmeasure = lt_uom
unitsofmeasurex = lt_uomx
materiallongtext = lt_longtext
taxclassifications = lt_taxclass
returnmessages = it_messages.
Regards,
ReddyCan you check with below code .
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = it_rpt-matnr
IMPORTING
OUTPUT = it_rpt-matnr
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Move it_rpt-matnr to lwa_headdata-material .
Regard's
Smruti -
Getting error while executing this select statement
Hi All,
I am new to this community.
I am getting error whie compiling the below code. Its telling 'Text' is invalid identifier. Also i want to know how can we obtain 'parseable' version of the below query?
my basic intention is to create a trigger header through a select statement and show it the complete text as a single column..
select text from
(select 'CREATE OR REPLACE TRIGGER '||SUBSTR(column_name,2,4)||'aud
AFTER INSERT
OR UPDATE
OF '||column_name||',
OR DELETE ON '||table_name||'
FOR EACH ROW'
FROM(SELECT lower(REPLACE(column_name,'O_','')) column_name , /*changing O to O_*/
lower(replace(t.table_name,'_A_','_')) table_name,
lower(t.table_name) table_name1,
c.column_id
FROM all_tab_columns c,
(SELECT object_name table_name
FROM all_objects
WHERE object_name LIKE '%/_A/_%' ESCAPE '/') t
WHERE c.table_name(+) = t.table_name
AND SUBSTR(column_name(+),1,2) = 'O_'))thanks prathamesh. it solved the problem. i have one more question.
as of now it creates single create trigger statement for each column on a table.
example:
CREATE OR REPLACE TRIGGER ust_aud
AFTER INSERT
OR UPDATE
OF cust_id,
OR DELETE ON characteristic_t
FOR EACH ROW
however, i want to create trigger for all columns in a single statement. can you please help me how to do it?
basically want to 'CREATE TRIGGER' for all columns in a table. i am finding difficult how to change my query to suit this!!
i am pasting my original query again for your reference. pls advise...
example:
CREATE OR REPLACE TRIGGER ust_aud
AFTER INSERT
OR UPDATE
OF cust_id,
fixed_item_val,
copy_item_val,
rgn_id,
txn_id,
OR DELETE ON characteristic_t
FOR EACH ROW
ORIGINAL QUERY
select text from
(select 'CREATE OR REPLACE TRIGGER '||SUBSTR(column_name,2,4)||'aud
AFTER INSERT
OR UPDATE
OF '||column_name||',
OR DELETE ON '||table_name||'
FOR EACH ROW' text
FROM(SELECT lower(REPLACE(column_name,'O_','')) column_name , /*changing O to O_*/
lower(replace(t.table_name,'_A_','_')) table_name,
lower(t.table_name) table_name1,
c.column_id
FROM all_tab_columns c,
(SELECT object_name table_name
FROM all_objects
WHERE object_name LIKE '%/_A/_%' ESCAPE '/') t
WHERE c.table_name(+) = t.table_name
AND SUBSTR(column_name(+),1,2) = 'O_')) -
Getting error while compiling frmcmp_batch batch file
HI
I am getting error while running frmcmp_batch commant
to create .fmx file
following is command that i am using
$ frmcmp_batch module=$AU_TOP/forms/US/DEMxxEOR.fmb userid=APPS/apps output_file=$PO/forms/US/DEMxxEOR.fmx module_type=form batch=no compile_all=specialfollowing is error that i am getting
Forms 10.1 (Form Compiler) Version 10.1.2.3.0 (Production)
Forms 10.1 (Form Compiler): Release - Production
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application >>Testing options
PL/SQL Version 10.1.0.5.0 (Production)
Oracle Procedure Builder V10.1.2.3.0 - Production
Oracle Virtual Graphics System Version 10.1.2.0.0 (Production)
Oracle Multimedia Version 10.1.2.0.2 (Production)
Oracle Tools Integration Version 10.1.2.0.2 (Production)
Oracle Tools Common Area Version 10.1.2.0.2
Oracle CORE 10.1.0.5.0 Production
FRM-18108: Failed to load the following objects.
Source Module:APPSTAND>> Source Object: STANDARD_PC_AND_VA
Source Module:APPSTAND>>Source Object: STANDARD_TOOLBAR
Source Module:APPSTAND>>Source Object: STANDARD_CALENDAR
Compiling package specification APP_CUSTOM...>> No compilation errors.
Compiling package specification APP_CUSTOM...>> No compilation errors.
Compiling package body APP_CUSTOM...
Compilation error on package body APP_CUSTOM:
PL/SQL ERROR 302 at line 22, column 19
component 'DISABLED' must be declared
PL/SQL ERROR 0 at line 22, column 5
Statement ignored
PL/SQL ERROR 201 at line 40, column 5
identifier 'APP_WINDOW.CLOSE_FIRST_WINDOW' must be declared
PL/SQL ERROR 0 at line 40, column 5
Statement ignored
Compilation errors have occurred.
Form not createdHi;
I am getting error while running frmcmp_batch commant
to create .fmx file
following is command that i am using
$ frmcmp_batch module=$AU_TOP/forms/US/DEMxxEOR.fmb userid=APPS/apps output_file=$PO/forms/US/DEMxxEOR.fmx module_type=form batch=no compile_all=special
Please try wiht below syntax
frmcmp_batch userid=apps/apps module=/u01/VIS/apps/apps_st/appl/au/12.0.0/forms/US/INVTTMTX.fmb output_file=/u01/VIS/apps/apps_st/appl/au/12.0.0/forms/US/INVTTMTX.fmx module_type=form batch=no compile_all=yes
Regard
Helios -
Got error while compiling this source code?
[code =java]package com.agent.client.movies;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
public interface DataSourceMovies extends Remote{
ArrayList<String[]> getAllMovies() throws RemoteException;
ArrayList<String[]> findMoviesByYear( int year) throws RemoteException;
ArrayList<String[]> findMoviesByDirector(String director) throws RemoteException;
ArrayList<String[]> findMoviesByGenre(String genre) throws RemoteException;
ArrayList<String[]> findMoviesByName(String name) throws RemoteException;
* To change this template, choose Tools | Templates
* and open the template in the editor.
* MovieClient.java
* Created on Apr 24, 2012, 10:49:58 AM
package com.agent.client.movies;
import com.agent.client.songs.SongsClient;
import com.agent.client.Utility;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import javax.naming.InitialContext;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class MovieClient extends javax.swing.JFrame {
ArrayList<String> mappedips = new ArrayList<String>();
DefaultListModel<String> modelmsg = new DefaultListModel<String>();
InitialContext ctx;
/** Creates new form MovieClient */
public MovieClient(String ips) {
setLookAndFeel();
initComponents();
Utility.setInCenter(this);
StringTokenizer stok = new StringTokenizer(ips, ":");
while(stok.hasMoreTokens())
mappedips.add(stok.nextToken());
public void setLookAndFeel(){
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//</editor-fold>
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
btclose = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
txtkey = new javax.swing.JTextField();
btsearch = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
rdbyname = new javax.swing.JRadioButton();
rdbydirector = new javax.swing.JRadioButton();
rdbygenre = new javax.swing.JRadioButton();
rdbyyear = new javax.swing.JRadioButton();
jPanel5 = new javax.swing.JPanel();
jPanel6 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
lstMessages = new javax.swing.JList(modelmsg);
jPanel7 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
tabmovies = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(500, 500));
jLabel1.setFont(new java.awt.Font("Simplified Arabic", 1, 24));
jLabel1.setForeground(new java.awt.Color(0, 102, 204));
jLabel1.setText("Mobile Agent: Find Movie Information");
jPanel1.add(jLabel1);
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);
btclose.setText("Close");
btclose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btcloseActionPerformed(evt);
jPanel2.add(btclose);
getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_END);
jPanel3.setLayout(new java.awt.BorderLayout());
jPanel4.setLayout(new java.awt.GridLayout(2, 1));
jLabel2.setText("Key");
btsearch.setText("Search");
btsearch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btsearchActionPerformed(evt);
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtkey, javax.swing.GroupLayout.PREFERRED_SIZE, 482, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btsearch)
.addContainerGap(130, Short.MAX_VALUE))
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtkey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btsearch))
.addContainerGap(13, Short.MAX_VALUE))
jPanel4.add(jPanel8);
buttonGroup1.add(rdbyname);
rdbyname.setSelected(true);
rdbyname.setText("By name");
buttonGroup1.add(rdbydirector);
rdbydirector.setText("By director");
buttonGroup1.add(rdbygenre);
rdbygenre.setText("By genre");
buttonGroup1.add(rdbyyear);
rdbyyear.setText("By year");
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addComponent(rdbyname)
.addGap(36, 36, 36)
.addComponent(rdbydirector)
.addGap(37, 37, 37)
.addComponent(rdbygenre)
.addGap(33, 33, 33)
.addComponent(rdbyyear)
.addContainerGap(352, Short.MAX_VALUE))
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(rdbyname)
.addComponent(rdbydirector)
.addComponent(rdbygenre)
.addComponent(rdbyyear))
.addContainerGap(20, Short.MAX_VALUE))
jPanel4.add(jPanel9);
jPanel3.add(jPanel4, java.awt.BorderLayout.PAGE_START);
jPanel5.setLayout(new java.awt.BorderLayout());
jPanel6.setLayout(new java.awt.BorderLayout());
lstMessages.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102)));
jScrollPane1.setViewportView(lstMessages);
jPanel6.add(jScrollPane1, java.awt.BorderLayout.CENTER);
jPanel5.add(jPanel6, java.awt.BorderLayout.PAGE_END);
jPanel7.setLayout(new java.awt.BorderLayout());
tabmovies.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
new String [] {
"Name", "Director", "Genre", "Release Year"
jScrollPane2.setViewportView(tabmovies);
jPanel7.add(jScrollPane2, java.awt.BorderLayout.CENTER);
jPanel5.add(jPanel7, java.awt.BorderLayout.CENTER);
jPanel3.add(jPanel5, java.awt.BorderLayout.CENTER);
getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btcloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btcloseActionPerformed
System.exit(0);
}//GEN-LAST:event_btcloseActionPerformed
private void btsearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btsearchActionPerformed
searchMovies();
}//GEN-LAST:event_btsearchActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btclose;
private javax.swing.JButton btsearch;
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JList lstMessages;
private javax.swing.JRadioButton rdbydirector;
private javax.swing.JRadioButton rdbygenre;
private javax.swing.JRadioButton rdbyname;
private javax.swing.JRadioButton rdbyyear;
private javax.swing.JTable tabmovies;
private javax.swing.JTextField txtkey;
// End of variables declaration//GEN-END:variables
private void searchMovies() {
if(txtkey.getText().trim().length()==0){
JOptionPane.showMessageDialog(null, "Please enter some words...");
return;
for(String ip : mappedips){
modelmsg.addElement("Looking up node : " + ip);
DataSourceMovies movies = null;
try {
ctx = new InitialContext();
movies = (DataSourceMovies)ctx.lookup("rmi://" + ip + "/movieserver");
} catch (Exception e) {
modelmsg.addElement("Error contacting node...");
e.printStackTrace();
break;
List<String[]> movieslist = null;
try{
if(rdbyname.isSelected())
movieslist = movies.findMoviesByName(txtkey.getText().trim());
else if(rdbydirector.isSelected())
movieslist = movies.findMoviesByDirector(txtkey.getText().trim());
else if(rdbygenre.isSelected())
movieslist = movies.findMoviesByGenre(txtkey.getText().trim());
else if(rdbyyear.isSelected()){
try {
movieslist = movies.findMoviesByYear(Integer.parseInt(txtkey.getText().trim()));
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Invalid year...");
return;
if(movieslist!=null && movieslist.size()>0){
modelmsg.addElement("Songs found...");
DefaultTableModel model = (DefaultTableModel) tabmovies.getModel();
while(model.getRowCount()>0){
model.removeRow(0);
tabmovies.revalidate();
for(String[] moviedata : movieslist)
model.addRow(moviedata);
catch(Exception ex) {
modelmsg.addElement("Error reading data...");
break;
* To change this template, choose Tools | Templates
* and open the template in the editor.
package com.agent.client.movies;
import com.agent.client.Utility;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.Socket;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JWindow;
import javax.swing.SwingConstants;
public class MovieSplashScreen {
private javax.swing.JLabel lbimage;
private javax.swing.JLabel lbloading;
private javax.swing.JLabel lbmobile;
private javax.swing.JPanel panelBack;
public static void main(String[] ar) {
new MovieSplashScreen().displaySplash(ar[0]);
public void displaySplash(String mapperip) {
JWindow window = new JWindow();
window.getContentPane().add(
new JLabel("Loading JFrame...", SwingConstants.CENTER));
window.setSize(525, 240);
Utility.setInCenter(window);
panelBack = new javax.swing.JPanel();
lbimage = new javax.swing.JLabel();
lbloading = new javax.swing.JLabel();
lbmobile = new javax.swing.JLabel();
panelBack.setBackground(new java.awt.Color(255, 255, 255));
panelBack.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 102), 2));
panelBack.setLayout(null);
lbimage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/agent/client/splash.jpg"))); // NOI18N
panelBack.add(lbimage);
lbimage.setBounds(250, 20, 250, 180);
lbloading.setFont(new java.awt.Font("Showcard Gothic", 0, 30)); // NOI18N
lbloading.setText("Loading...");
panelBack.add(lbloading);
lbloading.setBounds(50, 120, 210, 70);
lbmobile.setFont(new java.awt.Font("Tekton Pro Cond", 0, 24)); // NOI18N
lbmobile.setForeground(new java.awt.Color(0, 51, 51));
lbmobile.setText("Mobile Agents 1.0");
panelBack.add(lbmobile);
lbmobile.setBounds(30, 20, 230, 40);
window.add(panelBack, java.awt.BorderLayout.CENTER);
window.setVisible(true);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
Socket client = null;
try {
client = new Socket(mapperip,2222);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Mapping server down...");
System.exit(0);
DataInputStream din = null;
DataOutputStream dout = null;
String ips = null;
try {
din = new DataInputStream(client.getInputStream());
dout = new DataOutputStream(client.getOutputStream());
dout.writeUTF("movies");
ips = din.readUTF();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Cannot retrieve mappings...");
e.printStackTrace();
System.exit(0);
window.setVisible(false);
MovieClient sclient = new MovieClient(ips);
sclient.setVisible(true);
window.dispose();{code = java}package com.agent.client.movies;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
public interface DataSourceMovies extends Remote{
ArrayList<String[]> getAllMovies() throws RemoteException;
ArrayList<String[]> findMoviesByYear( int year) throws RemoteException;
ArrayList<String[]> findMoviesByDirector(String director) throws RemoteException;
ArrayList<String[]> findMoviesByGenre(String genre) throws RemoteException;
ArrayList<String[]> findMoviesByName(String name) throws RemoteException;
* To change this template, choose Tools | Templates
* and open the template in the editor.
* MovieClient.java
* Created on Apr 24, 2012, 10:49:58 AM
package com.agent.client.movies;
import com.agent.client.songs.SongsClient;
import com.agent.client.Utility;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import javax.naming.InitialContext;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class MovieClient extends javax.swing.JFrame {
ArrayList<String> mappedips = new ArrayList<String>();
DefaultListModel<String> modelmsg = new DefaultListModel<String>();
InitialContext ctx;
/** Creates new form MovieClient */
public MovieClient(String ips) {
setLookAndFeel();
initComponents();
Utility.setInCenter(this);
StringTokenizer stok = new StringTokenizer(ips, ":");
while(stok.hasMoreTokens())
mappedips.add(stok.nextToken());
public void setLookAndFeel(){
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SongsClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//</editor-fold>
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
btclose = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
txtkey = new javax.swing.JTextField();
btsearch = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
rdbyname = new javax.swing.JRadioButton();
rdbydirector = new javax.swing.JRadioButton();
rdbygenre = new javax.swing.JRadioButton();
rdbyyear = new javax.swing.JRadioButton();
jPanel5 = new javax.swing.JPanel();
jPanel6 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
lstMessages = new javax.swing.JList(modelmsg);
jPanel7 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
tabmovies = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(500, 500));
jLabel1.setFont(new java.awt.Font("Simplified Arabic", 1, 24));
jLabel1.setForeground(new java.awt.Color(0, 102, 204));
jLabel1.setText("Mobile Agent: Find Movie Information");
jPanel1.add(jLabel1);
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);
btclose.setText("Close");
btclose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btcloseActionPerformed(evt);
jPanel2.add(btclose);
getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_END);
jPanel3.setLayout(new java.awt.BorderLayout());
jPanel4.setLayout(new java.awt.GridLayout(2, 1));
jLabel2.setText("Key");
btsearch.setText("Search");
btsearch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btsearchActionPerformed(evt);
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtkey, javax.swing.GroupLayout.PREFERRED_SIZE, 482, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btsearch)
.addContainerGap(130, Short.MAX_VALUE))
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtkey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btsearch))
.addContainerGap(13, Short.MAX_VALUE))
jPanel4.add(jPanel8);
buttonGroup1.add(rdbyname);
rdbyname.setSelected(true);
rdbyname.setText("By name");
buttonGroup1.add(rdbydirector);
rdbydirector.setText("By director");
buttonGroup1.add(rdbygenre);
rdbygenre.setText("By genre");
buttonGroup1.add(rdbyyear);
rdbyyear.setText("By year");
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addComponent(rdbyname)
.addGap(36, 36, 36)
.addComponent(rdbydirector)
.addGap(37, 37, 37)
.addComponent(rdbygenre)
.addGap(33, 33, 33)
.addComponent(rdbyyear)
.addContainerGap(352, Short.MAX_VALUE))
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(rdbyname)
.addComponent(rdbydirector)
.addComponent(rdbygenre)
.addComponent(rdbyyear))
.addContainerGap(20, Short.MAX_VALUE))
jPanel4.add(jPanel9);
jPanel3.add(jPanel4, java.awt.BorderLayout.PAGE_START);
jPanel5.setLayout(new java.awt.BorderLayout());
jPanel6.setLayout(new java.awt.BorderLayout());
lstMessages.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102)));
jScrollPane1.setViewportView(lstMessages);
jPanel6.add(jScrollPane1, java.awt.BorderLayout.CENTER);
jPanel5.add(jPanel6, java.awt.BorderLayout.PAGE_END);
jPanel7.setLayout(new java.awt.BorderLayout());
tabmovies.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
new String [] {
"Name", "Director", "Genre", "Release Year"
jScrollPane2.setViewportView(tabmovies);
jPanel7.add(jScrollPane2, java.awt.BorderLayout.CENTER);
jPanel5.add(jPanel7, java.awt.BorderLayout.CENTER);
jPanel3.add(jPanel5, java.awt.BorderLayout.CENTER);
getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btcloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btcloseActionPerformed
System.exit(0);
}//GEN-LAST:event_btcloseActionPerformed
private void btsearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btsearchActionPerformed
searchMovies();
}//GEN-LAST:event_btsearchActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btclose;
private javax.swing.JButton btsearch;
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JList lstMessages;
private javax.swing.JRadioButton rdbydirector;
private javax.swing.JRadioButton rdbygenre;
private javax.swing.JRadioButton rdbyname;
private javax.swing.JRadioButton rdbyyear;
private javax.swing.JTable tabmovies;
private javax.swing.JTextField txtkey;
// End of variables declaration//GEN-END:variables
private void searchMovies() {
if(txtkey.getText().trim().length()==0){
JOptionPane.showMessageDialog(null, "Please enter some words...");
return;
for(String ip : mappedips){
modelmsg.addElement("Looking up node : " + ip);
DataSourceMovies movies = null;
try {
ctx = new InitialContext();
movies = (DataSourceMovies)ctx.lookup("rmi://" + ip + "/movieserver");
} catch (Exception e) {
modelmsg.addElement("Error contacting node...");
e.printStackTrace();
break;
List<String[]> movieslist = null;
try{
if(rdbyname.isSelected())
movieslist = movies.findMoviesByName(txtkey.getText().trim());
else if(rdbydirector.isSelected())
movieslist = movies.findMoviesByDirector(txtkey.getText().trim());
else if(rdbygenre.isSelected())
movieslist = movies.findMoviesByGenre(txtkey.getText().trim());
else if(rdbyyear.isSelected()){
try {
movieslist = movies.findMoviesByYear(Integer.parseInt(txtkey.getText().trim()));
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Invalid year...");
return;
if(movieslist!=null && movieslist.size()>0){
modelmsg.addElement("Songs found...");
DefaultTableModel model = (DefaultTableModel) tabmovies.getModel();
while(model.getRowCount()>0){
model.removeRow(0);
tabmovies.revalidate();
for(String[] moviedata : movieslist)
model.addRow(moviedata);
catch(Exception ex) {
modelmsg.addElement("Error reading data...");
break;
* To change this template, choose Tools | Templates
* and open the template in the editor.
package com.agent.client.movies;
import com.agent.client.Utility;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.Socket;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JWindow;
import javax.swing.SwingConstants;
public class MovieSplashScreen {
private javax.swing.JLabel lbimage;
private javax.swing.JLabel lbloading;
private javax.swing.JLabel lbmobile;
private javax.swing.JPanel panelBack;
public static void main(String[] ar) {
new MovieSplashScreen().displaySplash(ar[0]);
public void displaySplash(String mapperip) {
JWindow window = new JWindow();
window.getContentPane().add(
new JLabel("Loading JFrame...", SwingConstants.CENTER));
window.setSize(525, 240);
Utility.setInCenter(window);
panelBack = new javax.swing.JPanel();
lbimage = new javax.swing.JLabel();
lbloading = new javax.swing.JLabel();
lbmobile = new javax.swing.JLabel();
panelBack.setBackground(new java.awt.Color(255, 255, 255));
panelBack.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 102), 2));
panelBack.setLayout(null);
lbimage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/agent/client/splash.jpg"))); // NOI18N
panelBack.add(lbimage);
lbimage.setBounds(250, 20, 250, 180);
lbloading.setFont(new java.awt.Font("Showcard Gothic", 0, 30)); // NOI18N
lbloading.setText("Loading...");
panelBack.add(lbloading);
lbloading.setBounds(50, 120, 210, 70);
lbmobile.setFont(new java.awt.Font("Tekton Pro Cond", 0, 24)); // NOI18N
lbmobile.setForeground(new java.awt.Color(0, 51, 51));
lbmobile.setText("Mobile Agents 1.0");
panelBack.add(lbmobile);
lbmobile.setBounds(30, 20, 230, 40);
window.add(panelBack, java.awt.BorderLayout.CENTER);
window.setVisible(true);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
Socket client = null;
try {
client = new Socket(mapperip,2222);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Mapping server down...");
System.exit(0);
DataInputStream din = null;
DataOutputStream dout = null;
String ips = null;
try {
din = new DataInputStream(client.getInputStream());
dout = new DataOutputStream(client.getOutputStream());
dout.writeUTF("movies");
ips = din.readUTF();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Cannot retrieve mappings...");
e.printStackTrace();
System.exit(0);
window.setVisible(false);
MovieClient sclient = new MovieClient(ips);
sclient.setVisible(true);
window.dispose(); -
Error while compiling CS5.5 sample code
Hi,
I have just started on using InDesign CS5.5. I am trying to compile the sample code on Windows 7 and with Visual Studio 2008. On compilation it is giving me an error of SDKLib.sdk.lib
"LINK : fatal error LNK1181: cannot open input file '..\..\..\build\win\objr\SDKLib.sdk.lib'"
Have I missed some settings. I have set the Bin folder in the tools option. If anyone knows about this error please do let me know.
Thanks all in advance.
Regards,
Farzana.Hi to all again,
I just noticed that I don't have the SDKLib.sdk.lib file in the folder. Neither for Debug or for Release I have this file. Do I need to download this from somewhere??
Thanks in advance.
Regards
Farzana. -
Getting error while loading data from sql to ASO
Hi There,
we are working on ASO cube(Hyperion 9.3.0.1) and my data source is Oracle 10 g R2 while we are trying to load data or build dimension from sql, we are getting an error. Although, previously it was working properly. we are getting different error different time. I have updated essbase.cfg file for NETDELAY 800 & NETRETRYCOUNT 1000.I have changed panding cache size limit in my application from 48 to 96 also but still getting same error. Following are the errors
ERROR
Database IBasic loaded
Application IdeaBas2 loaded - connection established
Application [IdeaBas2] started with process id [10920]
Object [IBasic] is locked by user [dhanjit]
Cannot read SQL driver name for [Hyperion Client Sample] from [ODBC.INI]
Cannot read SQL driver name for [Hyperion BIplus Client Sample1] from [ODBC.INI]
Cannot read SQL driver name for [Hyperion BIplus Client Sample2] from [ODBC.INI]
Cannot read SQL driver name for [tmw2k_1] from [ODBC.INI]
Connection String is generated
Connection With SQL Database Server is Established
SQL Connection is Freed
Building Dimensions Elapsed Time : [10.641] seconds
Reading Parameters For Database [Drxxxxxx]
Declared Dimension Sizes = [109 165 15 80 1785 1938 1242 93 25 14 10 6 20 1502 21 5 211 2 ]
Actual Dimension Sizes = [108 158 15 78 1785 1938 1241 93 25 14 10 6 20 1502 21 5 211 1 ]
Network error [10054]: Cannot Send Data
Network error [10054]: Cannot Send Data
Unexpected Essbase error 1042012
Object [IBasic] unlocked by user [dhanjit]
regards,
DhanjitHi There,
we are working on ASO cube(Hyperion 9.3.0.1) and my data source is Oracle 10 g R2 while we are trying to load data or build dimension from sql, we are getting an error. Although, previously it was working properly. we are getting different error different time. I have updated essbase.cfg file for NETDELAY 800 & NETRETRYCOUNT 1000.I have changed panding cache size limit in my application from 48 to 96 also but still getting same error. Following are the errors
ERROR
Database IBasic loaded
Application IdeaBas2 loaded - connection established
Application [IdeaBas2] started with process id [10920]
Object [IBasic] is locked by user [dhanjit]
Cannot read SQL driver name for [Hyperion Client Sample] from [ODBC.INI]
Cannot read SQL driver name for [Hyperion BIplus Client Sample1] from [ODBC.INI]
Cannot read SQL driver name for [Hyperion BIplus Client Sample2] from [ODBC.INI]
Cannot read SQL driver name for [tmw2k_1] from [ODBC.INI]
Connection String is generated
Connection With SQL Database Server is Established
SQL Connection is Freed
Building Dimensions Elapsed Time : [10.641] seconds
Reading Parameters For Database [Drxxxxxx]
Declared Dimension Sizes = [109 165 15 80 1785 1938 1242 93 25 14 10 6 20 1502 21 5 211 2 ]
Actual Dimension Sizes = [108 158 15 78 1785 1938 1241 93 25 14 10 6 20 1502 21 5 211 1 ]
Network error [10054]: Cannot Send Data
Network error [10054]: Cannot Send Data
Unexpected Essbase error 1042012
Object [IBasic] unlocked by user [dhanjit]
regards,
Dhanjit -
Getting error while compiling The Dukes Bank Application
Hi,
I am trying to complies The Dukes Bank Application with reference to http://docs.jboss.org/jbossas/getting_started/v4/html/dukesbank.html guide.
I am getting the following error:
D:\Technical\Software\Tutorial\J2ee\Installation\J2ee-1_4\J2ee-1_4\j2ee-1_4-doc-tutorial_7\j2eetutorial14\jbossj2ee-src\examples\bank>ant -f jboss-build.xml c
pile
Buildfile: jboss-build.xml
prepare:
compile:
[javac] Compiling 5 source files to D:\Technical\Software\Tutorial\J2ee\Installation\J2ee-1_4\J2ee-1_4\j2ee-1_4-doc-tutorial_7\j2eetutorial14\jbossj2ee-sr
examples\bank\build
BUILD FAILED
D:\Technical\Software\Tutorial\J2ee\Installation\J2ee-1_4\J2ee-1_4\j2ee-1_4-doc-tutorial_7\j2eetutorial14\jbossj2ee-src\examples\bank\jboss-build.xml:44: D:\T
hnical\Software\Tutorial\J2ee\Installation\J2ee-1_4\J2ee-1_4\j2ee-1_4-doc-tutorial_7\j2eetutorial14\jbossj2ee-src\examples\bank\${jboss.server}\lib not found.
Total time: 0 seconds
D:\Technical\Software\Tutorial\J2ee\Installation\J2ee-1_4\J2ee-1_4\j2ee-1_4-doc-tutorial_7\j2eetutorial14\jbossj2ee-src\examples\bank>
Its not able to find ${jboss.server}\lib.
What is the solution for this compiling problem. Please help me.
Thanks in Advance.Hi,
This could also be a reason :
If you have any private proc defined in package body, make sure you define it at the top before using in other proc inside package body. -
Getting error while posting invoice in T-code F-02
Hello,
When i try to post invoice in T-code F-02 gives me the error message"There is no item category assigned to account bank a/c/company"
Can any one suggest me why this is error came up and how to resolve this.
Thanks,
LaviHi,
I think u have activated doc splitting i.e. new gl acconting. Go to
Financial Accounting (New) > General Ledger Accounting (New) > Business Transactions > Document Splitting > Classify G/L Accounts for Document Splitting
And make setting for u r account. Also see all the nodes there are configured, to avoid any other error.
Regards -
Getting Error while running this query
Hi,
SELECT SUM(BATCHWISE_COUNT) TOTALBATCHCOUNT,
TO_CHAR(SUM(BATCHWISEAMOUNT),'9,99,99,99,99,99,99,99,990.99') TOTALAMOUNT ,
SUM(SLIP_RECORDS) TOTALSLIPCOUNT,
SUM(CHEQUEONLY_RECORD) TOTALCHEQUECOUNT
from (SELECT COUNT(TI.FLDITEMINITIALID) BATCHWISE_COUNT from TBLITEMINITIAL TI),
(select SUM(IT.FLDAMOUNT)/100 BATCHWISEAMOUNT from TBLITEMINFOTRANS IT ),
(SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND TI.FLDITEMTYPE = 'P' AND TI.FLDCAPTURINGMODE = 'CP') SLIP_RECORDS,
(SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND FLDITEMTYPE = 'C' AND FLDCAPTURINGMODE = 'CO') CHEQUEONLY_RECORD
from TBLITEMINITIAL TI,
TBLITEMINFO II,
TBLITEMINFOTRANS IT
WHERE II.FLDITEMINITIALID = TI.FLDITEMINITIALID
AND II.FLDITEMID = IT.FLDITEMID
GROUP BY TRUNC(TI.FLDCAPTURINGDATE),TI.FLDBATCHNUMBER,TI.FLDCAPTURINGBRANCH,TI.FLDSCANNERID)
Im geeting error
ORA-00933: SQL command not properly ended
when running this query
I don't know what mistake i have done in this query , Kindly help for solving this issue
Thanks
Bala,
Edited by: 965937 on Feb 11, 2013 9:25 PMDear Friend
Try with the query below,
<<
SELECT SUM(BATCHWISE_COUNT) TOTALBATCHCOUNT,
TO_CHAR(SUM(BATCHWISEAMOUNT),'9,99,99,99,99,99,99,99,990.99') TOTALAMOUNT ,
SUM(SLIP_RECORDS) TOTALSLIPCOUNT,
SUM(CHEQUEONLY_RECORD) TOTALCHEQUECOUNT
from (SELECT COUNT(TI.FLDITEMINITIALID) BATCHWISE_COUNT from TBLITEMINITIAL TI),
(select SUM(IT.FLDAMOUNT)/100 BATCHWISEAMOUNT from TBLITEMINFOTRANS IT ),
(SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND TI.FLDITEMTYPE = 'P' AND TI.FLDCAPTURINGMODE = 'CP') SLIP_RECORDS,
(SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND FLDITEMTYPE = 'C' AND FLDCAPTURINGMODE = 'CO') CHEQUEONLY_RECORD
from TBLITEMINITIAL TI,
TBLITEMINFO II,
TBLITEMINFOTRANS IT
WHERE II.FLDITEMINITIALID = TI.FLDITEMINITIALID
AND II.FLDITEMID = IT.FLDITEMID
GROUP BY TRUNC(TI.FLDCAPTURINGDATE),TI.FLDBATCHNUMBER,TI.FLDCAPTURINGBRANCH,TI.FLDSCANNERID;
Regards
Ahamed Rafeeque Cherkala
Edited by: Ahamed Rafeeque on Feb 12, 2013 3:20 AM -
Error while compiling trigger/procedure for a table in which attribute is r
I have table
desc pappu
name varchar(10);
start varchar(5);
end varchar(5);
One of the attribute is end which is also a reserved keyword in oracle.I want to create some procedure/trigger which use the attribute end but i get errors while compiling that "
PLS-00103: Encountered the symbol "END" when expecting one of the
following:
<an identifier> <a double-quoted delimited-identifier>
The symbol "<an identifier> was inserted before "END" to
continue.
Any workaround for this.user620101 wrote:
name varchar(10);
start varchar(5);
end varchar(5);
SQL> create table pappu (name varchar(10),stat varchar(5),end varchar(5));hi,
earlier you have given column name start and here you are creating table with colum name stat....anyway try to use column alias for column END
CREATE TABLE pappu (NAME VARCHAR(10),STAT VARCHAR(5),END VARCHAR(5));
INSERT INTO PAPPU ( NAME, STAT, END ) VALUES ( 'name1', '1', '14');
INSERT INTO PAPPU ( NAME, STAT, END ) VALUES ( 'name2', '15', '20');
CREATE OR REPLACE PROCEDURE testpappu
AS
CURSOR test1
IS
SELECT NAME,stat AS st,END AS v_end FROM pappu;
BEGIN
FOR i IN test1
LOOP
DBMS_OUTPUT.PUT_LINE ( 'name - '||i.NAME ||'-'||i.st||'-'||i.v_end );
END LOOP;
END;
SQL> exec testpappu;
name - name1-1-14
name - name2-15-20
PL/SQL procedure successfully completed.
Thnx
MB
Edited by: ManishB on Sep 20, 2010 10:50 AM -
Exiting from sqlplus when there is any errors while compiling pl/sql progra
I am connecting to sqlplus from unix and I am executing a pl/sql script . Now if I get some error while compiling a procedure, package, function or any sql statement I want to exit sqlplus.
whenever sqlerror works only for sql statements but not for plsql
I dont want to query user_errors table and then throw some exception depending on the same .
Is there any command available or any easier way to solve this problem ?Those errors we get only when there is conflict in same etc.
Now consider the example here
sample.sql
whenever sqlerror exit failure ;
declare
s1 long;
begin
s1 := 'create or replace procedure proc1 as '||
'declare '||
'begin '||
'end; '||
'end;';
execute immediate s1;
end;
select 1 from dual;When I run the script
SQL> @sample.sql
ERROR:
ORA-24344: success with compilation error
ORA-06512: at line 9
Warning: PL/SQL compilation errors.
1
1Actually I want to get out before it executes select means once it throws error in pl/sql. -
Getting a bad bind variable error while compiling a custom form in R12
Hi,
I am getting a bad bind variable error while compiling a custom form.
I tried setting the forms_path variable and I am still getting the error. Can anyone please suggest what can be done?
DECLARE
BEGIN
IF :parameter.p_line_ship_to = 'T'
THEN
IF :SYSTEM.cursor_item = 'LINE.SHIP_TO'
THEN
:parameter.lov_num_param1 := :line.ship_to_customer_id;
oe_lines.ship_to ('WHEN-VALIDATE-ITEM');
:parameter.lov_num_param1 := :line.ship_to_customer_id;
END IF;
:parameter.p_line_ship_to := 'F';
END IF;
END;
I am getting this error:
Bad bind variable 'parameter.p_line_ship_to'The Parameter is not defined in the form.. But, this form is already been compiled and deployed.. I have to make some changes to the form and tried to compile it, when i am getting this error. Is it possible that the parameter would be defined in some other form or can this error be due to some other reasons?
Thanks in Advance. -
Getting error while installing sql server std 2008 R2 on win 7 prof. sp1 64bit
Hi,
I am getting error while installing sql server std 2008 R2 on win 7 prof. sp1 64bit. I have already tried all option but fail to installation
an error during the installation of assembly micro soft.vc80.crtHi,
I am getting error while installing sql server std 2008 R2 on win 7 prof. sp1 64bit. I have already tried all option but fail to installation
an error during the installation of assembly micro soft.vc80.crt
Can you please post summary.txt file here.Below link will help you in finding it.
http://technet.microsoft.com/en-us/library/ms143702(v=sql.105).aspx
Also with error you posted I guess it is a known issue .You need to install below package and then continue with fresh installation
http://www.microsoft.com/en-gb/download/details.aspx?id=15336
Please make sure before beginning fresh installation you make sure previous failed installation is removed completely.Use add remove program to remove failed SQL Server.If yu still face issue please post summary.txt file here
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Error while compiling apps code
HI,
I m getting error when compiling package in apps.My pkg is as such:
Create or replace package body pkg1 --specification is created
Is
Proc1 (p1 OUT number,P2 OUT Varchar2)
AS
Proc2 (p1 OUT number,P2 OUT Varchar2)
AS
Proc3 (retcode out number,errbuf out Varchar2)
--calling proc1 and proc2 here
proc1;
proc2;
End pkg1;
Getting error "Wrong number of argument passed to procedure".
So,plse tell me what to pass in Proc1,Proc2 within Proc3 as it will nt accept OUT parameter here.
I m calling package in this way (pkg1.Proc3) in apps.
Plse tell me abt this as i knw it is very basic.
Thnks,
KJYou are not passing the parameters to proc1 and 2 while calling. Try this
Create or replace package body pkg1 --specification is created
Is
Proc1 (p1 OUT number,P2 OUT Varchar2)
AS
Proc2 (p1 OUT number,P2 OUT Varchar2)
AS
Proc3 (retcode out number,errbuf out Varchar2)
AS
--calling proc1 and proc2 here
ln_retcode number := null;
lv_errbuf varchar2(2000) := null;
begin
proc1(ln_retcode,lv_errbuf);
ln_retcode := null;
lv_errbuf := null;
proc2(ln_retcode,lv_errbuf);
END Proc3;
End pkg1;
Thanks
Shree
Maybe you are looking for
-
Portege M200 - Cannot access recovery console
Hi, Yesterday my anti-virus software let me know a virus was trying to access my computer, had quarantined it and asked for a reboot of my Portege M200 to remove it completely. On rebooting, the notebook did not actually reboot and just hung. It gets
-
We are looking at implementing PA for 11.0 or 11i; Looking through the documentation I have been unable to locate how sales tax is handled in PA and if you can still use Vertex to calculate tax rates and exceptions?? Is there anybody who has dealt wi
-
875P Neo with new Corecell DOT???
I happened to see the new MSI875P NEO with a sticker with MSI new CoreCell chip with D.O.T (Dynamic Overclocking Technology). Can this be done with the BIOS?
-
How to prepare for DBA Interview
Dear All, Sorry for posting this thread. But i need your suggestions to improve my skills. So kindly give me your suggestions and tips. What are the mail things i have to prepare. Thanks in advance. Moorthy.GS
-
Bapi - upload data for infotypes 0016 and 0019
hello, Please let me know bapi to upload data for infotypes 0016 and 0019 as i am unable to find any bapi for this infotypes. Please use a more meaningful subject in future - I've edited it for you this time. Edited by: Matt on Nov 6, 2008 12:08 PM