Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: EJB COMPILATION ERROR(TANMAY SINHA)

  1. #1
    Member
    Join Date
    Aug 2011
    Posts
    31
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Angry EJB COMPILATION ERROR(TANMAY SINHA)

    I have installed on my machine weblogic 8.1 SP3.I am using jdk 1.7 version on my machine window xp.I have written my EJB Source code on my macine in
    D drive by using Advance_Java folder,in Advance_Java folder created EJB folder,in EJB folder created Demo folder,in Demo folder created Stateless
    folder,in Stateless folder i created classes,META-INF,src folder and I written

    set path=c:\bea\jdk142_04\bin;
    set classpath=c:\bea\jdk142_04\lib\tools.jar;c:\bea\we blogic81\server\lib\weblogic.jar;.;

    these above set path and set classpath in notepad and saved it with SetPath.bat extension.This SetPath created in Stateless folder with Classes,
    META-INF,src folder.In src folder I have written 4 source codes Hello,HelloBean,HelloClient,HelloHome in notepad with .java extension.

    In classes folder i created examples and META-INF folder.



    I am showing my Program compilation details are given below,so you look and read it carefully and solve my problem :





    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Tanmay Personal>d:

    D:\>cd D:\Advance_Java\EJB\Demo\Stateless

    D:\Advance_Java\EJB\Demo\Stateless>SetPath

    D:\Advance_Java\EJB\Demo\Stateless>set path=c:\bea\jdk142_04\bin;

    D:\Advance_Java\EJB\Demo\Stateless>set classpath=c:\bea\jdk142_04\lib\tools.jar;
    c:\bea\weblogic81\server\lib\weblogic.jar;.;

    D:\Advance_Java\EJB\Demo\Stateless>javac -d.\Classes D:\Advance_Java\EJB\Demo\St
    ateless\src\*.java
    javac: invalid flag: -d.\Classes
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are us
    ed
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options


    D:\Advance_Java\EJB\Demo\Stateless>


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: EJB COMPILATION ERROR(TANMAY SINHA)

    Put a space after your "-d"

  3. #3
    Member
    Join Date
    Aug 2011
    Posts
    31
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Angry Re: EJB COMPILATION ERROR(TANMAY SINHA)

    Quote Originally Posted by Sean4u View Post
    Put a space after your "-d"
    Hey ! I have solved my Problem on compilation time error.Now I am getting something different errors.
    C-EJB-Demo and ppt.In demo StatelessBean.In StatelessBean classes ,META-INF and src.
    In classes examples(After compilation making .class file).In META-INF no folder.





    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\admin>c:

    C:\Documents and Settings\admin>cd C:\EJB\Demo\StatelessBean

    C:\EJB\Demo\StatelessBean>SetPath

    C:\EJB\Demo\StatelessBean>set path=c:\bea\jdk142_04\bin;

    C:\EJB\Demo\StatelessBean>set classpath=c:\bea\jdk142_04\lib\tools.jar;c:\bea\we
    blogic81\server\lib\weblogic.jar;.;

    C:\EJB\Demo\StatelessBean>javac -d.\Classes C:\EJB\Demo\StatelessBean\src\*.java

    javac: invalid flag: -d.\Classes
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are us
    ed
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options


    C:\EJB\Demo\StatelessBean>javac -d ./classes C:\EJB\Demo\StatelessBean\src\*.jav
    a

    C:\EJB\Demo\StatelessBean>Set ClassPath="%ClassPath%";C:\EJB\Demo\StatelessBean\
    classes\examples;C:\EJB\Demo\StatelessBean\classes ;d:;.;

    C:\EJB\Demo\StatelessBean>
    C:\EJB\Demo\StatelessBean>java examples.HelloClient
    Exception in thread "main" javax.naming.CommunicationException [Root exception i
    s java.net.ConnectException: t3://localhost:7001: Destination unreachable; neste
    d exception is:
    java.net.ConnectException: Connection refused: connect; No available rou
    ter to destination]
    at weblogic.jndi.internal.ExceptionTranslator.toNamin gException(Exceptio
    nTranslator.java:47)
    at weblogic.jndi.WLInitialContextFactoryDelegate.toNa mingException(WLIni
    tialContextFactoryDelegate.java:618)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getI nitialContext(WLIni
    tialContextFactoryDelegate.java:306)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getI nitialContext(WLIni
    tialContextFactoryDelegate.java:239)
    at weblogic.jndi.WLInitialContextFactory.getInitialCo ntext(WLInitialCont
    extFactory.java:135)
    at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
    62)
    at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:243
    )
    at javax.naming.InitialContext.init(InitialContext.ja va:219)
    at javax.naming.InitialContext.<init>(InitialContext. java:195)
    at examples.HelloClient.main(HelloClient.java:20)
    Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachab
    le; nested exception is:
    java.net.ConnectException: Connection refused: connect; No available rou
    ter to destination
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.j ava:199)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL .java:125)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getI nitialContext(WLIni
    tialContextFactoryDelegate.java:296)
    ... 7 more

    C:\EJB\Demo\StatelessBean>c:

  4. #4
    Member
    Join Date
    Aug 2011
    Posts
    31
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: EJB COMPILATION ERROR(TANMAY SINHA)

    C:\EJB\Demo\StatelessBean>javac -d.\Classes C:\EJB\Demo\StatelessBean\src\*.java
    When I used the above command on command prompt then got the following Errors :

    javac: invalid flag: -d.\Classes
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are us
    ed
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options

  5. #5
    Member
    Join Date
    Aug 2011
    Posts
    31
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: EJB COMPILATION ERROR(TANMAY SINHA)

    C:\EJB\Demo\StatelessBean>javac -d ./classes C:\EJB\Demo\StatelessBean\src\*.java
    This command is correct command for compile the program(Source code).After writing the above command I compiled the Programs without any Errors.I got the class file after compilation in appropriate folder location.Yes when I put a space after -d then solved my problem.

    But you find this errors thats I am showing below :
    C:\EJB\Demo\StatelessBean>Set ClassPath="%ClassPath%";C:\EJB\Demo\StatelessBean\
    classes\examples;C:\EJB\Demo\StatelessBean\classes ;d:;.;

    C:\EJB\Demo\StatelessBean>
    C:\EJB\Demo\StatelessBean>java examples.HelloClient
    Exception in thread "main" javax.naming.CommunicationException [Root exception i
    s java.net.ConnectException: t3://localhost:7001: Destination unreachable; neste
    d exception is:
    java.net.ConnectException: Connection refused: connect; No available rou
    ter to destination]
    at weblogic.jndi.internal.ExceptionTranslator.toNamin gException(Exceptio
    nTranslator.java:47)
    at weblogic.jndi.WLInitialContextFactoryDelegate.toNa mingException(WLIni
    tialContextFactoryDelegate.java:618)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getI nitialContext(WLIni
    tialContextFactoryDelegate.java:306)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getI nitialContext(WLIni
    tialContextFactoryDelegate.java:239)
    at weblogic.jndi.WLInitialContextFactory.getInitialCo ntext(WLInitialCont
    extFactory.java:135)
    at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
    62)
    at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:243
    )
    at javax.naming.InitialContext.init(InitialContext.ja va:219)
    at javax.naming.InitialContext.<init>(InitialContext. java:195)
    at examples.HelloClient.main(HelloClient.java:20)
    Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachab
    le; nested exception is:
    java.net.ConnectException: Connection refused: connect; No available rou
    ter to destination
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.j ava:199)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL .java:125)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getI nitialContext(WLIni
    tialContextFactoryDelegate.java:296)
    ... 7 more

    C:\EJB\Demo\StatelessBean>c:

Similar Threads

  1. Tanmay Sinha
    By Tanmaysinha in forum Web Frameworks
    Replies: 1
    Last Post: February 23rd, 2012, 03:04 PM
  2. "Cannot find symbol" compilation error
    By collegejavastudent in forum What's Wrong With My Code?
    Replies: 7
    Last Post: December 12th, 2011, 05:07 PM
  3. Unable to execute the program (no compilation error)
    By Alexie91 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 16th, 2011, 02:39 PM
  4. Dynamic compilation problem
    By hemanth.yerra in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 29th, 2010, 10:51 AM
  5. Replies: 6
    Last Post: April 29th, 2009, 09:35 AM

Tags for this Thread