
Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
03.08.2014, 14:37
|
|||
|---|---|---|---|
|
|||
ejb lookup |
|||
|
#18+
Делаю lookup в сервлете Context ctx; HelloWorldLocal bean = null; try { ctx = new InitialContext(); bean = (HelloWorldLocal) ctx.lookup("java:global/custom/EJB2/HelloWorld!com.simple.beans.HelloWorldLocal"); } catch (NamingException e) { // TODO Auto-generated catch block e.printStackTrace(); } и в main public static void main(String[] args) throws NamingException { Context ctx = new InitialContext(); HelloWorldRemote bean = (HelloWorldRemote) ctx.lookup("ejb:custom/EJB2//HelloWorld!com.simple.beans.HelloWorldRemote"); System.out.println(bean.sayHiRemote()); } если нет jndi.properties файла, в сервлете все ок, а в main ошибка namingException. если добавляю jndi.properties в main все ок, а в сервлете javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory jndi.properties java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory java.naming.factory.url.pkgs=org.jboss.ejb.client.naming java.naming.provider.url=remote://localhost:4447 java.naming.security.principal=admin java.naming.security.credentials=1234 в чем проблема? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
03.08.2014, 14:38
|
|||
|---|---|---|---|
|
|||
ejb lookup |
|||
|
#18+
sergey_magic, в main такая ощибка javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
17.10.2014, 11:53
|
|||
|---|---|---|---|
|
|||
ejb lookup |
|||
|
#18+
Разобрался? Такая же проблема( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
17.10.2014, 11:55
|
|||
|---|---|---|---|
|
|||
ejb lookup |
|||
|
#18+
mytoffnaxРазобрался? Такая же проблема( В серлвете уже используется реализация InitialContext от контейнера и он должен подгрести все настройки контейнера. В main() всё зависит о того какие либы доступны в classpath. По-хорошему это должен быть специальный .jar из контейрена. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=59&mobile=1&tid=2126437]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
53ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
27ms |
get tp. blocked users: |
1ms |
| others: | 230ms |
| total: | 353ms |

| 0 / 0 |
