DcmOF is a class in your module, so you don't need to worry about how you load it. When you load external classes from libraries or other modules you need to load it through the openmrsclassloader (Context.loadClass())
I am out of ideas as to why the variable is not "persisting" as a static var on your classes. The problem with creating roles seems strange to me too. If you set the creator to a valid user it should just work in a subclass of ModuleActivator. Which method in the activator are you using? And can you attach a stack trace of the error? Ben 2011/10/19 Juan David Pastás Rivera <[email protected]> > I think I am messing some things: > > **** my first problem **** > > I want to call DcmOF.main and DcmRcv.main methods, which I changed to > return a DcmOF and DcmRcv objects from which I could call stop. I do not > have clear knowledge about the scope of the returned object (This object is > from whom I want to have a reference which I can use in a controller). > > You said me that with Context.loadClass("org.dcm4che2.tool.dcmof.DcmOF") I > can get the class loaded, but I think I need the instance to stop the > server. I am not sure where is good to put that instance, maybe as a spring > bean or do not know what other options are. > > **** my second problem **** > > Create order type and roles from Activator.startup(), this problem seems to > be caused by not to have an authenticated user at startup, because when I > call the code that creates the order type and roles with a authenticated > user accessing a route the order type and roles are created successfully. > > On Wed, Oct 19, 2011 at 1:31 PM, Ben Wolfe <[email protected]> wrote: > >> The only reasons I can think of are: >> 1) Its getting cleared/reset by something else >> 2) You're actually getting two different classes >> >> For the second one if would be a classloader issue. Is the class >> duplicated in another jar somewhere? Are you calling the right static >> class? >> >> (Please leave the previous email thread in your replies. It helps for >> those people on the list that /don't/ use gmail. :-)) >> >> Ben >> >> 2011/10/19 Juan David Pastás Rivera <[email protected]> >> >>> The static variable prints null from a controller. >>> ------------------------------ >>> Click here to >>> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from >>> OpenMRS Developers' mailing list >>> >> >> ------------------------------ >> Click here to >> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from >> OpenMRS Developers' mailing list >> > > ------------------------------ > Click here to > unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from > OpenMRS Developers' mailing list > _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

