- This topic has 12 replies, 3 voices, and was last updated 21 years, 4 months ago by Scott Anderson.
-
AuthorPosts
-
simonMemberHello,
Sorry that I have to ask you question so quickly.
I was trying to create a new EJB Module, say called myEJB, but I am getting error message on the ejb-jar.xml file. The message is:
The content of element type “ejb-jar” is incomplete…..The location is on line 4 which is the closing tag of “ejb-jar”.
The strange thing is that, when I open the ejb-jar.xml file of another EJB module that I created a while ago, it looks exactly the same as the one with error.
Do you know why? Thanks.
simon.
simonMemberForgot to mention that this ejb-jar.xml file is generated automatically when I create a EJB Module, using the wizard. And I did not make any change to the file whatsoever.
This is what my file looks like:
//code begin—————–
<?xml version=”1.0 encoding=”UTF-8″?>
<!DOCTYPE ejb-jar PUBLIC “-//Sun Microsystems……………..>
<ejb-jar>
</ejb-jar>
//code end—————–Thanks.
simon.
support-michaelKeymasterThis is a bug that will be removed in the upcoming 2.5.2 maintenance release. The issue is that the the ejb-jar.dtd requires at least 1 ejb be defined in the deployment descriptor. The MyEclipse EJB wizard seeds an EJB Project with an ejb-jar.xml file but since the project initially does not contain any ejbs then none are defined in the ejb-jar.xml. The result is an invalid deployment descriptor upon project creation (booh!). Once you add an EJB to your project using the EJB Wizard the deployment descriptor will be updated and the error marker removed. In 2.5.2 no deployment descriptor will be created until you add an ejb to the project.
Regards,
Michael
MyEclipse Support
simonMemberWell, as always, a quick reply with a **real** solution. Not those useless replies I usually get from other forums. You’re the man, Scott! Genuitec needs to give you a raise. =)
Thanks.
simon.
Scott AndersonParticipantSimon,
You’re the man, Scott! Genuitec needs to give you a raise. =)
While I truly appreciate the sentiment (and will forward it to my management :-), it was actually Michael who answered that question for you. He deserves a raise too, though.
–Scott
MyEclipse Support
simonMemberOops, I should have tried it first before I replied.
I added 2 interfaces and 1 session bean to the EJB Module that has ejb-jar.xml problem. The error markers remain there. Then, I continued to add a JSP page. I am now getting error message on the JSP page where I import the objects that the “com.simon” cannot be resolved….
<%@ page import=”com.simon.*,javax.ejb.*,………”%>Do you think this is related to the fact that the error on ejb-jar.xml file has not been resolved?
Whether you resolve my problem or not, IMHO, you still deserve a raise. It is because you are so diligent and so dedicated to your work. =)
By the way, these are my setup in case you need to know:
Eclipse 2.1.1
MyEclipse 2.5.1
jboss-3.2.1_tomcat-4.1.24 server
JDK 1.4.2
Windows 2000 pro.Thanks.
simon.
Scott AndersonParticipantSimon,
I added 2 interfaces and 1 session bean to the EJB Module that has ejb-jar.xml problem. The error markers remain there.
I believe what Michael was referring to was not manually adding an EJB. He assumed you’d use our wizard and then have XDoclet generate the interfaces and ejb-jar.xml file for you, which would remove the error marker. He shortened the full description a bit.
Then, I continued to add a JSP page. I am now getting error message on the JSP page where I import the objects that the “com.simon” cannot be resolved….
<%@ page import=”com.simon.*,javax.ejb.*,………”%>Is the JSP under your designated web root directory? Are the com.simon Java files in your designated source directory? Is your source directory configured to place compiled files in <webroot>/WEB-INF/classes? Are the compiled files there when inspected with the Navigator view?
Do you think this is related to the fact that the error on ejb-jar.xml file has not been resolved?
No, it’s unrelated.
Whether you resolve my problem or not, IMHO, you still deserve a raise. It is because you are so diligent and so dedicated to your work. =)
Well thank you very much. But please don’t feel to bad for me. All our support folks are also Genuitec J2EE consultants so we make substantially more than is typical for product support. Truthfully, we’re pretty nicely compensated and doing support is often easier than a lot of the other stuff we do. 😉
–Scott
MyEclipse Support
simonMemberI believe what Michael was referring to was not manually adding an EJB. He assumed you’d use our wizard and then have XDoclet generate the interfaces and ejb-jar.xml file for you
Make sure I got it right. I created a J2EE Enterprise Application Project using the New Project wizard. I then created the EJB module using the same wizard. After that, I right click on the EJB module to select the “create EJB (session, entity, message)” wizard. In the wizard, I entered “com.simon” as the package, the EJB’s name, then leave everything else as default. Is it correct?
Is the JSP under your designated web root directory?
I also created a web module, under the Enterprise Application. Then I created the JSP page under the web module, using the wizard.
Are the com.simon Java files in your designated source directory? Is your source directory configured to place compiled files in <webroot>/WEB-INF/classes? Are the compiled files there when inspected with the Navigator view?
com.simon and the associated classes are not in the web module’s Java Source folder. They reside under the EJB module. Now, under the web module’s property, I added the path to com.simon to the Libraries tab. Will that work? I am not sure if I answer all the questions you asked.
Thank you very much for your help.
simon.
Scott AndersonParticipantSimon,
Re: EJB creation steps. That is correct to create the XDoclet EJB template file, but it doesn’t generate the interfaces and descriptors until you configure XDoclet for the project and run it. Information on this is in the MyEclipse user guide under Tasks > Working with EJBs. Follow through the steps there to fully create an EJB. The tutorial chooses the bean name, package name, and source directory so that it coincides with XDoclet’s default values so please run it the first time exactly as shown. You can then modify it, and your XDoclet settings as needed, if you like different naming conventions.
com.simon and the associated classes are not in the web module’s Java Source folder. They reside under the EJB module. Now, under the web module’s property, I added the path to com.simon to the Libraries tab. Will that work? I am not sure if I answer all the questions you asked.
Typically the preferred way to specify a web project to ejb project dependency is to literaly make the web project reference the EJB project on the Properties > Java Build Path > Projects tab and on the Properties > Project References tab, rather than directly placing it on the libraries tab. This setup mimics what the J2EE classloaders do at deployment.
–Scott
MyEclipse Support
simonMemberFollow through the steps there to fully create an EJB.
Good, I will do that later today.
Typically the preferred way to specify a web project to ejb project dependency is to literaly make the web project reference the EJB project on the Properties > Java Build Path > Projects tab and on the Properties > Project References tab
Actually, I have done that. I have tried different combination of referencing and it didn’t work, so I unchecked them and added the library reference.
Now, I have a problem. I added the project reference back to the web module. Then deployed it thru the wizard. Now my IDE will not launch. I looked at the log file under workdpace/.metadata, there are error messages as followed:
//messages begin———————————
!SESSION Jul 28, 2003 13:35:46.412
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/
!ENTRY org.eclipse.ui 4 4 Jul 28, 2003 13:35:46.412
!MESSAGE Unable to find Action Set: com.genuitec.myeclipse.actions.server
!ENTRY com.genuitec.eclipse.easie.jboss3 1 1 Jul 28, 2003 16:12:01.770
!MESSAGE Error starting JBoss: JBoss JDK name
!ENTRY com.genuitec.eclipse.easie.jboss3 1 1 Jul 28, 2003 16:18:03.187
!MESSAGE Error starting JBoss: JBoss JDK name
!ENTRY com.genuitec.eclipse.easie.jboss3 1 1 Jul 28, 2003 16:31:29.52
!MESSAGE Error starting JBoss: JBoss JDK name
!SESSION Aug 01, 2003 11:57:49.815java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/
!ENTRY org.eclipse.jface 4 2 Aug 01, 2003 11:57:49.835
!MESSAGE Problems occurred when invoking code from plug-in: “org.eclipse.jface”.
!STACK 0
<snipped>
………….
!SESSION Aug 12, 2003 17:15:54.900
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/
!ENTRY org.eclipse.ui 4 4 Aug 12, 2003 17:15:54.900
!MESSAGE Unable to find Action Set: com.genuitec.myeclipse.actions.server
!SESSION Aug 13, 2003 15:26:38.46
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/
!ENTRY org.eclipse.ui 4 0 Aug 13, 2003 15:26:38.46
!MESSAGE myAppEJB does not exist.
!ENTRY org.eclipse.jdt.core 4 969 Aug 13, 2003 15:26:38.76
!MESSAGE myAppEJB does not exist.
!ENTRY org.eclipse.ui 4 4 Aug 13, 2003 17:03:44.220
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Aug 13, 2003 17:03:44.220
!MESSAGE
!STACK 0
<snipped>
…………….
//messages end———————————I am planning to re-install Eclipse since this is not my production instance. Please advise if you know what’s causing the problem.
Thank you very much.
simon.
Scott AndersonParticipantSimon,
!MESSAGE Unable to find Action Set: com.genuitec.myeclipse.actions.server
This isn’t a problem. There is no server action set anymore since we consolidated it with another one in the production build. This is just a warning.
!ENTRY org.eclipse.ui 4 0 Aug 13, 2003 15:26:38.46
!MESSAGE myAppEJB does not exist.This one is weird, but probably also just an informational message, based on the date stamp it doesn’t seem to be the problem.
!ENTRY org.eclipse.ui 4 4 Aug 13, 2003 17:03:44.220
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Aug 13, 2003 17:03:44.220
!MESSAGE
!STACK 0
<snipped>This one is the problem. But the details most likely like in the snipped section so it’s impossible to tell what the root cause is.
–Scott
MyEclipse Support
simonMemberFYI…. before I reinstall Eclipse, I thought I will try reboot first. It works. Eclipse can launch now.
This one is the problem. But the details most likely like in the snipped section so it’s impossible to tell what the root cause is.
I snipped the log because I don’t want to post a very long message. The following is the entire section of the log in case you are interested:
//messages begin——————————-
!SESSION Aug 13, 2003 15:26:38.46
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/
!ENTRY org.eclipse.ui 4 0 Aug 13, 2003 15:26:38.46
!MESSAGE myAppEJB does not exist.
!ENTRY org.eclipse.jdt.core 4 969 Aug 13, 2003 15:26:38.76
!MESSAGE myAppEJB does not exist.
!ENTRY org.eclipse.ui 4 4 Aug 13, 2003 17:03:44.220
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Aug 13, 2003 17:03:44.220
!MESSAGE
!STACK 0
java.lang.IllegalArgumentException:
at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:56)
at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:41)
at org.eclipse.core.runtime.Status.setMessage(Status.java:147)
at org.eclipse.core.runtime.Status.<init>(Status.java:66)
at org.jboss.ide.eclipse.core.AbstractPlugin.wrapException(AbstractPlugin.java:233)
at org.jboss.ide.eclipse.xdoclet.run.configuration.ProjectConfigurations.storeConfigurations(ProjectConfigurations.java:196)
at org.jboss.ide.eclipse.xdoclet.run.ui.properties.ConfigurationPropertyPage.performOk(ConfigurationPropertyPage.java:78)
at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:671)
at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:218)
at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1838)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1545)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:583)
at org.eclipse.jface.window.Window.open(Window.java:563)
at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:164)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1838)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1545)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
//messages end———————————Also, I didn’t read the log far enough the first time. This time when I read it again, I found this section at the bottom:
//messages begin———————————
!SESSION
!ENTRY org.eclipse.core.launcher 4 0 Aug 14, 2003 08:18:24.128
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
Caused by: java.lang.reflect.InvocationTargetException
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:861)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
… 7 more
Caused by: org.eclipse.swt.SWTError: Cannot initialize Drop result = -2147023174
at org.eclipse.swt.dnd.DND.error(DND.java:220)
at org.eclipse.swt.dnd.DropTarget.<init>(DropTarget.java:131)
at org.eclipse.ui.internal.ShortcutBarPart.initDragAndDrop(ShortcutBarPart.java:189)
at org.eclipse.ui.internal.ShortcutBarPart.<init>(ShortcutBarPart.java:171)
at org.eclipse.ui.internal.WorkbenchWindow.createShortcutBar(WorkbenchWindow.java:626)
at org.eclipse.ui.internal.WorkbenchWindow.configureShell(WorkbenchWindow.java:582)
at org.eclipse.jface.window.Window.createShell(Window.java:350)
at org.eclipse.jface.window.Window.create(Window.java:301)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1258)
at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1223)
at org.eclipse.ui.internal.Workbench$12.run(Workbench.java:1141)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1006)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.Workbench.openPreviousWorkbenchState(Workbench.java:1093)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:870)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1373)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
… 8 more
//messages end———————————Anyway, to recap, I will work on the XDoclet later today to solve the ejb-jar.xml problem. As of the JSP, all I need to do is to reference the EJB module in the web module’s Build Path. Nothing else. Correct?
Thank you very much for your help.
simon.
Scott AndersonParticipantSimon,
Looks like you had some SWT errors starting up. Eclipse using native widgetry and over time has been known to keep a few too many of them. Once all the native widgets run out, you need to reboot. I’ve had it happen to me several times. You issue looks similar and it is something that the Eclipse team is looking into, according to the newsgroups.
As of the JSP, all I need to do is to reference the EJB module in the web module’s Build Path. Nothing else. Correct?
That should do it, and our Enterprise Project Wizard sets up that dependency when it creates the projects.
–Scott
MyEclipse Support -
AuthorPosts