From user-return-66063-apmail-ant-user-archive=ant.apache.org@ant.apache.org Mon Oct 13 07:54:13 2008 Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 74439 invoked from network); 13 Oct 2008 07:54:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Oct 2008 07:54:13 -0000 Received: (qmail 8081 invoked by uid 500); 13 Oct 2008 07:54:09 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 8040 invoked by uid 500); 13 Oct 2008 07:54:09 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 8029 invoked by uid 99); 13 Oct 2008 07:54:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 00:54:09 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [15.216.28.35] (HELO g1t0028.austin.hp.com) (15.216.28.35) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 07:53:03 +0000 Received: from G3W0630.americas.hpqcorp.net (g3w0630.americas.hpqcorp.net [16.233.58.74]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by g1t0028.austin.hp.com (Postfix) with ESMTPS id 3F8881C586 for ; Mon, 13 Oct 2008 07:53:09 +0000 (UTC) Received: from G3W0055.americas.hpqcorp.net (16.232.1.152) by G3W0630.americas.hpqcorp.net (16.233.58.74) with Microsoft SMTP Server (TLS) id 8.1.263.0; Mon, 13 Oct 2008 07:52:42 +0000 Received: from GVW1089EXB.americas.hpqcorp.net ([16.234.42.9]) by G3W0055.americas.hpqcorp.net ([16.232.1.152]) with mapi; Mon, 13 Oct 2008 07:52:42 +0000 From: "Pareti, Joseph" To: Ant Users List Date: Mon, 13 Oct 2008 07:53:29 +0000 Subject: RE: what does ant really use? Thread-Topic: what does ant really use? Thread-Index: AckstWUk7TtSy7xJSoKrtfzmr9yRswAUjOIQ Message-ID: <164F2D2210CC5344BC2A2DC44BFD0D4142A064F1A0@GVW1089EXB.americas.hpqcorp.net> References: <164F2D2210CC5344BC2A2DC44BFD0D41429FE144BB@GVW1089EXB.americas.hpqcorp.net> <6dc6523c0810080258i4bc9d5d4q9df31ef715abd28d@mail.gmail.com> <164F2D2210CC5344BC2A2DC44BFD0D41429FE74EF0@GVW1089EXB.americas.hpqcorp.net> <164F2D2210CC5344BC2A2DC44BFD0D41429FE74FCF@GVW1089EXB.americas.hpqcorp.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Thanks Martin, here are some quick answers. =3D=3D=3D=3D=3D >what is the specific error you are getting? [java] javax.naming.NoInitialContextException: Can't find property: java.na= ming.factory.initial [java] at javax.naming.spi.NamingManager.getInitialContext(java.uti= l.Hashtable) (/lib/ssa/libgcj.so.4.0.0) [java] at javax.naming.InitialContext.getDefaultInitCtx() (/lib/ssa= /libgcj.so.4.0.0) [java] at javax.naming.InitialContext.getURLOrDefaultInitCtx(java.l= ang.String) (/lib/ssa/libgcj.so.4.0.0) [java] at javax.naming.InitialContext.lookup(java.lang.String) (/li= b/ssa/libgcj.so.4.0.0) [java] at za.co.solms.finance.calculators.LoanCalculatorPanel.conne= ct() (Unknown Source) [java] at za.co.solms.finance.calculators.LoanCalculatorPanel.init(= ) (Unknown Source) [java] at za.co.solms.finance.calculators.LoanCalculatorPanel.LoanC= alculatorPanel() (Unknown Source) [java] at za.co.solms.finance.calculators.LoanCalculatorClient.Loan= CalculatorClient() (Unknown Source) [java] at za.co.solms.finance.calculators.LoanCalculatorClient.main= (java.lang.String[]) (Unknown Source) >which version of which AppServer are you deploying to? JBOSS 4.2.0.CR2 >we will need to see ejb-jar.xml A calculator which calculates the amortization of a fixed rate= loan at constant payments. LoanCalculator EJB LoanCalculator za.co.solms.finance.calculators.LoanCalculatorHome za.co.solms.finance.calculators.LoanCalculator za.co.solms.finance.calculators.LoanCalculatorBean Stateless Container LoanCalculator * Required The java source where the problem occurs is the following: package za.co.solms.finance.calculators; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; import swingwt.awt.*; import java.text.*; import java.util.*; import swingwtx.swing.*; import swingwt.awt.event.*; import javax.naming.Context; import java.util.Hashtable; import javax.naming.InitialContext; public class LoanCalculatorPanel extends JPanel { public LoanCalculatorPanel() {init();} public void init() { try { connect(); JPanel fieldsPanel =3D new JPanel(); fieldsPanel.setLayout (new GridLayout(4,3)); fieldsPanel.add(new JLabel("Loan amount: ")); fieldsPanel.add(loanAmountField); fieldsPanel.add(calcLoanAmountButton); fieldsPanel.add(new JLabel("Monthly installment: ")); fieldsPanel.add(installmentField); fieldsPanel.add(calcInstallmentButton); fieldsPanel.add(new JLabel("Loan period in months: ")); fieldsPanel.add(loanPeriodField); fieldsPanel.add(calcLoanPeriodButton); fieldsPanel.add(new JLabel("Interest Rate (%): ")); fieldsPanel.add(interestRateField); JPanel mainPanel =3D new JPanel(); mainPanel.add(fieldsPanel); add(mainPanel); calcLoanAmountButton.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent event) { double installment =3D getDouble(installmentField); int loanPeriod =3D getInt(loanPeriodField); double interestRate =3D getDouble(interestRateField)/100; try { double loanAmount =3D loanCalculator.calcLoanAmount (installment, interestRate, loanPeriod); loanAmountField.setText (amountFormatter.format(loanAmount)); } catch (Exception e) { JOptionPane.showMessageDialog (LoanCalculatorPanel.this, e.toString(), e.getMessage(), JOptionPane.ERROR_MESSAGE); } } }); calcInstallmentButton.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent event) { double loanAmount =3D getDouble(loanAmountField); int loanPeriod =3D getInt(loanPeriodField); double interestRate =3D getDouble(interestRateField)/100; try { double installment =3D loanCalculator.calcMonthlyInstallment (loanAmount, interestRate, loanPeriod); installmentField.setText (amountFormatter.format(installment)); } catch (Exception e) { JOptionPane.showMessageDialog (LoanCalculatorPanel.this, e.toString(), e.getMessage(), JOptionPane.ERROR_MESSAGE); } } }); calcLoanPeriodButton.addActionListener (new ActionListener() { public void actionPerformed(ActionEvent event) { double loanAmount =3D getDouble(loanAmountField); double installment =3D getDouble(installmentField); double interestRate =3D getDouble(interestRateField)/100; try { int loanPeriod =3D loanCalculator.calcLoanPeriodInMonths (loanAmount, installment, interestRate); loanPeriodField.setText(Integer.toString(loanPeriod)); } catch (Exception e) { JOptionPane.showMessageDialog (LoanCalculatorPanel.this, e.toString(), e.getMessage(), JOptionPane.ERROR_MESSAGE); } } }); } catch (Exception e) { JOptionPane.showMessageDialog(LoanCalculatorPanel.this, e.getMessage(), "Could not connect to session bean.", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); System.exit(0); } } public double getDouble(JTextField textField) { try { return amountFormatter.parse (textField.getText(), new ParsePosition(0)).doubleValue(); } catch (NumberFormatException e) { JOptionPane.showMessageDialog (this, e.getMessage(), "Invalid input.", JOptionPane.ERROR_MESSAGE); return 0; } } public int getInt(JTextField textField) { try { return Integer.parseInt(textField.getText()); } catch (NumberFormatException e) { JOptionPane.showMessageDialog (this, e.getMessage(), "Invalid input.", JOptionPane.ERROR_MESSAGE); return 0; } } public void connect() { try { System.out.println("Now looking up session bean " + jndiName + " ..."); java.util.Hashtable properties =3D new java.util.Hashtable(); properties.put(Context.PROVIDER_URL,"localhost:1099"); properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingCo= ntextFactory"); properties.put("java.naming.rmi.security.manager", "yes"); javax.naming.Context context =3D new javax.naming.InitialContext(properties= ); InitialContext jndiContext =3D new InitialContext(); System.out.println("Now looking up jndiContext " + jndiContext + " ..."); System.out.println("Now looking up context " + context + " ..."); /* System.out.println("Now looking up " + InitialContext + " ..."); */ Object beanHomeRef =3D jndiContext.lookup(jndiName); System.out.println("got it"); LoanCalculatorHome home =3D (LoanCalculatorHome)PortableRemoteObject.narrow (beanHomeRef, LoanCalculatorHome.class); loanCalculator =3D home.create(); } catch (Exception e) { JOptionPane.showMessageDialog(LoanCalculatorPanel.this, e.getMessage(), "Could not connect to session bean.", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); System.exit(0); } } public void destroy() { try { loanCalculator.remove(); System.out.println("Removed session bean."); } catch (javax.ejb.RemoveException e) { System.out.println("Could not remove session bean."); } catch (java.rmi.RemoteException e) { System.out.println("Could not remove session bean."); } } private LoanCalculator loanCalculator; private JTextField loanAmountField =3D new JTextField(10); private JTextField installmentField =3D new JTextField(10); private JTextField interestRateField =3D new JTextField(10); private JTextField loanPeriodField =3D new JTextField(3); private JButton calcLoanAmountButton =3D new JButton("calculate"); private JButton calcInstallmentButton =3D new JButton("calculate"); private JButton calcLoanPeriodButton =3D new JButton("calculate"); private DecimalFormat amountFormatter =3D new DecimalFormat("###,###,###,##0.00"); private static final String jndiName =3D "ejb/LoanCalculator/local"; /* private static final String jndiName =3D "ejb/LoanCalculator/local"; = */ private static final String jndiNameJoe =3D "local/ejb/LoanCalculator"; } -----Original Message----- From: Martin Gainty [mailto:mgainty@hotmail.com] Sent: Sunday, October 12, 2008 11:56 PM To: Ant Users List Subject: RE: what does ant really use? Good Evening Joseph- what is the specific error you are getting? which version of which AppServer are you deploying to? if you are using EJB 2 (the default) we will need to see ejb-jar.xml Any or= all Java Sources (just attach every java source file that extends EJBHome)= how are you building the ear (assume either build.xml or pom.xml?) GlassFi= sh has a ear builder and deployer in $GLASSFISH_HOME/GlassFish/Sun/AppServe= r/common-ant.xml that looks something like this: Martin ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official busin= ess of Sender. This transmission is of a confidential nature and Sender doe= s not endorse distribution to any party other than intended recipient. Send= er does not necessarily endorse content contained within this transmission. > From: Joseph.Pareti@hp.com > To: user@ant.apache.org > Date: Sun, 12 Oct 2008 17:51:13 +0000 > Subject: RE: what does ant really use? > > Yes of course I have jdk 1.5.0_02 and JAVA_HOME is set too ... > > -----Original Message----- > From: Martin Gainty [mailto:mgainty@hotmail.com] > Sent: Saturday, October 11, 2008 11:12 PM > To: Ant Users List > Subject: RE: what does ant really use? > > > it is assumed you already installed the JDK for your operating system > first..then set JAVA_HOME to the folder you installed > > without the JDK installation..any distro of ANT wont work > > http://java.sun.com/javase/downloads/index.jsp > > Martin Gainty > ______________________________________________ > Disclaimer and confidentiality note > Everything in this e-mail and any attachments relates to the official bus= iness of Sender. This transmission is of a confidential nature and Sender d= oes not endorse distribution to any party other than intended recipient. Se= nder does not necessarily endorse content contained within this transmissio= n. > > > > From: Joseph.Pareti@hp.com > > To: user@ant.apache.org > > Date: Sat, 11 Oct 2008 20:14:47 +0000 > > Subject: RE: what does ant really use? > > > > Yes I am aware that there are symlinks, so I followed them to the point= that I am almost 100% sure there was neither javac nor gcj on the system d= isk. So how can ant still compile? Does it have a "bundled" gcj ? > > > > -----Original Message----- > > From: John5342 [mailto:john5342@googlemail.com] > > Sent: Wednesday, October 08, 2008 11:58 AM > > To: Ant Users List > > Subject: Re: what does ant really use? > > > > If you changed the name of gcj and javac in /usr/bin they are not the a= ctualy executables. They are only links to the real ones which in fedora (a= nd probably RH) located in /usr/share/jvm//bin/. In fe= dora (and again probably in RH) there is an "alternatives" application whic= h allows you to choose which installed version of java you are using rather= than renaming binaries. Should also warn you that although RH is supported= longer than most and in general rock stable the software is often quite ol= d because i happen to know that more recent versions of gcj support java 1.= 5. Hope this all helps you in the right direction. > > > > 2008/10/8 Pareti, Joseph > > > > > > > > > > > > > > As a disclaimer, I am a true ant (and java) novice. Having said > > > that, I am confronted with a weird problem in a j2ee project which > > > fails at run time with a jndi error. After several investigations, > > > I am now almost convinced it has to do with the build process. > > > > > > I have jdk 1.5.0_02 installed on my system, x86/RHEL 3, kernel > > > 2.4; I am also using ant 1.5.2_23 > > > > > > My build log file shows, for each compile target the following messag= e: > > > > > > [javac] Using gcj compiler > > > > > > Just for kicks, I then deleted gcj as well as javac (here I mean > > > the javac compiler executable) from my disk i.e. I renamed both of > > > them to something else, and ant still worked and still claimed > > > it's using gcj, which leaves me totally confused. > > > > > > Perhaps one hint; at the top of the log file I see the comment > > > "detected java version 1.4 in /usr". > > > > > > I know this is not what I want/need (it should be 1.5), so where > > > does it come from? > > > > > > I then went ahead setting the following property in my build.xml: > > > > > > > > > > > > but this was quickly discarded: > > > > > > "Override ignored for property build.compiler" > > > which basically produced the same results as described above. I am > > > running out of ideas here. > > > > > > Thanks for any insights. > > > > > > > -------------------------------------------------------------------- > > - To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For > > additional commands, e-mail: user-help@ant.apache.org > > > > _________________________________________________________________ > Stay up to date on your PC, the Web, and your mobile phone with Windows L= ive. > http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional > commands, e-mail: user-help@ant.apache.org > _________________________________________________________________ See how Windows connects the people, information, and fun that are part of = your life. http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org