473,657 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server compliation problem

oll3i
679 Contributor
when i try to compile my server i get the following errors

D:\JAVA_P~1\SIM PLE~1>javac -classpath . PhoneDirServer. java
PhoneDirServer. java:6: package PhoneDirectory does not exist
import PhoneDirectory. PhoneDirImpl;
^
.\PhoneDirImpl. java:34: class, interface, or enum expected
}
^
.\PhoneDirImpl. java:12: cannot find symbol
symbol: class PhoneDirInterfa ce
implements PhoneDirInterfa ce {
^
PhoneDirServer. java:29: cannot access PhoneDirImpl
bad class file: .\PhoneDirImpl. java
file does not contain class PhoneDirImpl
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
PhoneDirImpl myObject = new PhoneDirImpl();
^
4 errors


here is my server code
Expand|Select|Wrap|Line Numbers
  1.  
  2. import java.util.Properties;
  3. import javax.naming.InitialContext;
  4. import javax.rmi.PortableRemoteObject;
  5.  
  6. import PhoneDirectory.PhoneDirImpl; 
  7.  
  8. /**
  9.  * Creates a Server and binds the RMI Servant with the IIOP Registry
  10.  * 
  11.  * 
  12.  * 
  13.  */
  14. public class PhoneDirServer { 
  15.  
  16.   static final String CONTEXT_NAME = "java.naming.factory.initial";
  17.   static final String IIOP_STRING  = "com.sun.jndi.cosnaming.CNCtxFactory";
  18.  
  19.   static final String URL_NAME = "java.naming.provider.url";
  20.   static final String IIOP_URL_STRING  = "iiop://localhost:1000";
  21.  
  22.   /**
  23.    * Entry Point to this application
  24.    */
  25.   public static void main(String[] args) { 
  26.     try {
  27.  
  28.       // Create the Object
  29.       PhoneDirImpl myObject = new PhoneDirImpl(); 
  30.  
  31.       // Create the IIOP Initial Context
  32.       Properties iiopProperties = new Properties();
  33.       iiopProperties.put( PhoneDirServer.CONTEXT_NAME, 
  34.                           PhoneDirServer.IIOP_STRING );
  35.       iiopProperties.put( PhoneDirServer.URL_NAME, 
  36.                           PhoneDirServer.IIOP_URL_STRING );
  37.       InitialContext iiopContext = new InitialContext( iiopProperties );
  38.  
  39.       // Bind the object to the IIOP registry
  40.       iiopContext.rebind( "Phone Directory", myObject );
  41.  
  42.       System.out.println( "Hello from server, ready for action..." ); 
  43.     }
  44.     catch ( Exception exception ) {
  45.       exception.printStackTrace ();
  46.     }
  47.   } 
  48. }
  49.  
they are all in the same directory ..
PhoneDirImpl.ja va
PhoneDirInterfa ce.java
PhoneDirServer. java
May 16 '07 #1
14 2914
rsrinivasan
221 New Member
when i try to compile my server i get the following errors

D:\JAVA_P~1\SIM PLE~1>javac -classpath . PhoneDirServer. java
PhoneDirServer. java:6: package PhoneDirectory does not exist
import PhoneDirectory. PhoneDirImpl;
^
.\PhoneDirImpl. java:34: class, interface, or enum expected
}
^
.\PhoneDirImpl. java:12: cannot find symbol
symbol: class PhoneDirInterfa ce
implements PhoneDirInterfa ce {
^
PhoneDirServer. java:29: cannot access PhoneDirImpl
bad class file: .\PhoneDirImpl. java
file does not contain class PhoneDirImpl
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
PhoneDirImpl myObject = new PhoneDirImpl();
^
4 errors


here is my server code
Expand|Select|Wrap|Line Numbers
  1.  
  2. import java.util.Properties;
  3. import javax.naming.InitialContext;
  4. import javax.rmi.PortableRemoteObject;
  5.  
  6. import PhoneDirectory.PhoneDirImpl; 
  7.  
  8. /**
  9.  * Creates a Server and binds the RMI Servant with the IIOP Registry
  10.  * 
  11.  * 
  12.  * 
  13.  */
  14. public class PhoneDirServer { 
  15.  
  16.   static final String CONTEXT_NAME = "java.naming.factory.initial";
  17.   static final String IIOP_STRING  = "com.sun.jndi.cosnaming.CNCtxFactory";
  18.  
  19.   static final String URL_NAME = "java.naming.provider.url";
  20.   static final String IIOP_URL_STRING  = "iiop://localhost:1000";
  21.  
  22.   /**
  23.    * Entry Point to this application
  24.    */
  25.   public static void main(String[] args) { 
  26.     try {
  27.  
  28.       // Create the Object
  29.       PhoneDirImpl myObject = new PhoneDirImpl(); 
  30.  
  31.       // Create the IIOP Initial Context
  32.       Properties iiopProperties = new Properties();
  33.       iiopProperties.put( PhoneDirServer.CONTEXT_NAME, 
  34.                           PhoneDirServer.IIOP_STRING );
  35.       iiopProperties.put( PhoneDirServer.URL_NAME, 
  36.                           PhoneDirServer.IIOP_URL_STRING );
  37.       InitialContext iiopContext = new InitialContext( iiopProperties );
  38.  
  39.       // Bind the object to the IIOP registry
  40.       iiopContext.rebind( "Phone Directory", myObject );
  41.  
  42.       System.out.println( "Hello from server, ready for action..." ); 
  43.     }
  44.     catch ( Exception exception ) {
  45.       exception.printStackTrace ();
  46.     }
  47.   } 
  48. }
  49.  
they are all in the same directory ..
PhoneDirImpl.ja va
PhoneDirInterfa ce.java
PhoneDirServer. java
Hi,
What is the problem you hava is you did not store the file in correct folder.

If all are in the same directory then create one folder "PhoneDirectory " and store the file "PhoneDirImpl.j ava" in it. And compile the file "PhoneDirImpl.j ava" which is stored in that folder. After that compile your main program. You will get the output as you expected. Do the same thing for "PhoneDirInterf ace.java".

And reply what happen...

Thanks and Regards,
Srinivasan r.
May 16 '07 #2
oll3i
679 Contributor
D:\JAVA_P~1\SIM PLE~1\PHONED~1> javac -classpath . PhoneDirImpl.ja va
PhoneDirImpl.ja va:34: class, interface, or enum expected
}
^
1 error
May 16 '07 #3
JosAH
11,448 Recognized Expert MVP
D:\JAVA_P~1\SIM PLE~1\PHONED~1> javac -classpath . PhoneDirImpl.ja va
PhoneDirImpl.ja va:34: class, interface, or enum expected
}
^
1 error
Good; now at least javac can find the correct source. The above is simply
a compilation error (missing brackets etc.) Learn how to read compiler error
diagnostic messages.

The compiler expected something more following that right curly brackets
which indicates that your brackets don't match properly.

kind regards,

Jos
May 16 '07 #4
oll3i
679 Contributor
yes you are right that was a bracket (one too many)
i corrected it and now i get

D:\JAVA_P~1\SIM PLE~1\PHONED~1> javac -classpath . PhoneDirImpl.ja va
PhoneDirImpl.ja va:16: cannot find symbol
symbol: class PhoneDirInterfa ce
implements PhoneDirInterfa ce {
^
Note: PhoneDirImpl.ja va uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
May 16 '07 #5
r035198x
13,262 MVP
yes you are right that was a bracket (one too many)
i corrected it and now i get

D:\JAVA_P~1\SIM PLE~1\PHONED~1> javac -classpath . PhoneDirImpl.ja va
PhoneDirImpl.ja va:16: cannot find symbol
symbol: class PhoneDirInterfa ce
implements PhoneDirInterfa ce {
^
Note: PhoneDirImpl.ja va uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Did you successfully compile PhoneDirInterfa ce first?
May 16 '07 #6
oll3i
679 Contributor
yes i did .
May 16 '07 #7
oll3i
679 Contributor
why it can not find it?
May 16 '07 #8
r035198x
13,262 MVP
why it can not find it?
You have

Expand|Select|Wrap|Line Numbers
  1.  import PhoneDirectory.PhoneDirImpl;
But you said they are in the same directory?
May 16 '07 #9
oll3i
679 Contributor
server is in a Simple_RMI directory then
PhoneDirImpl.ja va and PhoneDirInterfa ce.java are in a subfolder of Simple_RMI which i named PhoneDirectory but i have problems now with compiling PhoneDirImpl.ja va

the server compiles .... i dont know what it means " unchecked or unsafe operations"

D:\JAVA_P~1\SIM PLE~1>javac -classpath . PhoneDirServer. java
Note: .\PhoneDirector y\PhoneDirImpl. java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
May 16 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1942
by: Scotter | last post by:
Hi - I posted this message in the microsoft.public.inetserver.iis group, as well. I hope someone can help. My client is frantic. Platform: Windows 2003 Server Enterprise Edition, latest MDAC 2.8 Trying to run this ASP.NET app. It has worked before. No code has changed so I'm convinced the problem is with some server settings.
4
2709
by: NathanAllen | last post by:
First of all to let you know I am using the following compiler: Borland C++Builder 5.5.1 with Turbo Incremental Link 5.00 When I tried to make my first GUI drawing following Lawernceville Press's book it created an error in the compliation process: Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland E:\Gui.cpp: Warning W8004 E:\borland\Include\lvp\String.cpp 106: 'len' is assigned a value that is never used in function...
0
4120
by: AlessanBar | last post by:
Hello Friends !! I have a strange problem, and I need to know what would be the source of this. I have a laptop computer with the following configuration: Pentium III Brand : Toshiba Speed : 500 Mhz RAM : 192 MB Hard Disk : 6 GB
4
1238
by: Jack Wright | last post by:
Dear All, We have developed a few Web pages in .Net and have a number to dlls in our bin directory...in our Global.asmx on Application_Start we have written code to load each library from the bin directory...using Assembly.Load(...). Even if I comment this function...the CLR compiles all the dlls in the bin directory and puts it in "ASP Temporary Internet files" folder...does this mean that Assembly.Load is not necessary? Also if my bin...
6
3784
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
12
1357
by: news.coderaka | last post by:
I got a compliation error when compiling this programs using g++ 3.4.2. Who can tell me why? Thank you. #include<iostream> using namespace std; template<class T> class list{ class iterator{
1
5116
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from the control unit and store them into the Sql server - The operation console then retrieve this data from the sql for reporting and statistics purposes - I am using ODBC connection - The problem is that the operation console is not able to...
0
1591
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
I have a testing client program, the purpose is send a xml file to a server program, and the server return another xml message. So I wrote a testing server program the simple one and make sure the communication is fine. After that I started to program more complicated server program, since there are many compliation error. The client program keep displaying: The remote server returned an invalid statuscode: #8221;500 Internal Server Error...
6
1559
by: multics.cn | last post by:
Dear all, I have one line in my cpp source file. void (**fa)(char,float) = new (void (char,float)); I tried gcc and vc express, both result in compliation error: g++ gives: error: creating array of functions
0
8384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8820
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.