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 -
-
import java.util.Properties;
-
import javax.naming.InitialContext;
-
import javax.rmi.PortableRemoteObject;
-
-
import PhoneDirectory.PhoneDirImpl;
-
-
/**
-
* Creates a Server and binds the RMI Servant with the IIOP Registry
-
*
-
*
-
*
-
*/
-
public class PhoneDirServer {
-
-
static final String CONTEXT_NAME = "java.naming.factory.initial";
-
static final String IIOP_STRING = "com.sun.jndi.cosnaming.CNCtxFactory";
-
-
static final String URL_NAME = "java.naming.provider.url";
-
static final String IIOP_URL_STRING = "iiop://localhost:1000";
-
-
/**
-
* Entry Point to this application
-
*/
-
public static void main(String[] args) {
-
try {
-
-
// Create the Object
-
PhoneDirImpl myObject = new PhoneDirImpl();
-
-
// Create the IIOP Initial Context
-
Properties iiopProperties = new Properties();
-
iiopProperties.put( PhoneDirServer.CONTEXT_NAME,
-
PhoneDirServer.IIOP_STRING );
-
iiopProperties.put( PhoneDirServer.URL_NAME,
-
PhoneDirServer.IIOP_URL_STRING );
-
InitialContext iiopContext = new InitialContext( iiopProperties );
-
-
// Bind the object to the IIOP registry
-
iiopContext.rebind( "Phone Directory", myObject );
-
-
System.out.println( "Hello from server, ready for action..." );
-
}
-
catch ( Exception exception ) {
-
exception.printStackTrace ();
-
}
-
}
-
}
-
they are all in the same directory ..
PhoneDirImpl.ja va
PhoneDirInterfa ce.java
PhoneDirServer. java
14 2914
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 -
-
import java.util.Properties;
-
import javax.naming.InitialContext;
-
import javax.rmi.PortableRemoteObject;
-
-
import PhoneDirectory.PhoneDirImpl;
-
-
/**
-
* Creates a Server and binds the RMI Servant with the IIOP Registry
-
*
-
*
-
*
-
*/
-
public class PhoneDirServer {
-
-
static final String CONTEXT_NAME = "java.naming.factory.initial";
-
static final String IIOP_STRING = "com.sun.jndi.cosnaming.CNCtxFactory";
-
-
static final String URL_NAME = "java.naming.provider.url";
-
static final String IIOP_URL_STRING = "iiop://localhost:1000";
-
-
/**
-
* Entry Point to this application
-
*/
-
public static void main(String[] args) {
-
try {
-
-
// Create the Object
-
PhoneDirImpl myObject = new PhoneDirImpl();
-
-
// Create the IIOP Initial Context
-
Properties iiopProperties = new Properties();
-
iiopProperties.put( PhoneDirServer.CONTEXT_NAME,
-
PhoneDirServer.IIOP_STRING );
-
iiopProperties.put( PhoneDirServer.URL_NAME,
-
PhoneDirServer.IIOP_URL_STRING );
-
InitialContext iiopContext = new InitialContext( iiopProperties );
-
-
// Bind the object to the IIOP registry
-
iiopContext.rebind( "Phone Directory", myObject );
-
-
System.out.println( "Hello from server, ready for action..." );
-
}
-
catch ( Exception exception ) {
-
exception.printStackTrace ();
-
}
-
}
-
}
-
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.
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
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
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
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?
why it can not find it?
You have - import PhoneDirectory.PhoneDirImpl;
But you said they are in the same directory?
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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.
|
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...
|
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
|
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...
|
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
| |
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{
|
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...
|
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...
|
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
|
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...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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();...
|
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...
| |
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...
| |