עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

כמה בעיות ב-RMI בג'אווה

Featured Replies

פורסם

אני מתנסה קצת עם RMI אבל נתקלתי במספר קשיים כבר בשלבים הראשונים.

יש לי שרת שרץ על הלפטופ שלי, ויש Client שרץ על המחשב הנייח. הבעיה היא שמשום מה הם לא מצליחים לדבר ביניהם.

האקספשן שאני מקבל בצד של הלקוח נראה כך:

http://pastebin.com/34mHBwdx

הקוד של הקליינט עצמו נראה כך:

http://pastebin.com/fdurg7zr

והקוד של השרת נראה כך:

http://pastebin.com/ZK4HsRdE

כמובן ששני המחשבים נמצאים באותה רשת, ו-telnet בין הקליינט לשרת על פורט 1099 עובד.

את השרת אני מריץ עם הארגומנטים הבאים:

-Djava.rmi.server.codebase=file:C:\Users\Dan\Documents\NetBeansProjects\Server1\build\classes\ -Djava.security.policy=C:\Users\Dan\Documents\NetBeansProjects\wideopen.policy

כאשר הקובץ נראה כך:

grant {
// Allow everything for now
permission java.security.AllPermission;
};

יש למישהו מושג מה יכול להיות מקור הבעיה? :\

עריכה: אני נתקל באותה בעיה גם כשאני מריץ שרת על המחשב המקומי והקליינט פונה ל-localhost... :-\

עריכה 2: הוספתי את אותו ארגומנט java.security.policy גם להרצה של הקליינט, ועכשיו הוא זורק שגיאה של java.lang.ClassNotFoundException. מה אני עושה לא נכון?

עריכה 3: נראה לי שזה עובד :)

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.