Service Locator and JNDI Environment variables
Hi,
I have a class that implements the ServiceLocator pattern running into the container tier (not in a webapp), this class has a method that returns a Connection (java.sql). The problem is that I must hard code the JNDI name of the DataSource (or write it on a properties file), but I want to look for this name like a JNDI environment variable (java:comp/env/jdbc/dataSourceRefName). The class who calls the ServiceLocator is a DAO object, not an EJB. Is there any deployment descriptor tag or similar that let�s me register this name in the JNDI tree?
Thanks.
Hi Corujo-h,
You'll need to declare the resource-ref in the environment
section of the standard deployment descriptor of any component
from which you'll invoke this ServiceLocator. So, if it's invoked
from ejbs, you'll need to define the resource-ref for each ejb
in ejb-jar.xml.
--ken
Similar Messages
-
Oracle OC4J 904 and JNDI environment variable lookup up
Hi all, we are getting this when trying to run our app in Oracle 904:
org.springframework.beans.factory.access.BootstrapException: Define an environment variable [java:comp/env/ejb/BeanFactoryPath] containing the class path locations of XML bean definition files; nested exception is javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/BeanFactoryPath
javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/BeanFactoryPath
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
at javax.naming.InitialContext.lookup(InitialContext.java:345)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71)
at org.springframework.context.access.ContextJndiBeanFactoryLocator.useBeanFactory(ContextJndiBeanFactoryLocator.java:64)
at org.springframework.ejb.support.AbstractEnterpriseBean.loadBeanFactory(AbstractEnterpriseBean.java:117)
at org.springframework.ejb.support.AbstractStatelessSessionBean.ejbCreate(AbstractStatelessSessionBean.java:63)
at MethodInvokerHome_StatelessSessionHomeWrapper1.callCreate(MethodInvokerHome_StatelessSessionHomeWrapper1.java:115)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:275)
at MethodInvokerRemote_StatelessSessionBeanWrapper0.invoke(MethodInvokerRemote_StatelessSessionBeanWrapper0.java:77)
at java.lang.reflect.Method.invoke(Native Method)
at org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke(RmiClientInterceptorUtils.java:103)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor
Basically the app server thinks there is no environment entry but I have it declared in ejb-jar.xml descriptor:
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>applicationContext.prod.xml</env-entry-value>
</env-entry>
Any ideas,
JThat depends of the shell that you use.
If you use the bash than execute:
EXPORT ORACLE_SID=<YOUR_SID>
If you use csh:
setenv ORACLE_SID <YOUR_SID>
Bye, Aron -
Hi experts m new to apps please help.. I have installed successfully Oracle Apps R12 on OEL - 5 All the services runining fine. but when i am opening forms its giving error "install missing plugins" i installed jre-6u7-linux-i586-rpm.bin and Mozilla Firefox 3.0.18 [root@ust ~]# cd firefox/plugins/ [root@ust plugins]# ln -s /usr/java/jre1.6.0_07/plugin/i386/ns7/libjavaplugin_oji.so ./libjavaplugin_oji.so [root@ust plugins]# ls libjavaplugin_oji.so libnullplugin.so [root@ust plugins]# ll total 20 lrwxrwxrwx 1 root root 58 Sep 11 16:22 libjavaplugin_oji.so -> /usr/java/jre1.6.0_07/plugin/i386/ns7/libjavaplugin_oji.so -rwxr-xr-x 1 root root 19160 Sep 15 2007 libnullplugin.so [root@ust plugins]# but when m trying to open forms at that time giving error "install j2se plugin version 1.6.0_07 on your client and NPX_PLUGIN_PATH environment variable set before starting Netscape."
Linux is not a certified client tier for accessing EBS
Unable to access r12 forms in linux client
https://forums.oracle.com/search.jspa?view=content&resultTypes=&dateRange=all&q=linux+client&rankBy=relevance&contentTyp…
HTH
Srini -
Service Locator and session facade pattern
What are differences between Service Locator and session facade pattern?
For me it seems one and the same.
Please explain me in detail. Expecting kind help.
Thanks,
Rahul
Edited by: rahulb1 on Feb 26, 2008 5:07 PMrdoekes wrote:
The ServiceLocator Pattern is a singleton which hold a map of used DataSources. The idea is that you perform a lookup once and use the cache afterwards. The session facade is just one DataSource lookup.huh? Those J2EE patterns are not really reduced to datasources and the SessionFacade has actually nothing to do with datasources.
Session Facade
It has Facade in it and a Facade is usually used to give a simple entrypoint by providing a standartized interface. The same is now with the Session Facade. You have a Session bean that represents a high-level business component that interacts and calls lower-level business components.
Imagine having client a accessing 5 business objects with the remote calls, which is not an efficient way (network latency) or accessing the SessionFace and the session face is doing all the work through local access.
Service Locator
As J2EE components are using JDNI to lookup for ejb interfaces,DataSources, JMS components, connections etc. isntead of writing all the lookup in many code piecess across the project, you write a service locator that gives you a centralized place to handle the lookup's. It's easier to maintain and to control such a setup.
As you can see there's quite a big difference ;-)
cya,
Nail -
Runtime.exec and setting environment variables
Runtime.exec and setting environment variables
I need a decent example which works on Windows.
Got any?Thank you.
I was hoping for an example of the use of
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runti
e.html#exec(java.lang.String,%20java.lang.String[]) or
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runti
e.html#exec(java.lang.String,%20java.lang.String[],%20j
va.io.File) which take environment variable
information such as PATH.
The reason is because there is a library which is
being loaded via loadLibrary (
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Syste
.html#loadLibrary(java.lang.String) ). However, for
the child process to find the library the PATH needs
to be updated.
Any example regarding changing the PATH variable via
Java so that libraries can be loaded and processes
created? (Perhaps, I should make a new post and
restate the question with this more explicit
information?)
That won't work. LoadLibrary occurs in the JVM environment. As I said you can't change the JVM environment via exec().
If the shared library needs something in the path then you are going to have to set the path before your application starts up.
If you just need to load the library from someplace that is not on the path then you should be using System.load(). -
Installed jre and jdk and setup environment variable
installed jre and jdk and setup environment variable but still i am not able to rum program?
cannot find symbol class string
package system does not existif removing 1 jre will help your disk space problems
then you urgently need a bigger disk.
Btw i never notice Java installing 2 different JRE's
so i dont think it will harm remvong one, make sure
you dont delete one you are using :)I assume that you don't run MS os; that's the only one that installs 2 JRE's.
To OP: This has been discussed by Sun, but no changes have been announced. Maybe the relocation in version 1.5 of the private (aka developer) code to the Program Folder is a start of this change? -
Is there a way to store variables in a xml application config file and reference those variables in the java program? I can do this with Tomcat, but I have not found a way to do this with 9iAS. Mainly, I found not found which xml file to use.
Thanks.No there is no such thing in weblogic. You cannot use JNDI as a cache but
you can write your code to register/bind your rmi objects into the jndi
tree. And save your environment variables there.
Try using WebLogic Workshop for your development, you will be able to do all
this without having to write your own code as you can define application
wide properties there.
"Jacques Desmazieres" <[email protected]> wrote in message
news:[email protected]..
>
I think I have a very common problem, that seems to fit with JNDI service:
I need to define applicative variables shared by several applications, andthose
variables need to be defined at deployment time.
On Websphere, it is possible to define, from the App Server console, suchJNDI
entries : sort of Environment variables you access through a JNDI lookupto retrieve
the value.
With Weblogic I did not fine anything similar. Did I miss something ?
I have a constraint: the JNDI configuration must be persistent (stillavailable
after server restart) and must be defined during deployment and ifpossible, manageable
from the server console.
Thanks -
Service Locator and Performance?
We currently have an application with numerious EJBs. Obviously, this in turn involves
numerous JNDI look ups for these EJBs. Both the client (a web application) and
the EJBs run within the same JVM, however not as part of a singe EAR application
(the EJBs are deployed as standalone application modules). We do not have any
Service Locator (J2EE pattern) implemented. My question is, given this scenario,
will there be a performance enhancement if a Service locator is implemented to
cache JNDI look-ups? If so, Will this come into play if we deploy the app as an
EAR?
Thanks,
KrishThere are a lot of tools out there.
Here's what I've used:
On Windows/Linux, OptimizeIt and Jprobe are pretty common.
If you're using jrockit, try JRA
http://dev2dev.com/products/wljrockit81/analyzer.jsp
On HP-UX, I like HP's JMeter:
http://www.hpjmeter.com
-- Rob
Krish wrote:
Is there a Profiling tool that I could use to identify where most of the time is
being spent?
Thx,
Rob Woollen <[email protected]> wrote:
If your end goal is to improve performance, then I'd strongly encourage
you to spend some time tracking down where time is currently being spent.
In my experience, creating InitialContext objects can be expensive.
Lookups generally aren't that bad, but it's a reasonable approach to
cache both.
Basically, if you're spending a lot of time in JNDI lookups, then I'd
suggest doing the Service Locator pattern. If your time is being mainly
spent elsewhere, attack that first.
-- Rob
Krish wrote:
We currently have an application with numerious EJBs. Obviously, thisin turn involves
numerous JNDI look ups for these EJBs. Both the client (a web application)and
the EJBs run within the same JVM, however not as part of a singe EARapplication
(the EJBs are deployed as standalone application modules). We do nothave any
Service Locator (J2EE pattern) implemented. My question is, given thisscenario,
will there be a performance enhancement if a Service locator is implementedto
cache JNDI look-ups? If so, Will this come into play if we deploy theapp as an
EAR?
Thanks,
Krish -
Setting UI60_ICON and other environment variables
Hi, I am developing using forms 6i. I tried setting the UI60_ICON environment variable from
1. The Control Panel -> System -> Advanced -> Environment Variable -> System Variables and
2. The Registry Editor -> Edit ->New -> String Value
But my icons will still not appear in my forms. Can some one help me.
I do not add the .ico extension when I use the icon name. And I also make sure the icon has been place in the path I have stated. The icon appears when I place them in the FORMS60 environment variable.
I need help.Try to set with Registry Editor
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE (where you see FORM_PATH and other)
variable
UI_ICON instead UI60_icon
Hope helps -
XSL variable and unix environment variable
Any idea how I can pass the unix environment variable to the custom XSL file? I want to be able to pass the $PO_TOP path so the file location can be derived
The below code works fine for static file location but I want it to be more generic.
<fo:block xsl:use-attribute-sets="termcond">
<xsl:if test="($print_draft = '')">
<xsl:value-of select="unparsed-text('/usr/tmp/tc.txt','UTF-8')"/>
</xsl:if>
</fo:block>
<fo:block id="last-page"/>
Thanks in advanceyou'll need to use the name(.) XPath function to test the name of the current node.
-
Java and UNIX environment variables
Hi folks,
am I right when I say that it is not possible to access UNIX environment variables from Java (these ones delared by the export statement)?
Cheers,
HeikoYes.. Since some OS do not have the concept of environment variables,it is directly not possible.
But using the method System.getProperties you can get
some inf about the environment.
the following links may be of some help to you
http://www.javaworld.com/javaworld/javaqa/2001-07/01-qa-0706-env.html
http://www.jguru.com/faq/view.jsp?EID=11422 -
LMDefaultLayout and LMDefaultSkin environment variables not working?
Like the title says, I haven't been able to have these two variables working, neither with my custom Layout and Skin or with the "Classic" or "Top Menus" layouts and "Oracle" skin like the documentation shows as an example.
The objective is to have my custom Layout and my custom Skin set as defaults when a new user is created.
Has anyone made these variables or an optional solution work for this purpose?
Thanks in advance,
- Tiago DiasYou're right....... it worked.
The Content Server is case sensitive and the documentation is wrong......
Thanks! -
hello...
i have 2 classes...one.java and Two.java....
In two.java i extends One.java...
Two.java is not compiling....
if I place those 2 files in j2sdk1.4.1/bin folder ..then its compiling successfully.....please help me to solve this..Perhaps you mean that the java compiler cannot be found in any other directory but the bin directory. You need to add the bin directory to the PATH environmental variable to be able to compile classes anywhere in a command prompt/shell. If you are using windows, you'll find the environmental variables by:
1) right clicking my computer and choosing properties
2) click advanced
3) click environmental variables
Check here for more information about common setup problems:
http://java.sun.com/docs/books/tutorial/getStarted/problems/index.html -
Hi all, hope someone can help. I just upgraded to WL60 with SP1 and now all my
EJB are getting JNDI errors cant resolve name. Path and Classpaths have not changed,
in fact nothing has changed expect for the upgrade. Can anyone tell me what has
changed. I looked at the docs but didn't see anything significant. Thanks in
advance. JASCan you show us the error messages and asscoiated stack traces and the code
that is producing them?
JAS wrote:
Forgot to mention, I was using WL6.0 before.
"JAS" <[email protected]> wrote:
Hi all, hope someone can help. I just upgraded to WL60 with SP1 and
now all my
EJB are getting JNDI errors cant resolve name. Path and Classpaths have
not changed,
in fact nothing has changed expect for the upgrade. Can anyone tell
me what has
changed. I looked at the docs but didn't see anything significant.
Thanks in
advance. JAS -
Switch Your Service Location And Lose It All
I was scheduled for my Phone and DSL to switch on Aug 5 from my old place to my new place about 200 feet down the road. The service got switched off early on Aug 5, but has not been switched on at my new place...a co-op building where the wiring has not been touched, either in the apartment, or in the maintance room.
Yet the man I reached on Saturday said the line tested fine and that was that. I insisted he open a full ticket for a complete up and down examination at their end...and not just assume it was on my end.
And then they go on strike on Sunday, Aug 7.
Online the ticket says it will be resolved by Aug 16. Anyone care to hold their breath over that one?
The one thing you can bank on is that Verizon will send me a bill for the full amount during the service outage.Sorry to hear about the problem moving your service to your new building. If this still has not been corrected, please send me a private message so we can look into the order and provisioning.
Anthony_VZ
**If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan
Maybe you are looking for
-
I have been trying to understand some issues in my internet connections. If I do a traceroute to say, netflix.com I and get this rather long response: The 10.0.1.1 is my airport and I can ping it successfully. the 10.126.20.1 appears to be in my rout
-
Problems with Yahoo! business email since 3.0
iPhone 3G My business email, which is served by Yahoo, is not longer able to send messages from the phone. I can receive, but when the phone tries to load the Sent message folder, I get an error. Also, when I send a message, it makes the "sent sound"
-
RFC 0010 when FC report is refreshed in Infoview having prompts.
Hi, I have a FC report based on prompts. When I refresh in FC it works fine. The same report when refreshed in Infoview it throws the above error: No server was able to process the request. contact your administrator. RFC 00101. I have changed the ti
-
Hi All, I have one requirement, In the ALV report output if user selects one record and press one push button, a pop up should come Ex: If user selects SO and press DELETE button, then a pop up screen should come with all the serial nubers related to
-
Update BP function and department
Hi All, I have created a contact person with associated internet user using FM CRM_ISA_UA_IUSER_CREATE. This FM does not allow for BP central data. When I try to use FM BAPI_BUPR_CONTP_CHANGE I get the message that there is no relationship between