import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class swing extends JFrame implements ActionListener
{
JLabel ldomain = new JLabel("ldomain");
JLabel lserver = new JLabel("lserver");
JLabel lusername = new JLabel("lusername");
JLabel lpassword = new JLabel("lpassword");
JLabel lrootdirectory= new JLabel("lrootdirectory");
JLabel lconfigfile = new JLabel("lconfigfile");
JLabel lport= new JLabel("lport");
JTextField tdomain = new JTextField(20);
JTextField tserver = new JTextField(20);
JTextField tusername= new JTextField(20);
JPasswordField tpassword=new JPasswordField(20);
JTextField tconfigfile=new JTextField(20);
JTextField trootdirectory=new JTextField(20);
JTextField tport=new JTextField(20);
JButton create = new JButton("create");
public swing(){
create.addActionListener(this);
getContentPane().setLayout( new FlowLayout());
getContentPane().add(ldomain);
getContentPane().add(tdomain);
getContentPane().add(lserver);
getContentPane().add(tserver);
getContentPane().add(lusername);
getContentPane().add(tusername);
getContentPane().add(lpassword);
getContentPane().add(tpassword);
getContentPane().add(lrootdirectory);
getContentPane().add(trootdirectory);
getContentPane().add(lport);
getContentPane().add(tport);
getContentPane().add(lconfigfile);
getContentPane().add(tconfigfile);
getContentPane().add(create);
setSize(600,400);
setVisible(true);
this.addWindowListener
(
new WindowAdapter()
{
public void windowClosing( WindowEvent e){
System.exit(0);
}
}
);
}
public static void main(
String args[]) {
new swing();
}
public void actionPerformed(ActionEvent ae)
{
try
{
if(ae.getSource()==create)
{
String s1 = tdomain.getText();
String s2 = tserver.getText();
String s3 = tusername.getText();
String s4 = tpassword.getText();
String s6= trootdirectory.getText();
String s7= tport.getText();
String s8= tconfigfile.getText();
String s = "", str = " ";
s = s1.concat(" ").concat(s2).concat(" ").concat(s3).concat(" ").
concat(s4);
System.out.println(s);
String str1 = "java -Dweblogic.Domain=" + s1;
System.out.println(str1);
String str2 = " -Dweblogic.Name=" + s2;
System.out.println(str2);
String str3 = " -Dweblogic.management.username=" + s3;
System.out.println(str3);
String str4 = " -Dweblogic.management.password=" + s4;
System.out.println(str4);
String str6=" -Dweblogic.RootDirectory="+s6;
System.out.print(str6);
String str7="-Dweblogic.ListenPort="+s7;
System.out.println(str7);
String str8=" -Dweblogic.ConfigFile="+s8;
str = str1.concat(" ").concat(str2).concat(" ").concat(str3).
concat(" ").concat(str4).concat(" ").concat(str6).concat(" ").concat(str7).concat(" ").concat(str8).concat(" ")+ "weblogic.Server";
System.out.println(str);
Runtime r=Runtime.getRuntime();
String s11=" d:/bea/weblogic700/server/bin/setWLSEnv.cmd";
System.out.println("Before executing batch file");
boolean success =new File("d:/bea/weblogic700/server/bin/subrahmanyam").mkdir();
FileWriter f1= new FileWriter("d:/puvvada/swings/test/swings/bb.bat");
f1.write(s11);
Process p1=r.exec("cmd /c start d:/puvvada/swings/test/swings/bb.bat");
f1.close();
FileWriter f2= new FileWriter("d:/puvvada/swings/test/swings/cc.bat");
f2.write(str);
Process p2=r.exec("cmd /c start d:/puvvada/swings/test/swings/cc.bat");
f2.close();
System.out.println("after executing batch fiole");
}
} catch(Exception e)
{
System.out.println(e);
}
}
}
from the java program i have to start weblogicserver by interactively giving the domainname,servername,username,password,configfilename,portnumber etc.
i have written two batch files.first batch file is working.in the second batch file the exception
Exception in
thread "main" java.lang.NoClassDefFoundError: weblogic/Server
please tellme how to solve this problem.iam trying for 3 days,but notable to catch the problem