This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / HELP!!! HELP!!! J2EE application configuration problems.
-icanada(I can!);
2005-4-7
{963}
(#2226749@0)
-
没用过jboss,不明白你卡在哪了。通常的做法是servlet load configuration, pass it to slsb, then persistence layer(entity bean, jdbc, hibernate or whatever),应该是不会有任何问题的。
-xanada(㊣流水);
2005-4-7
(#2226767@0)
-
I just don't know where to put the XML file and how EJB (say sessionBean) can access the XML file for J2EE application configuration.
-icanada(I can!);
2005-4-7
(#2227066@0)
-
xxxxx.class.getResourceAsStream("file path")
-macsym(日进斗斤);
2005-4-7
(#2226784@0)
-
But file access is not alowed in EJB. Enven though, in my application, XML file is accessed by a singleton class and EJB call this class. I am not sure this is good or not.
-icanada(I can!);
2005-4-7
(#2227060@0)
-
No, you can read file from ejb, package it in JAR. I've did it before for read public key file. in your case, maybe put it as env-entry in deployment descriptor file.
-macsym(日进斗斤);
2005-4-7
(#2227258@0)
-
or storing environment entry elements (env-entry) into the deployment descriptor.
-macsym(日进斗斤);
2005-4-7
(#2226806@0)
-
Suggestion, using a help class to load the conf xml from startup listener, pass it on to EJB containeryou are right, EJB should never access resource directly, (could be fired if my team member doing that, ), a help class to load the config in web startup listener, later on pass this config to application context that EJB container could access. Using a lookup class to find the config and keep in cache for performance. This is not a specific Jbosss related implementation, but JBoss has it own class loader, which is too container specific, not suggest to use that.
-lubx(黑白世界*大漠孤烟);
2005-4-7
{468}
(#2227189@0)
-
我觉得这是正解.只是不明白1.EJB container 如何访问application context? 2.如何lookup config,3 如何keep in cache
-richwin();
2005-4-7
(#2227247@0)
-
there are three options that i could think of right now.......
-lubx(黑白世界*大漠孤烟);
2005-4-7
{524}
(#2227380@0)
-
Don't make sample things complex. I don't think it's best way.
-macsym(日进斗斤);
2005-4-7
(#2227397@0)
-
你对, 俺经常OVER ENGINEERING
-lubx(黑白世界*大漠孤烟);
2005-4-7
(#2227414@0)
-
This typical problem has been discussed for long long time...
-yuanzidan(原子弹);
2005-4-7
{798}
(#2227259@0)