aspose file tools*
The moose likes Websphere and the fly likes Could not load resource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Could not load resource "META-INF/ejb-jar.xml" in archive " Watch "Could not load resource "META-INF/ejb-jar.xml" in archive " New topic
Author

Could not load resource "META-INF/ejb-jar.xml" in archive

naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Dear one and all,


We are getting below issue while building the code
We are using websphere 6.1 and Ant 1.8.1

Please help me.


o0748.02framework search path: c:\IBM\WebSphere\AppServer\deploytool\itp\pluginsorg.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceL
oadException: IWAE0007E Could not load resource "META-INF/ejb-jar.xml" in archive "C:\MNYL\build\ejbtemp.jar"
[exec] Stack trace of nested exception:
[exec] org.eclipse.emf.common.util.WrappedException: java.net.UnknownHostException: java.sun.com
[exec] at org.eclipse.wst.common.internal.emf.resource.EMF2SAXRenderer.doLoad(EMF2SAXRenderer.java:97)
[exec] at org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl.basicDoLoad(TranslatorResourceImpl.java:142)
[exec] at org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:173)
[exec] at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1094)
[exec] at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:900)
[exec] at org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResourceImpl.load(CompatibilityXMIResourceImpl.java:259)
[exec] at org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl.load(TranslatorResourceImpl.java:388)
[exec] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:249)
[exec] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:264)
[exec] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:390)
[exec] at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategyImpl.getMofResource(LoadStrategyImpl.java:347)
[exec] at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.getMofResource(ArchiveImpl.java:731)
[exec] at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl.getDeploymentDescriptorResource(ModuleFileImpl.java:61)
[exec] at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.preprocessArchives(BatchExtension.java:3610)
[exec] at com.ibm.etools.ejbdeploy.batch.plugin.BatchExtension.run(BatchExtension.java:295)
[exec] at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
[exec] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
[exec] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
[exec] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:618)
[exec] at com.ibm.etools.ejbdeploy.batch.impl.BootLoaderLoader.run(BootLoaderLoader.java:275)
[exec] at com.ibm.etools.ejbdeploy.batch.impl.BatchDeploy.execute(BatchDeploy.java:99)
[exec] at com.ibm.etools.ejbdeploy.EJBDeploy.execute(EJBDeploy.java:83)
[exec] at com.ibm.etools.ejbdeploy.EJBDeploy.main(EJBDeploy.java:313)
[exec] Caused by: java.net.UnknownHostException: java.sun.com
[exec] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:234)
[exec] at java.net.Socket.connect(Socket.java:543)
[exec] at java.net.Socket.connect(Socket.java:493)
[exec] at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
[exec] at sun.net.www.http.HttpClient.openServer(HttpClient.java:403)
[exec] at sun.net.www.http.HttpClient.openServer(HttpClient.java:521)
[exec] at sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
[exec] at sun.net.www.http.HttpClient.New(HttpClient.java:320)
[exec] at sun.net.www.http.HttpClient.New(HttpClient.java:337)
[exec] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:822)
[exec] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:774)
[exec] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:699)
[exec] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:943)
[exec] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
[exec] at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
[exec] at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
[exec] at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
[exec] at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
[exec] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[exec] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[exec] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[exec] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[exec] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[exec] at org.eclipse.wst.common.internal.emf.resource.EMF2SAXRenderer.doLoad(EMF2SAXRenderer.java:93)
[exec] ... 26 more
[exec]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Could not load resource "META-INF/ejb-jar.xml" in archive "C:\MNYL\build\ejbtemp.jar"


And the obvious conclusion to be drawn from that is that (a) the JAR file "C:\MNYL\build\ejbtemp.jar" should contain a resource named "META-INF/ejb-jar.xml", and that (b) it does not contain that resource.

So I would look into the process which creates that JAR file (you mentioned Ant so maybe it has something to do with how you used Ant) and see why it fails to include that resource.
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thanks paul.

I observed that jar file us creating and in jar file ejb-jar.xml is loading.
But I am not understanding where is the problem.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

I think that error message can be misunderstood if you don't look at that stacktrace fully. What it's saying is:

Could not load resource "META-INF/ejb-jar.xml" in archive "C:\MNYL\build\ejbtemp.jar"
[exec] Stack trace of nested exception:
[exec] org.eclipse.emf.common.util.WrappedException: java.net.UnknownHostException: java.sun.com


So it could not load that ejb-jar.xml because (while reading that file contents) it couldn't connect to java.sun.com. This usually happens when the xml is being validated for its contents and the system where you are deploying this doesn't allow access to external sites. There are ways to fix this by having the xml validated against a local schema. You'll probably have to check the server's documentation to see how that can be done. Or if you are allowed to access the external sites then you'll have to check why this specific domain name isn't being resolved.


[My Blog] [JavaRanch Journal]
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thank you very much Jaikiran.

Jaikiran Pai wrote:I think that error message can be misunderstood if you don't look at that stacktrace fully.



Seriousli i didnot observed the stacktrace fully.
Now what is the problem with java.sun.com, is I have to configure any where this url.
Why its couldn't connect to java.sun.com because I type same url on browser but its working fine.


Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Then that means your browser can connect to java.sun.com, but your process which is loading ejb-jar.xml cannot connect to it.

And that is likely because they are configured differently. For example, in my system my browser is configured to connect to the outside world (sucn as java.sun.com) via a proxy server. When I need other applications to connect to the outside world, then, I need to specifically configure them to use the same proxy server. This does not happen automatically.

You might need to talk to the people who manage your network, to help you figure out and solve that problem.
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Really Thanks Paul ,

The problem resolved. Some jar files was missed in websphere lib folder.
Once again we installed websphere, now its working fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Could not load resource "META-INF/ejb-jar.xml" in archive