bob morkos

Ranch Hand
+ Follow
since Oct 06, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by bob morkos

Could anyone tell me why I get the following error?

javax.servlet.ServletException: java.lang.ClassNotFoundException: oracle.jdevimpl.jsp.JspOjcCompiler
at oracle.jsp.runtimev2.JspPageTable.preparePageCompiler(JspPageTable.java:492)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:270)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:560)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:479)
19 years ago
I have the following structure

EAR
--meta-inf/MANIFEST.MF
BootStrap.properties
*.jar
application.xml
dataSources.xml
...

The content of MANIFEST.MF is as the following:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.4
Created-By: 9.0.3.738 cdov (Oracle Corp.)
Class-Path: BootStrap.properties

But when I run the program I get the following error:
java.lang.ExceptionInInitializerError: java.util.MissingResourceException: Can't find bundle for base name BootStrap, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:712)

The java code is as the following:



So, I dont know what I did wrong could anyone help? It seems that the property is not loaded from the ear, dont know why? Any help or ideas would be appreciated. Thanks in advance.
19 years ago
That sounds like a solution for my problem. Can I set the classpath with a directory. Saying that any files under this directory, such as c://oc4j/j2ee/home/conf/a/properties/ (*.properties) Is there a way to do this, with your code below?


Originally posted by Stan James:
Just for completeness ... you can hack the classpath with unsupported calls to protected methods. Does that sound like hunting for a gas leak with a match? The custom classloader sounds safer.

19 years ago
Yes, I have TWO datasource files having different "content". But, I cannot put the file within the ear. If this was the case than I would not have any problem, because it works. The problem is that I want to externalize the properties and not put it in the ear. What I'm looking for is a way to do it in Java to set the classpath during runtime. I need help, because I never did it and any help would be greatly appreciated. Thanks for your response, but I'm looking for some way to do it during runtime.

Originally posted by Maulin Vasavada:
Hi Bob,

I didn't understand the following,
use the same datasource.xml file but the implementation is different for each one of them.

To me it looks like, you have TWO datasource files having different "content". XML DTD may be same for the files but the content is different. Is that what you have? If that is the case then I wouldn't put it as "Two EARs use the same file..." OR I didn't understand when you said "different implementations of the same file". How one can have "implementations" of the file??

Now, saying that, one way would be to just put those files in respective packages directory and getResourceAsStream() things would work for you to get the correct file as it would look for in the package first...

Please correct me if I am wrong.

Regards
Maulin

19 years ago
My problem is that I have 2 ears as the following 'A.ear' and 'B.ear' they both use the same datasource.xml file but the implementation is different for each one of them. So, If I put it in the server classpath it would be able to load the right one. So, the requirements is to externalize the properties and xml files to the server.

A.ear would load the CLASSPATH > %SERVER_APP_SERVER%/conf/a/xml/* (eg: datasource.xml)

B.ear would load the CLASSPATH > %SERVER_APP_SERVER%/conf/b/xml/* (eg: datasource.xml)

The way, I want to go about it is by place within each ear a config.property
which has the classpath to set. What I need is to find a way to do it dynamically in Java like:

XXX.setClassPath(c c4j/j2ee/home/conf/b/xml/dataSource.xml);

How can I do this in Java, could you show me with some code or direct me in some way. Any help would be greatly appreciated.



Originally posted by Ernest Friedman-Hill:
You can't "set the classpath" in general, because there's no one single class path. Every ClassLoader has its own idea of how to load classes and where to find them. In an app server there are generally many class loaders in operation.

What you can do is create your own ClassLoader which knows where you want to find classes, and use it to loaded the classes of interest. The class java.net.URLClassLoader is a standard class loader that lets you hand it a class path to use -- you may be able to simply use that.

Anybody just starting out with classloaders would do well to study the papers of the great sage Ted Neward.

You need to be careful, though, because you don't want to confuse the appserver. Furthermore, the appserver may prohibit this via Java's security mechanisms.

19 years ago
I have an ear that I deploy which contains a property that has the classpath for which to use. Anyways, I was wondering if in my java, I could dynamically setClasspath(String path). Could anyone help, thanks in advance. I must find a way to set dynamically the classpath in my java code.
19 years ago
I get the following error, could anyone help?

[error]
java.lang.IllegalMonitorStateException: current thread not owner at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420)
[/error]

I get the following error, could anyone help?

[error]
java.lang.IllegalMonitorStateException: current thread not owner at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420)
[/error]

19 years ago
I have different configuration for property files and need to externalize them. For example datasource.xml is one of them and is used for FRS.ear and EAS.ear It has the same file name but different parameter content, how can I do this? Any ideas or help would be appreciated?
19 years ago
I'm getting the same problem, could you tell me what you have done to fix it.

Originally posted by N Naga:
Hi

I am using following code to test our LoginAction (Struts Frame work)


public void testSuccessfulLogin() {

setConfigFile("edrs", "/WEB-INF/struts-config.xml");
setRequestPathInfo("/edrs", "/loginAction.do");

String pathInfo = "/loginAction";
logger.debug(
"Entering+servletunit.struts.CactusStrutsTestCase.setRequestPathInfo() : pathInfo = "
+ pathInfo);
logger.debug("START --Setting Request Parameters");
addRequestParameter("username", "xyz");
addRequestParameter("password", "xyz");
addRequestParameter("action","logon");
logger.debug("END --Setting Request Parameters");
actionPerform();
logger.debug("AfterAction Perform --Setting Request Parameters");
verifyForward("success");
verifyForwardPath("/WEB-INF/jsp/welcome.jsp");
LoginForm loginForm=(LoginForm)getActionForm();
logger.debug("USerName :::::"+loginForm.getUsername());
logger.debug("Compare user id");
verifyNoActionErrors();
}

It's giving me the following error


null

java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:389)
at weblogic.servlet.internal.WebAppServletContext.setAttribute(WebAppServletContext.java:669)
at org.apache.cactus.server.AbstractServletContextWrapper.dispatch115_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj[1k]:129)
at org.apache.cactus.server.AbstractServletContextWrapper.around115_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1158)
at org.apache.cactus.server.AbstractServletContextWrapper.setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj[1k]:127)
at org.apache.cactus.server.AbstractServletContextWrapper.dispatch115_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj[1k]:129)
at org.apache.cactus.server.AbstractServletContextWrapper.around115_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1151)
at org.apache.cactus.server.AbstractServletContextWrapper.setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj[1k]:127)
at servletunit.struts.CactusStrutsTestCase.tearDown(CactusStrutsTestCase.java:129)
at org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:156)
at org.apache.cactus.server.AbstractWebTestController.dispatch133_handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj[1k]:130)
at org.apache.cactus.server.AbstractWebTestController.around133_handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1158)
at org.apache.cactus.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj[1k]:101)
at org.apache.cactus.server.ServletTestRedirector.dispatch160_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:125)
at org.apache.cactus.server.ServletTestRedirector.around160_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1158)
at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:109)
at org.apache.cactus.server.ServletTestRedirector.dispatch159_doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:96)
at org.apache.cactus.server.ServletTestRedirector.around159_doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1158)
at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)


Am I missing any thing. I am new to cactus. I want to test out struts action class such as forward path, actionForm, ActionMapping.

Can any one help me. I am missing something.

19 years ago
The class name is not important. I just renammed it anyhting. What I need is the configurations steps cactus.properties, web.xml, ...


Originally posted by Lasse Koskela:
Have you tried renaming the class to TestFbbEJB? (I'm not sure what's the mechanism Cactus uses to identify test cases so this is just me guessing)

19 years ago
What do I require to test an EJB. I dowloaded the necessay jars and wrote this test:


[edit: I formatted the code a bit in order to avoid having the page stretch beyond what's comfortable in a 1024x768 screen]
[ November 03, 2004: Message edited by: Lasse Koskela ]
19 years ago
I need to Deliver myJava Application in One-JAR, Is it possible to load the manifest in main jar that sets the classpath of all the libs .

I have this structure

com/xxx
lib/xxx.jar
properties/xxx.jar
Meta-inf/Manifest.mf

In the Manifest.mf this is what is set below:



Now, I can't run this jar from a command line, it does not find the libs. Can anyone help?
20 years ago
This is the format that I want to read "YYYYMMDD_HHMMSS_FV.BPO", However I only know the Date Format YYYYMMDD and I have no clue "HHMMSS". Is there a way, to read the above format by using a wild card or something?

Calendar c = Calendar.getInstance();
c.setTime(this.processDate);
int month = c.get(Calendar.MONTH) + 1;
String sMonth = null;
if (month < 10) {
sMonth = "0" + month;
} else {
sMonth = Integer.toString(month);
}
int days = c.get(Calendar.DAY_OF_MONTH);
String sDays = null;
if (days < 10) {
sDays = "0" + days;
} else {
sDays = Integer.toString(days);
}
int years = c.get(Calendar.YEAR);
String sYears = Integer.toString(years);

String dateFormatStr = sYears + sMonth + sDays;
String fileName = dateFormatStr + "_" + * + "_" + "FV.BPO";
20 years ago
<class name="com.desjardins.vmd.disnatv.hub.messages.MfGetOrderInfoRp" auto-complete="true">
<map-to xml="mf-get-order-info-rp" />
<class>