Java guru - help!

Все, что вы хотели знать о программизме, но боялись спросить.
Ответить
Аватара пользователя
apkbox
Пользователь
Сообщения: 78
Зарегистрирован: 22 мар 2003, 21:43
Откуда: Ottuda

Java guru - help!

Сообщение apkbox »

[trn]Srochno nuzhen sovet po[/trn] Java
[trn]V [/trn]Ms java [trn] a tochnee v [/trn] J++ [trn] byla obaldennaja vozmozhnost' zastavit' gruzitsja klassy iz [/trn] IDE [trn] esli proekt startovan iz nego, dazhe, esli proekt ispol'zuet kastom klass loader.
Kak podobnoe sdelat' v [/trn] Sun Java?

Config:
Applet + IE (Sun VM)
IDEA - debugger attachment mode.
Applet - uses custom class loader to load jar files from server (no debug info).
Locally - same class files out of jar + debug info + source code.
Аватара пользователя
Marmot
Графоман
Сообщения: 38347
Зарегистрирован: 17 фев 2003, 17:58
Откуда: Canyon Heights
Контактная информация:

Сообщение Marmot »

Так как никогда не пользовался J++ :-), то я не понял: чего надо-то?
Чтобы из IE applet custom classloader загрузил local classes with debug info?
Аватара пользователя
apkbox
Пользователь
Сообщения: 78
Зарегистрирован: 22 мар 2003, 21:43
Откуда: Ottuda

Сообщение apkbox »

Aga.
Tried to use -Xbootclasspath in the java plugin, but does not seem it catches.
Аватара пользователя
Marmot
Графоман
Сообщения: 38347
Зарегистрирован: 17 фев 2003, 17:58
Откуда: Canyon Heights
Контактная информация:

Сообщение Marmot »

Чей custom classloader, твой?
Или ты имеешь ввиду тот classloader который грузит applet.
И, кстати, а почему ты не запускаешь applet прямо из IDEA? Какие-то принципиальные проблемы?
Аватара пользователя
apkbox
Пользователь
Сообщения: 78
Зарегистрирован: 22 мар 2003, 21:43
Откуда: Ottuda

Сообщение apkbox »

[trn]Malen'kij applet gruzitsja v brovzer, sozdaet instans klassloadera i dogruzhaet ostal'nye [/trn] jar'[trn]y.
Vne brovzera ne rabotaet po prichine togo, chto slishkom mnogo zav'jazano na server i [/trn] IE environment.
Аватара пользователя
Marmot
Графоман
Сообщения: 38347
Зарегистрирован: 17 фев 2003, 17:58
Откуда: Canyon Heights
Контактная информация:

Сообщение Marmot »

apkbox писал(а):[trn]Malen'kij applet gruzitsja v brovzer, sozdaet instans klassloadera i dogruzhaet ostal'nye [/trn] jar'[trn]y.
Vne brovzera ne rabotaet po prichine togo, chto slishkom mnogo zav'jazano na server i [/trn] IE environment.
Какой classloader, URLClassloader?
А что мешает сделать jar с debug info?
Если debug info нету, то никак по сорсам не пройтись, там номер строчек нужны.
А то что ты про J++ написал imho или нарушение спека или ты чего-то недопонял...
Аватара пользователя
Marmot
Графоман
Сообщения: 38347
Зарегистрирован: 17 фев 2003, 17:58
Откуда: Canyon Heights
Контактная информация:

Сообщение Marmot »

Кстати, цитата :-)

Applets are to Java as underpants are to Superman. Applets helped to launch awareness, adoption and acceptance of Java in the early days. To the non-hardcore, they're as much a part of the Java brand as Java itself. And yet, these days Sun treats applets as if they're the mutant offspring that they want everyone to forget existed; locked away in the basement, fed through a grill in the door, doomed to watch reruns of "I Love Lucy" in near-darkness for the next 20 years.

The general consensus seems to be that Java WebStart (JWS) has superseded applets. But applets still have a function to fill: dynamic content embedded directly in a web page. The trouble is (apart from the fact that Sun seem almost ashamed of this "hideous monster") that for a web designer, it just isn't very easy to create dynamic web content using applets.
Аватара пользователя
apkbox
Пользователь
Сообщения: 78
Зарегистрирован: 22 мар 2003, 21:43
Откуда: Ottuda

Сообщение apkbox »

I know, I know :lol: Но это не я кто определяет политику.
Кроме того:
1. Приложение - огромное и не так просто переносимое.
2. There are marketing and cost reasons not to do so in a given timeframe.

One the the technical side:
1. Classloader - similar to URL, but with other features like code signature verification. (All that because the solutuin was targeting JVM 1.1).
2. These jar files are deployed on a server similar to staging, so should be as they would be on production.
3. Process of instantiating the applet is very complex. Lots of info pullling from the server.

Just to get an idea, what I am trying to achieve, I would give and example, how the dev process currently organized.

1. We have a sever with published application.
2. The developer wanted to debug the application.
3. He takes the source code.
4. Starts J++ with the project and runs the debugger.
5. The debugger starts IE.
6. Developer uses this instance to login to the application (as result get eventually gets to the page with the applet).
7. When applet starts loading, on every class the debugger checks for the local version of the class and loads it, if it is there, otherwise falls through the regualar class resulution.


This is achieved because of this code in the ClassLoader.
When classloader tries to load the class, it looks up for preloaded classes. And that call is handled by J++ when in debug mode... so J++ can resolve this class using a local copy of the class.

loadClass(...)
{
try {
return findSystemClass();
}
catch( ClassNotFound )
{
data = myload();
return defineClass( data );
}
}
Аватара пользователя
Marmot
Графоман
Сообщения: 38347
Зарегистрирован: 17 фев 2003, 17:58
Откуда: Canyon Heights
Контактная информация:

Сообщение Marmot »

Ага, теперь стало понятно...
Я бы попробовал сделать jar file with debug info and put it into JRE_HOME\lib\ext on local system
...
В догонку, после обновления jar файла, надо не забыть убить все инстансы JVM которые его используют.
Аватара пользователя
apkbox
Пользователь
Сообщения: 78
Зарегистрирован: 22 мар 2003, 21:43
Откуда: Ottuda

Сообщение apkbox »

:? Mda. Worth to try, altoulgh, not quite a developer/development friendly solution... :(

Thanks anyway. Would have other ideas, mail me ah? :)
Аватара пользователя
Marmot
Графоман
Сообщения: 38347
Зарегистрирован: 17 фев 2003, 17:58
Откуда: Canyon Heights
Контактная информация:

Сообщение Marmot »

Ну уж какие задачи, такие и решения :-)
Да, насчёт убийства JVM, я имел ввиду те, которые стартует IE, IDEA убивать не надо ;-)

Если чего ещё в голову прийдёт, напишу...
Ответить