Jeff Pierce

Greenhorn
+ Follow
since Jan 04, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff Pierce

I should add I only want to change it for servlet "fred", not all the other servlets within the web.xml.
I want to take an existing web.xml file and transform it directly only changing a single <init-param>/<param-value> in the process and I can't seem to find the best way.

For example, I want to transform the listing value from true to false.



To this:

I don't want to be required to have a project that maps to a directory on the file system. The resources that I want to navigate/edit/manage don't exist on the file system either, they exist in my "app server". An example of this type of application could be a web site browser where you point your Eclipse project at a URL and what appears is a navigator view of the web site, a simple properties page, and an HTML editor. Another example might be if you have a J2EE application and your model is a bunch of EJBs you want access to from Eclipse.

Is this possible? If so, where is a good place to start? What objects within Eclipse should I be focusing on?

Thanks.
If you are doing servlet development from Eclipse, you should get a plug-in such as the Sysdeo Eclipse Tomcat Launcher plugin, which is what I use. This allows you to create .war files, debug servlets,... Keep in mind Tomcat is only a servlet engine, not a full blown J2EE stack.
I am developing an Eclipse plug-in that needs to access our EJBs using JBoss 4.0 and I am getting org.jnp.interfaces.NamingContextFactory class not found exceptionson with the JNDI lookups. I have tried putting the jbossclient-all.jar file as a dependent run-time library and even tried putting it in it's own plug-in and specifying as a dependent plug-in without luck. I assumed it must be related to how Eclipse handles classloaders with plug-ins so next I tried setting my own context classloader and that appears to work (see the code below).

Does anyone know if that is safe and the proper way to handle this exception?
Where is the best place to put such code? For now, I am setting it in my plug-ins start method and things appear to be OK.

Here is the code:
I have setup JBoss to use PostgreSQL 8.0.0-beta4 on Windows as the default data source. EBJs and JMS seem to be working fine. However, on subsequent JBoss startups, the EJBTimerService throws an exception as shown below. I am using JBoss 4.0.0. For now I can get by using the noop persitence policy. I found this bug report CreateTableDDL but I don't know how or if DatabasePersistencePolicy.createTableIfNotExists is a config option.

Is there more config I need to change?

Thanks.

Exception:

ObjectName: jboss.ejb ersistencePolicy=database,service=EJBTimerService
state: FAILED
I Depend On: jboss.jca:name=DefaultDS,service=DataSourceBinding

Depends On Me: java.sql.SQLException: ERROR: relation "timers" already exists

MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.ejb ersistencePolicy=database,service=EJBTimerService
state: FAILED
I Depend On: jboss.jca:name=DefaultDS,service=DataSourceBinding

Depends On Me: java.sql.SQLException: ERROR: relation "timers" already exists
19 years ago
I am currently generating my jboss-service.xml file using xdoclet. However, now I have a need to add a <depends> element to my service <mbean> config. Does anyone know if there is an xdoclet tag to generate this element? I can't seem to find it if there is.

Version: xdoclet 1.2.1
JBoss 4 RC1
JBoss IDE 1.3.30
Thanks.
19 years ago
The Java console allows you to run a command (x) called "clear classloader cache" when running an applet.
Is it possible to call into the Java plug-in and run this command from something like Javascript or even an applet itself? Maybe a parm on the OBJECT tag or EMBED tags? Or even using the DOM? I haven't been able to find it if there is.
I have a need to basically flush the JVM the browser has loaded. I need more than running the garbage collector or finalizers.
Thanks.
22 years ago
You may have to use the fully qualified class name in the forward(com.myapp.action.myServletB.
What are you seeing for the url in you servlet log?
22 years ago
Yes, you can pass a param.
Use the call method of JSObject.
Be sure your javascript accepts a param and you include the MAYSCRIPT attribute in you applet tag.
22 years ago
I have been trying to get my applet to call a Javascript function from within NS6. It works in IE. I am using the OBJECT/EMBED tags. (note: works also in Communicator with APPLET tag).
I am getting a JSObject exception upon my first call to JSObject.getWindow(this). I did discover if I put mayscript in uppercase, the above call would return "null" so I think I am getting farther.
I am also using dynamic class loading in my applet but I have tried both. I don't have a java40.jar file with the JS classes in them other than the one from Communicator 4.7. I have also tried using the java40.jar in my applet build with NS 6 without luck.
Here's my tags:
<!--"CONVERTED_APPLET"-->
<!-- HTML CONVERTER -->
<!-- TAGS COMMENTED OUT FOR POSTING -->
<!--
<OBJECT classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA"
WIDTH = "500" HEIGHT = "200" NAME = "CommandApplet" codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0">
<PARAM NAME = CODE VALUE = "MyCommandApplet.class" >
<PARAM NAME = mayscript VALUE = true >
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.1">
<PARAM NAME="scriptable" VALUE="true">
<COMMENT>
<EMBED type="application/x-java-applet;jpi-version=1.3.1"
CODE = "MyCommandApplet.class"
NAME = "CommandApplet"
WIDTH = "500" HEIGHT = "200"
maystript=true
scriptable=true
pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html">
<NOEMBED>
</NOEMBED>
</EMBED>
</COMMENT>
</OBJECT>
-->
<!--"END_CONVERTED_APPLET"-->
Here's my applet snippet:
<!--
public void showDialog() {
// called from a button on the applet this is loaded.
System.out.println(">>> showDialog()");
try {
JSObject jsRoot = JSObject.getWindow(this); // throws exception in NS6
// ... MORE STUFF HERE
System.out.println("Success!");
}
catch(Exception ex){
System.out.println("Exception!");
}
System.out.println("<<< showDialog()");
}
-->
Thanks.
22 years ago
I believe this a JApplet, you need to set the content pane directly. Here's an example:
public void init() {
setContentPane(makeContentPane());
}
public Container makeContentPane() {

promptButton = new JButton("Prompt");// todo nls
promptButton.setVerticalTextPosition(AbstractButton.CENTER);
promptButton.setHorizontalTextPosition(AbstractButton.CENTER);
promptButton.setMnemonic(KeyEvent.VK_P);
promptButton.setActionCommand(PROMPT);
promptButton.addActionListener(this);
promptButton.setToolTipText("Prompt on the selected command before executing it.");
commandField = new JTextField(20);
commandField.addActionListener(this);
JPanel pane = new JPanel();
pane.add(commandField);
pane.add(promptButton);

return pane;
}
22 years ago