Trouble compiling packages
I have classes written and would like to package them. I thought that I did it right, but then when I used the import statement in a program the error was that the package did not exist. Could someone give me the steps in getting it right. Thank you
This might help you.
http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
Similar Messages
-
Trouble compiling package with JDK 1.4
Hi,
I just installed JDK 1.4 on a new machine, now I have trouble running compile scripts that used to work on my old machine. The old an new are configured with Win 2000. The following compiles without problem:
javac -classpath "..." -d "..." "c:\.....\com\...\some package\MyClass.java"
Changing this statemetn to:
javac -classpath "..." -d "..." "c:\.....\com\...\some package\*.java"
should compile all Java files in 'some package', instead what I get is the following error message:
error: cannot read: c:\.....\com\...\some package\*.java
The documentation says that this should still work. Anyone aware of changes in 1.4 that could cause this problem?
Thanks for respondingAs a work-around, you can use some Unix-styled shell (that is, command processor) which expands the *.expression into the list of the matching file names, thus releaving javac from this task. (Caveat: directory names with a space inside will cause problems.)
I can recommend the Cygnus package (including the command processor "bash") or "MinGW", the Minimalist GNU For Windows with its simpler sh:
http://www.mingw.org/
ftp://ftp.franken.de/pub/win32/develop/gnuwin32/mingw32/porters/Mikey/ -
Execution of Immediate SQL in compiled package in two versions of SQL*PLUS
A peculiar problem has risen in our database.
Execution of Immediate SQL in compiled package in two versions of SQLPLUS gives different results
We have a compiled package with two procedures that contain immediate SQL statements, and these are:
+PROC_DELETE_ROWS+
+ -- This immediate sql deletes unreferenced Document Types from the DOC_REF_TYPE table+
+ delete from doc_ref_type t where exists (select 1 from PROARC_DOC_REF_TYPE_VW d where d.doc_ref_type = t.doc_ref_type)+
+ and not exists (select 1 from doc_ref d where d.doc_ref_type = t.doc_ref_type)+
+ and doc_ref_type not in (select doc_ref_type from eis_doc_ref_type)+
+ and doc_ref_type not in (select eis_doc_ref_type from eis_doc_ref_type)+
+PROC_ADD_NEW_ROWS+
+ -- Drop the temporary table+
+ drop table TMP_PROARC_DOC_REF_TYPE+
+ -- Create a temporary table+
+ create table tmp_PROARC_DOC_REF_TYPE as+
+ select DOC_REF_TYPE, substr(DOC_REF_TYPE_DESC,1,100) as DOC_REF_TYPE_DESC+
+ from PROARC_DOC_REF_TYPE_VW+
+ -- Insert document types that do not exist in the DOC_REF_TYPE table+
+ insert into doc_ref_type t (DOC_REF_TYPE, DOC_REF_TYPE_DESC)+
+ select distinct DOC_REF_TYPE, DOC_REF_TYPE_DESC from tmp_PROARC_DOC_REF_TYPE s+
+ where not exists (select 1 from doc_ref_type t where t.doc_ref_type = s.doc_ref_type)+
I am using the following test script:
+Exec mypackage.proc_delete_rows;+
+Commit;+
+Select count(*) from DOC_REF_TYPES;+
+Exec mypackage.proc_add_new_rows;+
+Commit;+
+Select count(*) from DOC_REF_TYPES;+We have a Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
I am using SQL*Plus: Release 8.1.7.0.0
The test script is working as expected.
Count after delete =155
Count after insert = 511
but when I use another computer with SQL*Plus: Release 10.x
The Test script returns the following
Count after delete =155
Count after insert =155
The same is happening when I am running the scripts as a scheduled job.
QUESTION:
I believe I have found a fix for the problem though. By changing tmp_PROARC_DOC_REF_TYPE in the insert statement to all upper case, the script is running in both environments apparently. But how is this possible? I am executing a compiled package in the database. The session shell should have no impact on the behaveour of the procedure I am calling. What causes this?
Edited by: Reon on Jun 16, 2011 4:44 AM1) I am using the same user (PANDORA)
2) (PANDORA) for both
3) I am actually not handling any errors. Just skipping any error altogether. I'll check to see what exceptions are raised, and come back.
I have also noticed that SQL/PLUS is not the culprit here. If I use SQLTools 1.5 to run the script, the same thing happens. So it has to do something with the connection or session environment that is inheritet to both clients.
The CODEZ:_
procedure add_doc_types IS
sqlstr VARCHAR2(2000);
begin
BEGIN
sqlstr := 'drop table TMP_PROARC_DOC_REF_TYPE';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
END;
BEGIN
sqlstr := 'create table tmp_PROARC_DOC_REF_TYPE as select DOC_REF_TYPE, substr(DOC_REF_TYPE_DESC,1,100) as DOC_REF_TYPE_DESC from PROARC_DOC_REF_TYPE_VW';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
END;
BEGIN
sqlstr := 'insert into doc_ref_type t (DOC_REF_TYPE, DOC_REF_TYPE_DESC)
select distinct DOC_REF_TYPE, DOC_REF_TYPE_DESC from TMP_PROARC_DOC_REF_TYPE s
where not exists (select 1 from doc_ref_type t where t.doc_ref_type = s.doc_ref_type)';
EXECUTE IMMEDIATE sqlstr;
sqlstr := 'update doc_ref_type t set DOC_REF_TYPE_DESC = (
select DOC_REF_TYPE_DESC from tmp_PROARC_DOC_REF_TYPE s
where t.doc_ref_type = s.doc_ref_type)
where exists (select 1 from tmp_PROARC_DOC_REF_TYPE s where t.doc_ref_type = s.doc_ref_type)';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
END;
end add_doc_types;
procedure delete_doc_types IS
sqlstr VARCHAR2(2000);
BEGIN
sqlstr := 'delete from doc_ref_type t where exists (select 1 from PROARC_DOC_REF_TYPE_VW d where d.doc_ref_type = t.doc_ref_type)
and not exists (select 1 from doc_ref d where d.doc_ref_type = t.doc_ref_type)
and doc_ref_type not in (select doc_ref_type from eis_doc_ref_type)
and doc_ref_type not in (select eis_doc_ref_type from eis_doc_ref_type)';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
end delete_doc_types;Edited by: Reon on Jun 16, 2011 2:01 AM -
Trouble Compiling my Email-client
Hi
I have written this email -client, but have some trouble compiling it !
Then I try to compile it the following errors:
MailClient.java:350: <identifier> expected
public syncronize void mails(String t){
^
MailClient.java:727: ';' expected
private class myWindowListener extends WindowAdapter{
^
MailClient.java:747: '}' expected
3 errors.
What do I need to change to correct these errors ?
I hope that there is somebody out there who can help me get my program to work.
Thanks in advance.
Sincrely Yours
Fred
import java.io.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
public class MailClient extends JFrame implements ActionListener{
private Sendman mySendman;
private Letterman myLetterman;
public Writer myWrite;
public Reader myReader;
public Composer myComposer;
private Setup mySetup;
public Addressbook myAdressbook;
private FixTask myFixTask;
private Filter myFilter;
private Info myInfo;
public Vector mailIndexVector = new Vector();
public Vector filterIndexVector = new Vector();
public Vector folderVector = new Vector();
private JPanel tArea, trae, icon, tField;
private JTextArea ta;
private JScrollPane view, treeScroll;
private JTree tree;
public JTextField tf;
private JSplitPane split;
private Dimension Size;
private MailClient myMailClient;
private String mailBody, subject, from;
public boolean fromOutbox = false;
public boolean viewSource = false;
public static void main (String[] args) {
MailClient myMailClient = new MailClient();
public MailClient() {
super("Mail-Client");
ImageIcon linux = new ImageIcon("linux.gif");
this.setIconImage(linux.getImage());
icon = new JPanel();
icon.setLayout(new FlowLayout(FlowLayout.LEFT));
ImageIcon neu = new ImageIcon("getmail.gif");
JButton neueMails = new JButton(neu);
newMails.setActionCommand("Getting new Mails");
newMails.addActionListener(this);
newMails.setBorderPainted(false);
newMails.setToolTipText("Getting new Mails");
ImageIcon cr = new ImageIcon("creator.gif");
JButton creator = new JButton(cr);
creator.setActionCommand("Creator open");
creator.addActionListener(this);
creator.setBorderPainted(false);
creator.setToolTipText("Creator open");
JButton rep = new JButton(new ImageIcon("reply.gif"));
rep.setActionCommand("rep");
rep.addActionListener(this);
rep.setBorderPainted(false);
rep.setToolTipText("Reply");
JButton fwd = new JButton(new ImageIcon("fwd.gif"));
fwd.setActionCommand("fwd");
fwd.addActionListener(this);
fwd.setBorderPainted(false);
fwd.setToolTipText("Forward");
JButton ein = new JButton(new ImageIcon("settings.gif"));
ein.setActionCommand("settings open");
ein.addActionListener(this);
ein.setBorderPainted(false);
ein.setToolTipText("Setting open");
JButton adr = new JButton(new ImageIcon("adressbook.gif"));
adr.setActionCommand("adr");
adr.addActionListener(this);
adr.setBorderPainted(false);
adr.setToolTipText("Addressbook");
JButton lo = new JButton(new ImageIcon("trash.gif"));
lo.setActionCommand("trash");
lo.addActionListener(this);
lo.setBorderPainted(false);
lo.setToolTipText("trash");
JButton in = new JButton(new ImageIcon("info.gif"));
in.setActionCommand("Information");
in.addActionListener(this);
in.setBorderPainted(false);
in.setToolTipText("Information");
icon.add(newMails);
icon.add(creator);
icon.add(rep);
icon.add(fwd);
icon.add(set);
icon.add(adr);
icon.add(lo);
icon.add(in);
Vector h1 = myLeser.lese("Summary.4on");
for(int i=0; i<h1.size(); i+=7){
String id = h1.elementAt(i).toString();
String fo = h1.elementAt(i+1).toString();
String su = h1.elementAt(i+2).toString();
String fr = h1.elementAt(i+3).toString();
String to = h1.elementAt(i+4).toString();
String da = h1.elementAt(i+5).toString();
String re = h1.elementAt(i+6).toString();
MailIndex index = new MailIndex(id, fo, su, fr, to, da, re);
mailIndexVector.addElement(index);
Vector h2 = myReader.read("Filter.4on");
for(int j=0; j<h2.size(); j+=3){
String fo = h2.elementAt(j).toString();
String from = h2.elementAt(j+1).toString();
String te = h2.elementAt(j+2).toString();
FilterIndex index = new FilterIndex(fo, from, te);
filterIndexVector.addElement(index);
folderVector = myReader.read("Folder.4on");
DefaultMutableTreeNode top, inbox, outbox, sentbox, trash;
top = new DefaultMutableTreeNode("mails");
top.add(inbox = new DefaultMutableTreeNode("Inbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Inbox"))
inbox.add(new DefaultMutableTreeNode(m));
top.add(outbox = new DefaultMutableTreeNode("Outbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Outbox")){
outbox.add(new DefaultMutableTreeNode(m));
top.add(sentbox = new DefaultMutableTreeNode("Sentbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Sentbox"))
sentbox.add(new DefaultMutableTreeNode(m));
for(int j=0; j<folderVector.size(); j++){
top.add(trash =
new DefaultMutableTreeNode(folderVector.elementAt(j).toString()));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals(folderVector.elementAt(j).toString()))
trash.add(new DefaultMutableTreeNode(m));
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode
(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(new myTreeSelectionListener());
treeScroll = new JScrollPane(tree);
treeScroll.setFont(new Font("Monospaced",Font.PLAIN,6));
baum.add("Center", treeScroll);
MainMenu menuBar = new MainMenu(this, this);
setJMenuBar(menuBar);
setVisible(true);
public void mailsFetcher() {
myLetterman = new Letterman(this, mySetup);
myLetterman.start();
public void treeNewSign(){
trae.remove(treeScroll);
DefaultMutableTreeNode top, inbox, outbox, sentbox, trash;
top = new DefaultMutableTreeNode("mails");
top.add(inbox = new DefaultMutableTreeNode("Inbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Inbox"))
inbox.add(new DefaultMutableTreeNode(m));
top.add(outbox = new DefaultMutableTreeNode("Outbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Outbox"))
outbox.add(new DefaultMutableTreeNode(m));
top.add(sentbox = new DefaultMutableTreeNode("Sentbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Sentbox"))
sentbox.add(new DefaultMutableTreeNode(m));
for(int j=0; j<folderVector.size(); j++){
top.add(trash =
new DefaultMutableTreeNode(folderVector.elementAt(j).toString()));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals(folderVector.elementAt(j).toString()))
trash.add(new DefaultMutableTreeNode(m));
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode
(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(new myTreeSelectionListener());
treeScroll = new JScrollPane(tree);
trae.add("Center", treeScroll);
trae.repaint();
setVisible(true);
public void menuNewSign(){
setJMenuBar(new MainMenu(this, this));
setVisible(true);
public String fromFilter (String t){
String myFrom = "";
int start, end;
int a = t.indexOf("From:");
if (a != -1){
start = a + 6;
ende = t.indexOf("\n",start);
myFrom = t.substring(start,end);
return myFrom;
public String toFilter (String t){
String myTo = "";
int start, e1, e2, end;
int a = t.indexOf("To:");
if (a != -1){
start = a + 4;
end = t.indexOf("\n",start);
myTo = t.substring(start,end);
e1 = end + 1;
if(t.substring(e1,e1+1).equals(" ")){
while(t.substring(e1,e1+1).equals(" ")){
while(t.substring(e1,e1+1).equals(" "))
e1++;
e2 = t.indexOf("\n",e1);
myTo += " " + t.substring(e1,e2);
e1 = e2 + 1;
return myTo;
public String dateFilter (String t){
String myDate = "";
int start, end;
int a = t.indexOf("Date:");
if (a != -1){
start = a + 6;
end = t.indexOf("\n",start);
myDate = t.substring(start,end);
return myDate;
public String subjectFilter (String t){
String mySubject = "";
int start, end;
int a = t.indexOf("Subject:");
if (a != -1){
start = a + 9;
end = t.indexOf("\n",start);
mySubject = t.substring(start,end);
return mySubject;
public String mailFilter (String t){
String myMail = "";
int start = 0, end = t.length();
start = t.indexOf("\n\n") + 2;
if (start != 1){
int a = t.indexOf("\n\n" ,start);
if (a != -1){
if (t.indexOf(".",a+2) == a+2)
if (t.indexOf("\n",a+3) == a+3)
start = a;
myMail = t.substring(start,end);
return myMail;
public void mailsRemark(String file){
String mail = "", t = "";
Vector mailVector = myReader.read(file);
for (int i=0; i<mailVector.size(); i++)
t += (String)mailVector.elementAt(i) + "\n";
from = fromFilter(t);
subject = subjectFilter(t);
mailBody = mailFilter(t);
mail += "Subject: " + subject + "\n";
mail += "Date: " + dateFilter(t) + "\n";
mail += "From: " + from + "\n";
mail += "To: " + toFilter(t) + "\n";
mail += "\n" + mailBody;
if(viewSource == true)
ta.setText(t);
else
ta.setText(mail);
public syncronize void mails(String t){
Status myStatus = new Status(this,t);
myStatus.start();
public void delete(){
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
if(node.isLeaf()){
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailIndexVector.removeElement(index);
int count = 0;
for(int j=0; j<mailIndexVector.size(); j++){
MailIndex index1 = (MailIndex)mailIndexVector.elementAt(j);
String id = index1.mailId;
if(id.equals(index.mailId))
count++;
if(count == 0){
File home = new File(".");
String mailsRemark = "." + home.separator + "data";
File datei = new File(mailsRemark, index.mailId);
datei.delete();
treeNewSign();
menuNewSign();
else{
String t = (String)nodeInfo;
boolean toDelete = false;
for (int i=0; i<folderVector.size(); i++){
if(folderVector.elementAt(i).equals(t)){
folderVector.removeElement(t);
konnteLoeschen = true;
if(toDelete == false){
message("This folder can not be deleted!");
treeNewSign();
else
message("Folder is not Empty! Please delete Your mails.");
else
message("No Mails where selected to be deleted!");
public void forward(){
if(from != null){
creatorOeffnen();
myCreator.tfSb.setText("Fwd to: " + subject);
myCreator.ta.setText("<" + from + ">" + " wrote:\n\n" + mailBody +
"\n\n>\n>\n\n");
public void reply(){
if(from != null){
creatorOeffnen();
myCreator.tfTo.setText(from);
myCreator.tfSb.setText("Reply to: " + subject);
myCreator.ta.setText("<" + from + ">" + " wrote:\n\n" + mailBody +
"\n\n>\n>\n\n");
public void end(){
String h = "";
for (int i=0; i<mailIndexVector.size(); i++){
MailIndex index = (MailIndex)mailIndexVector.elementAt(i);
h += index.mailId + "\n";
h += index.folder + "\n";
h += index.subject + "\n";
h += index.from + "\n";
h += index.to + "\n";
h += index.date + "\n";
h += index.read + "\n";
myWriter.writer(h,"Summary.4on");
String w = "";
for (int l=0; l<filterIndexVector.size(); l++){
FilterIndex index = (FilterIndex)filterIndexVector.elementAt(l);
w += index.folder + "\n";
w += index.from + "\n";
w += index.text + "\n";
myWriter.write(w,"Filter.4on");
String k = "";
for(int j=0; j<folderVector.size(); j++)
k += folderVector.elementAt(j).toString() + "\n";
myWriter.writer(k,"Folder.4on");
String t = "";
for (int l=0; l<myAddressBook.addressIndexVector.size(); l++){
AddressIndex aindex =
(AddressIndex)myAdressBook.adressIndexVector.elementAt(l);
t += aindex.alias + "\n";
t += aindex.email + "\n";
myWriter.write(t,"Address.4on");
setVisible(false);
dispose();
System.exit(0);
public void filterOpen(){
boolean test = false;
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof String){
myFilter.folder = (String)nodeInfo;
for(int i=0; i<filterIndexVector.size(); i++){
FilterIndex h = (FilterIndex)filterIndexVector.elementAt(i);
if(h.folder.equals(nodeInfo)){
myFilter.index = h;
test = true;
if(h.from.equals("")){
myFilter.box1 = false;
myFilter.fTf.setText("");
myFilter.fBox.setSelected(false);
myFilter.fTf.setEditable(false);
else{
myFilter.box1 = true;
myFilter.fTf.setText(h.from);
myFilter.fBox.setSelected(true);
myFilter.fTf.setEditable(true);
if(h.text.equals("")){
myFilter.box2 = false;
myFilter.tTf.setText("");
myFilter.tBox.setSelected(false);
myFilter.tTf.setEditable(false);
else{
myFilter.box2 = true;
myFilter.tTf.setText(h.text);
myFilter.tBox.setSelected(true);
myFilter.tTf.setEditable(true);
break;
myFilter.setVisible(true);
myFilter.fBox.requestFocus();
else
meldung("No selection");
public void sendOutbox(){
fromOutbox = true;
int i;
Block1:
for(i=0; i<mailIndexVector.size(); i++){
MailIndex index = (MailIndex)mailIndexVector.elementAt(i);
if(index.folder.equals("Outbox")){
Vector mailVector = myReader.read(index.mailId);
Block2:
for(int j=0; j<mailVector.size(); j++){
String m = (String)mailVector.elementAt(j);
if(m.indexOf("Subject:") != -1){
for(int k=0; k<=j+1; k++){
mailVector.removeElementAt(0);
break Block2;
Vector toVector = new Vector();
int tEnd = 1;
String line = "";
String t = index.to;
while (tEnd != -1){
tEnd = t.indexOf(", ");
if (tEnd == -1)
line = t;
else
line = t.substring(0,tEnd);
t = t.substring(tEnd + 1);
toVector.addElement(line);
File home = new File(".");
String mailsVerzeichnis = "." + home.separator + "data";
File datei = new File(mailsRemark, index.mailId);
datei.delete();
mySendman = new Sendman(mailVector, toVector, index.subject,
ailsAnzeig mySetup, this);
mySendman.start();
mailIndexVector.removeElement(index);
break Block1;
if(i == mailIndexVector.size())
fromOutbox = false;
treeNewSign();
public void partion(String cmd){
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
index.folder = cmd.substring(13).toString();
treeNewSign();
else
meldung("No mails to partion!");
public void SetupOpen(){
if (mySetup.savePassword == false)
mySetup.pTf.setText("");
mySetup.setVisible(true);
mySetup.aTf.requestFocus();
public void addressbookOpen(){
myAddressBook.setVisible(true);
myAdressBook.tree.requestFocus();
public void creatorOpen(){
myCreator.setVisible(true);
myCreator.tfTo.requestFocus();
public void actionPerformed(ActionEvent event){
Object obj = event.getSource();
if (obj instanceof JMenuItem){
String cmd = event.getActionCommand();
if (cmd.equals("New fetched")){
mailsfetch();
else if (cmd.equals("Written new mails")) {
creatorOpen();
else if (cmd.equals("Reply")) {
reply();
else if (cmd.equals("Forward")) {
forward();
else if (cmd.equals("Outbox")) {
sendOutbox();
else if (cmd.equals("Delete")) {
delete();
else if ((cmd.length() >13) &&
(cmd.substring(0,13).equals("Sorting-"))){
sorting(cmd);
else if (cmd.equals("Using Addressbook")){
addressbookOpen();
else if (cmd.equals("Filter working")){
filterOpen();
else if (cmd.equals("New Order")){
myFixTask.tf.setText("");
myFixTask.setVisible(true);
myFixTask.tf.requestFocus();
else if (cmd.equals("delete")){
delete();
else if ((cmd.length() >7) &&
(cmd.substring(0,7).equals("nobody"))){
if(viewSource == false){
viewSource = true;
menuNewSign();
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailsRemark(index.mailId);
else{
viewSource = false;
menuNeuZeichnen();
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailsRemark(index.mailId);
else if (cmd.equals("Setup")){
SetupOpen();
else if (obj instanceof JButton){
String cmd = event.getActionCommand();
if (cmd.equals("aga")){
mailsHolen();
else if (cmd.equals("Creator Open")){
creatorOpem();
else if(cmd.equals("rep")){
reply();
else if(cmd.equals("fwd")){
forward();
else if(cmd.equals("Setup Open")){
SetupOpen();
else if(cmd.equals("adr")){
addressbookOpen();
else if(cmd.equals("delete")){
delete();
else if(cmd.equals("Information")){
myInfo.setVisible(true);
myInfo.b.requestFocus();
private class myWindowListener extends WindowAdapter{
public void windowClosing(WindowEvent event){
end();
private class myTreeSelectionListener implements TreeSelectionListener{
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)(e.getPath().getLastPathComponent());
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailsAnzeigen(index.mailId);
index.read = "Yes";Some suggestions:
1. as the others stated- you should really post specific questions rather than 1 huge ugly class!
2. use code tags
3. get a decent IDE- it would take about 1 minute to then see where the error is-
4. the rrors were just misspelled 'synchronized' and missing argument ','
5. Try not to make such huge classes!!- Try to follow certain coding "patterns"- like MVC- and not stick everything in 1 class- separate the functionality- it makes coding much easier!
here is fixed code (at least gets rid of those last errors):
import java.io.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
public class MailClient extends JFrame implements ActionListener{
private Sendman mySendman;
private Letterman myLetterman;
public Writer myWrite;
public Reader myReader;
public Composer myComposer;
private Setup mySetup;
public Addressbook myAdressbook;
private FixTask myFixTask;
private Filter myFilter;
private Info myInfo;
public Vector mailIndexVector = new Vector();
public Vector filterIndexVector = new Vector();
public Vector folderVector = new Vector();
private JPanel tArea, trae, icon, tField;
private JTextArea ta;
private JScrollPane view, treeScroll;
private JTree tree;
public JTextField tf;
private JSplitPane split;
private Dimension Size;
private MailClient myMailClient;
private String mailBody, subject, from;
public boolean fromOutbox = false;
public boolean viewSource = false;
public static void main (String[] args) {
MailClient myMailClient = new MailClient();
public MailClient() {
super("Mail-Client");
ImageIcon linux = new ImageIcon("linux.gif");
this.setIconImage(linux.getImage());
icon = new JPanel();
icon.setLayout(new FlowLayout(FlowLayout.LEFT));
ImageIcon neu = new ImageIcon("getmail.gif");
JButton neueMails = new JButton(neu);
newMails.setActionCommand("Getting new Mails");
newMails.addActionListener(this);
newMails.setBorderPainted(false);
newMails.setToolTipText("Getting new Mails");
ImageIcon cr = new ImageIcon("creator.gif");
JButton creator = new JButton(cr);
creator.setActionCommand("Creator open");
creator.addActionListener(this);
creator.setBorderPainted(false);
creator.setToolTipText("Creator open");
JButton rep = new JButton(new ImageIcon("reply.gif"));
rep.setActionCommand("rep");
rep.addActionListener(this);
rep.setBorderPainted(false);
rep.setToolTipText("Reply");
JButton fwd = new JButton(new ImageIcon("fwd.gif"));
fwd.setActionCommand("fwd");
fwd.addActionListener(this);
fwd.setBorderPainted(false);
fwd.setToolTipText("Forward");
JButton ein = new JButton(new ImageIcon("settings.gif"));
ein.setActionCommand("settings open");
ein.addActionListener(this);
ein.setBorderPainted(false);
ein.setToolTipText("Setting open");
JButton adr = new JButton(new ImageIcon("adressbook.gif"));
adr.setActionCommand("adr");
adr.addActionListener(this);
adr.setBorderPainted(false);
adr.setToolTipText("Addressbook");
JButton lo = new JButton(new ImageIcon("trash.gif"));
lo.setActionCommand("trash");
lo.addActionListener(this);
lo.setBorderPainted(false);
lo.setToolTipText("trash");
JButton in = new JButton(new ImageIcon("info.gif"));
in.setActionCommand("Information");
in.addActionListener(this);
in.setBorderPainted(false);
in.setToolTipText("Information");
icon.add(newMails);
icon.add(creator);
icon.add(rep);
icon.add(fwd);
icon.add(set);
icon.add(adr);
icon.add(lo);
icon.add(in);
Vector h1 = myLeser.lese("Summary.4on");
for(int i=0; i<h1.size(); i+=7){
String id = h1.elementAt(i).toString();
String fo = h1.elementAt(i+1).toString();
String su = h1.elementAt(i+2).toString();
String fr = h1.elementAt(i+3).toString();
String to = h1.elementAt(i+4).toString();
String da = h1.elementAt(i+5).toString();
String re = h1.elementAt(i+6).toString();
MailIndex index = new MailIndex(id, fo, su, fr, to, da, re);
mailIndexVector.addElement(index);
Vector h2 = myReader.read("Filter.4on");
for(int j=0; j<h2.size(); j+=3){
String fo = h2.elementAt(j).toString();
String from = h2.elementAt(j+1).toString();
String te = h2.elementAt(j+2).toString();
FilterIndex index = new FilterIndex(fo, from, te);
filterIndexVector.addElement(index);
folderVector = myReader.read("Folder.4on");
DefaultMutableTreeNode top, inbox, outbox, sentbox, trash;
top = new DefaultMutableTreeNode("mails");
top.add(inbox = new DefaultMutableTreeNode("Inbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Inbox"))
inbox.add(new DefaultMutableTreeNode(m));
top.add(outbox = new DefaultMutableTreeNode("Outbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Outbox")){
outbox.add(new DefaultMutableTreeNode(m));
top.add(sentbox = new DefaultMutableTreeNode("Sentbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Sentbox"))
sentbox.add(new DefaultMutableTreeNode(m));
for(int j=0; j<folderVector.size(); j++){
top.add(trash =
new DefaultMutableTreeNode(folderVector.elementAt(j).toString()));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals(folderVector.elementAt(j).toString()))
trash.add(new DefaultMutableTreeNode(m));
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode
(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(new myTreeSelectionListener());
treeScroll = new JScrollPane(tree);
treeScroll.setFont(new Font("Monospaced",Font.PLAIN,6));
baum.add("Center", treeScroll);
MainMenu menuBar = new MainMenu(this, this);
setJMenuBar(menuBar);
setVisible(true);
public void mailsFetcher() {
myLetterman = new Letterman(this, mySetup);
myLetterman.start();
public void treeNewSign(){
trae.remove(treeScroll);
DefaultMutableTreeNode top, inbox, outbox, sentbox, trash;
top = new DefaultMutableTreeNode("mails");
top.add(inbox = new DefaultMutableTreeNode("Inbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Inbox"))
inbox.add(new DefaultMutableTreeNode(m));
top.add(outbox = new DefaultMutableTreeNode("Outbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Outbox"))
outbox.add(new DefaultMutableTreeNode(m));
top.add(sentbox = new DefaultMutableTreeNode("Sentbox"));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals("Sentbox"))
sentbox.add(new DefaultMutableTreeNode(m));
for(int j=0; j<folderVector.size(); j++){
top.add(trash =
new DefaultMutableTreeNode(folderVector.elementAt(j).toString()));
for(int i=0; i<mailIndexVector.size(); i++){
MailIndex m = (MailIndex)mailIndexVector.elementAt(i);
if (m.folder.equals(folderVector.elementAt(j).toString()))
trash.add(new DefaultMutableTreeNode(m));
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode
(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(new myTreeSelectionListener());
treeScroll = new JScrollPane(tree);
trae.add("Center", treeScroll);
trae.repaint();
setVisible(true);
public void menuNewSign(){
setJMenuBar(new MainMenu(this, this));
setVisible(true);
public String fromFilter (String t){
String myFrom = "";
int start, end;
int a = t.indexOf("From:");
if (a != -1){
start = a + 6;
ende = t.indexOf("\n",start);
myFrom = t.substring(start,end);
return myFrom;
public String toFilter (String t){
String myTo = "";
int start, e1, e2, end;
int a = t.indexOf("To:");
if (a != -1){
start = a + 4;
end = t.indexOf("\n",start);
myTo = t.substring(start,end);
e1 = end + 1;
if(t.substring(e1,e1+1).equals(" ")){
while(t.substring(e1,e1+1).equals(" ")){
while(t.substring(e1,e1+1).equals(" "))
e1++;
e2 = t.indexOf("\n",e1);
myTo += " " + t.substring(e1,e2);
e1 = e2 + 1;
return myTo;
public String dateFilter (String t){
String myDate = "";
int start, end;
int a = t.indexOf("Date:");
if (a != -1){
start = a + 6;
end = t.indexOf("\n",start);
myDate = t.substring(start,end);
return myDate;
public String subjectFilter (String t){
String mySubject = "";
int start, end;
int a = t.indexOf("Subject:");
if (a != -1){
start = a + 9;
end = t.indexOf("\n",start);
mySubject = t.substring(start,end);
return mySubject;
public String mailFilter (String t){
String myMail = "";
int start = 0, end = t.length();
start = t.indexOf("\n\n") + 2;
if (start != 1){
int a = t.indexOf("\n\n" ,start);
if (a != -1){
if (t.indexOf(".",a+2) == a+2)
if (t.indexOf("\n",a+3) == a+3)
start = a;
myMail = t.substring(start,end);
return myMail;
public void mailsRemark(String file){
String mail = "", t = "";
Vector mailVector = myReader.read(file);
for (int i=0; i<mailVector.size(); i++)
t += (String)mailVector.elementAt(i) + "\n";
from = fromFilter(t);
subject = subjectFilter(t);
mailBody = mailFilter(t);
mail += "Subject: " + subject + "\n";
mail += "Date: " + dateFilter(t) + "\n";
mail += "From: " + from + "\n";
mail += "To: " + toFilter(t) + "\n";
mail += "\n" + mailBody;
if(viewSource == true)
ta.setText(t);
else
ta.setText(mail);
public synchronized void mails(String t){
Status myStatus = new Status(this,t);
myStatus.start();
public void delete(){
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
if(node.isLeaf()){
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailIndexVector.removeElement(index);
int count = 0;
for(int j=0; j<mailIndexVector.size(); j++){
MailIndex index1 = (MailIndex)mailIndexVector.elementAt(j);
String id = index1.mailId;
if(id.equals(index.mailId))
count++;
if(count == 0){
File home = new File(".");
String mailsRemark = "." + home.separator + "data";
File datei = new File(mailsRemark, index.mailId);
datei.delete();
treeNewSign();
menuNewSign();
else{
String t = (String)nodeInfo;
boolean toDelete = false;
for (int i=0; i<folderVector.size(); i++){
if(folderVector.elementAt(i).equals(t)){
folderVector.removeElement(t);
konnteLoeschen = true;
if(toDelete == false){
message("This folder can not be deleted!");
treeNewSign();
else
message("Folder is not Empty! Please delete Your mails.");
else
message("No Mails where selected to be deleted!");
public void forward(){
if(from != null){
creatorOeffnen();
myCreator.tfSb.setText("Fwd to: " + subject);
myCreator.ta.setText("<" + from + ">" + " wrote:\n\n" + mailBody +
"\n\n>\n>\n\n");
public void reply(){
if(from != null){
creatorOeffnen();
myCreator.tfTo.setText(from);
myCreator.tfSb.setText("Reply to: " + subject);
myCreator.ta.setText("<" + from + ">" + " wrote:\n\n" + mailBody +
"\n\n>\n>\n\n");
public void end(){
String h = "";
for (int i=0; i<mailIndexVector.size(); i++){
MailIndex index = (MailIndex)mailIndexVector.elementAt(i);
h += index.mailId + "\n";
h += index.folder + "\n";
h += index.subject + "\n";
h += index.from + "\n";
h += index.to + "\n";
h += index.date + "\n";
h += index.read + "\n";
myWriter.writer(h,"Summary.4on");
String w = "";
for (int l=0; l<filterIndexVector.size(); l++){
FilterIndex index = (FilterIndex)filterIndexVector.elementAt(l);
w += index.folder + "\n";
w += index.from + "\n";
w += index.text + "\n";
myWriter.write(w,"Filter.4on");
String k = "";
for(int j=0; j<folderVector.size(); j++)
k += folderVector.elementAt(j).toString() + "\n";
myWriter.writer(k,"Folder.4on");
String t = "";
for (int l=0; l<myAddressBook.addressIndexVector.size(); l++){
AddressIndex aindex =
(AddressIndex)myAdressBook.adressIndexVector.elementAt(l);
t += aindex.alias + "\n";
t += aindex.email + "\n";
myWriter.write(t,"Address.4on");
setVisible(false);
dispose();
System.exit(0);
public void filterOpen(){
boolean test = false;
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof String){
myFilter.folder = (String)nodeInfo;
for(int i=0; i<filterIndexVector.size(); i++){
FilterIndex h = (FilterIndex)filterIndexVector.elementAt(i);
if(h.folder.equals(nodeInfo)){
myFilter.index = h;
test = true;
if(h.from.equals("")){
myFilter.box1 = false;
myFilter.fTf.setText("");
myFilter.fBox.setSelected(false);
myFilter.fTf.setEditable(false);
else{
myFilter.box1 = true;
myFilter.fTf.setText(h.from);
myFilter.fBox.setSelected(true);
myFilter.fTf.setEditable(true);
if(h.text.equals("")){
myFilter.box2 = false;
myFilter.tTf.setText("");
myFilter.tBox.setSelected(false);
myFilter.tTf.setEditable(false);
else{
myFilter.box2 = true;
myFilter.tTf.setText(h.text);
myFilter.tBox.setSelected(true);
myFilter.tTf.setEditable(true);
break;
myFilter.setVisible(true);
myFilter.fBox.requestFocus();
else
meldung("No selection");
public void sendOutbox(){
fromOutbox = true;
int i;
Block1:
for(i=0; i<mailIndexVector.size(); i++){
MailIndex index = (MailIndex)mailIndexVector.elementAt(i);
if(index.folder.equals("Outbox")){
Vector mailVector = myReader.read(index.mailId);
Block2:
for(int j=0; j<mailVector.size(); j++){
String m = (String)mailVector.elementAt(j);
if(m.indexOf("Subject:") != -1){
for(int k=0; k<=j+1; k++){
mailVector.removeElementAt(0);
break Block2;
Vector toVector = new Vector();
int tEnd = 1;
String line = "";
String t = index.to;
while (tEnd != -1){
tEnd = t.indexOf(", ");
if (tEnd == -1)
line = t;
else
line = t.substring(0,tEnd);
t = t.substring(tEnd + 1);
toVector.addElement(line);
File home = new File(".");
String mailsVerzeichnis = "." + home.separator + "data";
File datei = new File(mailsRemark, index.mailId);
datei.delete();
mySendman = new Sendman(mailVector, toVector, index.subject,ailsAnzeig, mySetup, this);
mySendman.start();
mailIndexVector.removeElement(index);
break Block1;
if(i == mailIndexVector.size())
fromOutbox = false;
treeNewSign();
public void partion(String cmd){
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
index.folder = cmd.substring(13).toString();
treeNewSign();
else
meldung("No mails to partion!");
public void SetupOpen(){
if (mySetup.savePassword == false)
mySetup.pTf.setText("");
mySetup.setVisible(true);
mySetup.aTf.requestFocus();
public void addressbookOpen(){
myAddressBook.setVisible(true);
myAdressBook.tree.requestFocus();
public void creatorOpen(){
myCreator.setVisible(true);
myCreator.tfTo.requestFocus();
public void actionPerformed(ActionEvent event){
Object obj = event.getSource();
if (obj instanceof JMenuItem){
String cmd = event.getActionCommand();
if (cmd.equals("New fetched")){
mailsfetch();
else if (cmd.equals("Written new mails")) {
creatorOpen();
else if (cmd.equals("Reply")) {
reply();
else if (cmd.equals("Forward")) {
forward();
else if (cmd.equals("Outbox")) {
sendOutbox();
else if (cmd.equals("Delete")) {
delete();
else if ((cmd.length() >13) &&
(cmd.substring(0,13).equals("Sorting-"))){
sorting(cmd);
else if (cmd.equals("Using Addressbook")){
addressbookOpen();
else if (cmd.equals("Filter working")){
filterOpen();
else if (cmd.equals("New Order")){
myFixTask.tf.setText("");
myFixTask.setVisible(true);
myFixTask.tf.requestFocus();
else if (cmd.equals("delete")){
delete();
else if ((cmd.length() >7) &&
(cmd.substring(0,7).equals("nobody"))){
if(viewSource == false){
viewSource = true;
menuNewSign();
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailsRemark(index.mailId);
else{
viewSource = false;
menuNeuZeichnen();
if(tree.getLastSelectedPathComponent() != null){
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailsRemark(index.mailId);
else if (cmd.equals("Setup")){
SetupOpen();
else if (obj instanceof JButton){
String cmd = event.getActionCommand();
if (cmd.equals("aga")){
mailsHolen();
else if (cmd.equals("Creator Open")){
creatorOpem();
else if(cmd.equals("rep")){
reply();
else if(cmd.equals("fwd")){
forward();
else if(cmd.equals("Setup Open")){
SetupOpen();
else if(cmd.equals("adr")){
addressbookOpen();
else if(cmd.equals("delete")){
delete();
else if(cmd.equals("Information")){
myInfo.setVisible(true);
myInfo.b.requestFocus();
private class myWindowListener extends WindowAdapter{
public void windowClosing(WindowEvent event){
end();
private class myTreeSelectionListener implements TreeSelectionListener{
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)(e.getPath().getLastPathComponent());
Object nodeInfo = node.getUserObject();
if(nodeInfo instanceof MailIndex){
MailIndex index = (MailIndex)nodeInfo;
mailsAnzeigen(index.mailId);
index.read = "Yes";
} -
Hi all,
I have problem on compiling packages.
Here is the structure of the directory
1:path is c:\java
2:Created a directory inside java folder called test1 as parent directory,then I created a new folder calledd test2 inside the test1.(c:\java\test1\test2).
3. I have created java class called House.java in which I have declared a package
packageĀ test1.test2;4.I have created the main class HouseMain.java with
code]package test1.test2;
5.I have copied all the java class in the folder test2.
I cant get it compiled even after setting the classpath.
Can anyone help me please how to compile ?.
Thank youHi all,
I have problem on compiling packages.
Here is the structure of the directory
1:path is c:\java
2:Created a directory inside java folder called
test1 as parent directory,then I created a new
folder calledd test2 inside the
test1.(c:\java\test1\test2).
. I have created java class called House.java in
which I have declared a package
packageĀ test1.test2;4.I have created the main class HouseMain.java with
code]package test1.test2;I have copied all the java class in the folder
test2.
I cant get it compiled even after setting the classpath.
Can anyone help me please how to compile ?.
Thank youTry this:
Navigate to c:\java and type exactly this:
javac -classpath . -d . test1\test2\*.javaNote the "dot" after both -classpath and -d. Read the javac docs to make sure you understand what those mean.
You should see all the .class files in the same directory as your .java files. (Not the best idea, but easy for now.)
To run, type this:
java -classpath . test1.test2.HouseMain% -
Trouble compiling for printed documentation
hello, i am having trouble compiling a new document layout i
have created, i have followed peter grainges instructions on his
website but it always fails to generate straight away. Im using
Robohelp x5 with word 2000, does anyone have any ideas?
thanks steveSteve
Was RH installed on the PC you are using with you logon or
that of the person whose job you have taken over? It sounds very
much like the latter and this is exactly what I would expect to
happen.
Try creating a new project with just a couple of topics and
printing from that. It will likely also fail. If it does that
pretty much confirms my theory. Uninstall and reinstall RH with
your logon and with admin rights attached and the problem will
likely go away. -
Trouble compiling a stored procedure
Hello, I have trouble compiling a stored procedure. I include part of the code because I think the key problem is illustrated in these lines:
date1 is declared as a DATE.
index_value2 NUMBER;
BEGIN
date1 := (select sysdate from dual);
index_value2 := (select index_value from tmsdat.a_index_values where price_date < (SELECT sysdate -180
FROM dual) and price_date > (SELECT sysdate -210
FROM dual));
[\code]
The problem seems to be that a more complex syntax is included in the allocation statement (:=), can that be the case? That is, no select etc??
How is this solved?
Any help much appreciated!
best regards
HaraldWell, actually WhiteHat´s magic did the trick, but two errors:
temp := (select (to_number(to_char(sysdate, 'DD'))-1)/(decode(to_char(sysdate,'MM'),'02',28,30)) as result
from dual);
[\code]
this line generates problems but I think the approach is the same maybe, that is:
select to_number(to_char(sysdate, 'DD'))-1)/(decode(to_char(sysdate,'MM'),'02',28,30)) into temp as result frmo dual
Further, some error about encountering end of line?
END CONVERT_MARKET_INDEX; -
Compiling packages or procedures
Hello,
I am compiling a package , procedures etc. The query comes back with invalids. I have show error. How do I retrieve more detail information about why the package/procedure/view are invalid?
DECLARE
v_status VARCHAR2(10);
v_cmd VARCHAR2(150);
Cursor rw_objects
IS
Select object_name,object_type,status,owner
From dba_objects
WHERE UPPER(object_type) IN ('VIEW','PROCEDURE','FUNCTION','PACKAGE', 'PACKAGE BODY','TRIGGER','SYNONYM')
AND owner = UPPER('&&DW_SCHEMA')
AND status = 'INVALID';
BEGIN
FOR t IN rw_objects
LOOP
IF t.object_type ; IN ('SYNONYM','VIEW','TRIGGER','PROCEDURE','FUNCTION') THEN
v_cmd := 'ALTER ' || t.object_type || ' ' || t.owner||'.'||t.object_name || ' COMPILE ';
execute immediate v_cmd;
ELSIF
t.object_type ; = ('PACKAGE') THEN
v_cmd := 'ALTER PACKAGE ' || ' ' || t.owner||'.'||t.object_name || ' COMPILE PACKAGE';
execute immediate v_cmd;
ELSIF
t.object_type ; = ('PACKAGE BODY') THEN
v_cmd := 'ALTER PACKAGE ' || ' ' || t.owner||'.'||t.object_name || ' COMPILE BODY';
execute immediate v_cmd;
dbms_output.put_line( rpad( t.object_type || ' ' || t.object_name, 50, ' ' ) || ' VALID ');
END IF;
END LOOP;
END;
SELECT object_name, object_type, status
FROM dba_objects
WHERE STATUS = 'INVALID'
AND UPPER(object_type) IN ('VIEW','PROCEDURE','FUNCTION','PACKAGE', 'PACKAGE BODY','TRIGGER','SYNONYM')
AND owner = UPPER('&&DW_SCHEMA')
ORDER by object_type;
show errors; Here are the results.
OBJECT_NAME OBJECT_TYPE STATUS
PM206 PACKAGE BODY INVALID
DW_BE_DFACT_TB_REFRESH_HANDLER PACKAGE BODY INVALID
DW_BE_DFACT_TB_INITIAL_HANDLER PACKAGE BODY INVALID
CHART_HANDLER PACKAGE BODY INVALID
DW_CRS_HANDLER PACKAGE BODY INVALID
DELETE_UPDATE_PROC PROCEDURE INVALID
DW_CBS_PROC PROCEDURE INVALID
DW_GL_DFACT_VW VIEW INVALID
8 rows selected.
No errors.too bad COPY & PASTE are broken for you!
1 DECLARE
2 v_status VARCHAR2(10);
3 v_cmd VARCHAR2(150);
4 Cursor rw_objects
5 IS
6 Select object_name,object_type,status,owner
7 From dba_objects
8 WHERE UPPER(object_type) IN ('VIEW','PROCEDURE','FUNCTION','PACKAGE', 'PACKAGE BODY','TRIGGER','SYNONYM')
9 AND owner = UPPER('&&DW_SCHEMA')
10 AND status = 'INVALID';
11 BEGIN
12 FOR t IN rw_objects
13 LOOP
14 IF t.object_type ; IN ('SYNONYM','VIEW','TRIGGER','PROCEDURE','FUNCTION') THEN
15 v_cmd := 'ALTER ' || t.object_type || ' ' || t.owner||'.'||t.object_name || ' COMPILE ';
16 execute immediate v_cmd;
17 ELSIF
18 t.object_type ; = ('PACKAGE') THEN
19 v_cmd := 'ALTER PACKAGE ' || ' ' || t.owner||'.'||t.object_name || ' COMPILE PACKAGE';
20 execute immediate v_cmd;
21 ELSIF
22 t.object_type ; = ('PACKAGE BODY') THEN
23 v_cmd := 'ALTER PACKAGE ' || ' ' || t.owner||'.'||t.object_name || ' COMPILE BODY';
24 execute immediate v_cmd;
25 dbms_output.put_line( rpad( t.object_type || ' ' || t.object_name, 50, ' ' ) || ' VALID ');
26 END IF;
27 END LOOP;
28* END;
29 /
old 9: AND owner = UPPER('&&DW_SCHEMA')
new 9: AND owner = UPPER(' USER1')
IF t.object_type ; IN ('SYNONYM','VIEW','TRIGGER','PROCEDURE','FUNCTION') THEN
ERROR at line 14:
ORA-06550: line 14, column 49:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( * @ % & = - + < / > at in is mod remainder not rem then
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The symbol ";" was ignored.
ORA-06550: line 18, column 48:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( * @ % & = - + < / > at in is mod remainder not rem then
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset
ORA-06550: line 22, column 49:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( * @ % & = - + < / > at in is mod remainder not rem then
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset
SQL> -
Trouble compiling servlet example
Hi All, I am trying out an example for servlets and I ran into trouble compiling the the file called "FormProcessingServlet.java" in tutorial located here: http://developer.java.sun.com/developer/onlineTraining/Servlets/Fundamentals/magercises/FormPostingAndProcessing/index.html
The exact problem happens in this line:
isStructure = context.getResourceAsStream(paramStructureFile[0]);
The error says:
FormProcessingServlet.java:127: cannot resolve symbol
symbol : method getResourceAsStream (java.lang.String)
location: interface javax.servlet.ServletContext
isStructure = context.getResourceAsStream(paramStructureFile[0]);
anyone else ran into this problem? How do I fix this? Thanks."cannot resolve symbol" means that the JVM can't find a particular class.
Adjust your systems classpath variable to include all the jar files that you use, I also add "." to include files in the current directory I'm working from. -
I am a total newbie at programming and I am having trouble compiling. In the MS-DOS prompt, I located the folder where my .java file is located and typed the following:
javac SampleProgram.java
I received a "Bad command or file name" error. I am typing the names correctly. I am using Java 2 SDK, Standard Edition Version 1.3.1. Am I doing something wrong?
Thanks for any help.That should fix it. The problem is that DOS needs to know where to find the executable files like javac.exe
You can either set the path temporarily by typing
SET PATH=.;c:\jdk1.3.1\bin
at the command prompt each time you open a command window, or you can set it more permanently by adding it to your startup config. This will depend on your OS. On win 98 for example, there is an AUTOEXEC.BAT (usually with a SET PATH command already present). You could open this in notepad to add/change:
SET PATH=C:\WINDOWS
to
SET PATH=C:\WINDOWS;.;C:\JDK1.3.1\BIN
Reboot to make the changes take effect. Other OS's may have a special dialog to set this kind of command.
Hope this helps some. -
Error when Compiling package header and body - how change pkb file associat
Hi everyone,
it has already been noticed elsewhere (in the thread "Compiling package header and body" of Jan 12, 2010) that the compilation of package scripts sometimes fails (apparently because of a sqldeveloper bug) when the script contains the terminating slash /.
Is this bug still open?
Next question: In the above mentioned thread it is recommended as workaround to change the corresponding file type association from pl/sql to sql. I would like to do that; I know the place in the preferences dialog, but most of the associations there seem to be hard coded and cannot be changed.
I would appreciate any ideas!
Thanks in advance,
user8632123.For the workaround: you'd have to change the file's extension, not the association (to e.g. .sql).
Have fun,
K. -
How do i get error after compiling package
Hi ,
i am compiling some packages by sys schema of hr schema as
alter package hr.example compile package
but it shows compiled with error
how can i see that errors as i dont know the password of hr schema ..
Thanks in advanceFirst of all you should not be using SYS to compile anything ... create a DBA account.
Second there is not need to be HR to see the errors ... type "SHO ERR" and you should see the errors and if that does not work there is always the simple
SELECT * FROM dba_errors;In the future please do not post questions without full version number and, when possible, screen scrapes (cut and paste) so we can see what you are doing. -
[svn] 1091: compiler: class renaming in the compiler package
Revision: 1091
Author: [email protected]
Date: 2008-04-03 13:32:09 -0700 (Thu, 03 Apr 2008)
Log Message:
compiler: class renaming in the compiler package
* flex2.compiler:Context to CompilerContext
* flex2.compiler.util:Console to ConsoleLogger
Bugs: n/a
QA: No
Doc: No
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/API.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilationUnit.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/PersistenceStore.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/Source.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/SymbolTable.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/abc/Compiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/Compiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/EmbedExtension.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/StyleExtension.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/SyntaxTreeEvaluator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension. java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingFirstPassE valuator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/TypeAnalyzer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/genext/GenerativeSecondPassEv aluator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/Compiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/i18n/Compiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractDocumentBuil der.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/internal/OEMConsole.java
Added Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerContext.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/ConsoleLogger.java
Removed Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/Context.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Console.javaOut of curiosity, do you have a directory called WEB-INF inside of
MyPortal\portalApp\portlets\WFWeb? If so, can you try removing/renaming it?
"Gavin" <[email protected]> wrote in message
news:40581f2e$[email protected]..
>
I create a Application naming "MyPortal" in WorkShop.
And create a Project naming "portalApp".
In folder "portalApp", I create a folder "portlets"
And create a PageFlow in folder "portlets", so I get a jpf naming"WFWebController.jpf"
>
>
W:\bea\user_projects\applications\MyPortal\portalApp\portlets\WFWeb\WFWebCon
troller.jpf
>
But I add some java code in the method of WFWebController.jpf
when I run the WFWebController.jpf from workshop
the compiler throws a ERROR message "A PageFlowController at the root ofthe web
application must be in the default package."
Have any solution about this ERROR ?
Thanks,
Gavin. -
New programmer- how do i compile package members?
im learning java using sams teach yourself java in 21 days. its really good compared to other ive tried but i was having a problem on day 6. i couldnt compile package members successfully. i didnt undestand the book instruction so instead of compiling this way:
C:\noam\java> c:\java\jdk1.5.0_06\bin\javac classname.java
i did it this way:
C:\java\noam\org\cadenhead\ecommerce> c:\java\jdk1.5.0_06\bin\javac classname.java
this worked but other classes inside the package could not recognize this class, though classes outside the package could.
how do i compile package members?
thnx!I solved the problem...! I have no idea how but it worked this time!
thnx anyway for everybody who tried to help! -
30EA1: PLS-00172 when compiling package body
Hi there,
I'm having a strange bug when compiling a package body in SQL Developer 3.0 EA1, while the same package body compiles well in production version (2.1).
The error code returned is Error: ORA-06550: line 1, column 64: PLS-00172: string literal too long
Does anyone have the same problems?yes: SQL*Developer 3EA1 - Not Compiling package Body
Hope that helps,
K.
Maybe you are looking for
-
HELP. new hard drive not recognized
HELP! guys, i badly need your help. i've been searching all over the internet and reading so many user groups already to search for answers to no avail. I bought a new Western Digital 160GB Scorpio SATA hard drive. I wanted to upgrade my Macbook whic
-
Getting the class name from within the compiled class file
hey! I was wondering (i know its possible) how to read a .class and get the name of the class. ok that made not much sense^^ so, You have a file: c:\f.class but it wont run because the file name has to be the same as the classes name, right? so how c
-
Dear Friends, While I am trying to post a Journal for which I don't want any cost objects to be assigned, system is giving an error msg & the msg number is KI235. Please advise from where I can set this msg from Error to warning to proceed with my en
-
How can we implement product key feature while installing AIR application?
How can we implement product key feature while installing AIR application?
-
Transactional Data Field Change
Hi SDNites, I am trying to identify all the field changes (Transactional Data) which has been done into CRM for a specific transaction (Ex: Service request). Could you please suggest any BADI or any function module which will provide me the same. Reg