kv ruby

Ranch Hand
+ Follow
since Jul 23, 2009
Merit badge: grant badges
For More
Cochin
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by kv ruby

it could be solved by deploing the dependencies as shared library.

refer http://docs.oracle.com/cd/E15523_01/web.1111/e13706/libraries.htm#i1064656
12 years ago
Hi,

I have to deploy one application in weblogic which has several dependencies in another project. I was using OC4J server prior to Weblogic and it gives an option to mark another application as parent.

Is there a similar solution in Weblogic?
12 years ago
If only i could have got that point i dint understand that part and overlooked it. nyways thanks.
13 years ago
am quite new to Spring and thus was totally clueless what is going wrong.

Its resolved now I didnt know that bean has to be added in spring configuration file.

Its solved now
13 years ago

Prabaharan Gopalan wrote:At what point this code gets called? Are you sure that the applicationContext has finished loading by then? This could happen easily if you have Bean A which calls a Util class which tries to get Bean B from Application Context. But, there is always the chance that Bean B hasn't been loaded yet. You might want to explore the Application Context's life cycle to understand how things work before do this.

And did you wire DeferredUnlockerTest.class in your application context? And if you did, what's the issue in injecting that via the usual Spring way instead of ApplicationContextAware and then all the trouble of context.getBean()?



but my issue is in addLock() method the call doesnt pass check.thus applicationContext is not set.Now i want to know how to do that.
13 years ago

Prabaharan Gopalan wrote:It's still not clear on where you have this code (the two snippets - are they on the same file/different classes, how they're wired, what's your application-context looks like,..) and what you're trying to achieve.

I'd suggest you start with a smaller stand-alone Java application with Spring and have the bare minimum classes and try to achieve what you're trying to do now. That way you know what's going on and even if that doesn't work, you can share it here. (it might not be okay to paste your company's code here, so a prototype would be ideal, if things don't go well).



Ohh its that earlier i tried getting bean by beanFactory but then i changed to applicationContext. My class looks like below


My isue is when i call the method addLock() the getBean returns null and hence deferredUnlocker.getTransactionId() gives null pointer
13 years ago

Prabaharan Gopalan wrote:From the code you've posted, the only place the NPE could occur is at "this." and 'this' being null. Did you see any other error during the context loading period or can you load this bean the last so that we're sure all other beans are loaded before we hit this point?



sorry guess i had to explain more..NPE is not at the above code...i have tried the before mentioned code and the one below


and i have the same issue.

because applicationContext is not set at setApplicationContext method am not able to call a bean using getBean in my code and consecutively it throws an NPE. My issue is am not sure when is setApplicationContext method called. Should we explicitly call it or would the container initiate that call.
13 years ago
I have a class which implements BeanFactoryAware and thus i have overrided the method


but its not getting invoked and throws null pointer exception. I would ike to know how is BeanFactoryAware located and resolved in Spring?
13 years ago

Mark Spritzler wrote:Well, I get the web related data in my Controller and just pass them as parameters to my Service business layer classes.

Mark



Ideally this is the solution but that would introduce lot of code change in our case so trying a dirty fix.
13 years ago

Piyush Mangal wrote:You might set value in ThreadLocal and the get the same in business layer.




That seems to be a solution.Thankyou would investigate more about it.
13 years ago
I would like to get and set a session value that would be available through out the application.as request variables wouldnot be available in business layer would there be an option
to do this? something like getting webapplicationcontext and setting session values.

i know this is a dirty fix and session variables should not be passed beyond presentation layer but would still like to know a way to do this.
13 years ago
need to set certain values in session that would be global to whole application like in OC4j the code used to get Session was

Is there a similar solution in weblogic like getting a separate thread of weblogic or to get session from weblogic server context or anything else that would resolve this issue?
13 years ago
thanks a ton for the links.......it really helped
13 years ago
Actualy as we were using OC4J before our clients have license for that and for people who have license for OC4J,they can use the basic version of weblogic without payment. Of course few features would be blocked but am not sure which all features are blocked.
13 years ago
By basic weblogic i meant all the features that would be included on free version of Weblogic Server. We are using Spring and EJB in our application to develop web portal.
13 years ago