GeeCON Prague 2014*
The moose likes JBoss/WildFly and the fly likes .SAR file problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark ".SAR file problem" Watch ".SAR file problem" New topic
Author

.SAR file problem

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

I am in deep deep trouble right now. I was working on a project where there was a Enterprise application. It contained one ejb module and two web modules. In addition to that the application.xml file had two .sar modules. I was not sure what it was so I commented it to run the code. I am using Netbeans 6. Now I have realized that it was a big mistake and now that mistake is killing me. I don't know how to configure it. There two folders in the ejb module's configuration folder representing the two .sar modules. Both contain a jboss-service.xml file. Now I have to configure it properly and I don't have much time. I know I was a fool and I should have asked this here way early. But now I have to do it anyhow. But I am clueless about what to do. Can someone give me some guidance related to this. What is the correct way to configure it.

Please help me. It's very urgent...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Please provide the following information:

1) The contents of your EAR file. Use 'jar -ft xxx.ear' and post the results.
2) Your application.xml file
3) Your jboss-app.xml file, if any.

When posting XML text or source code, please enclose the text in UBBCode "code" tags - you can do this by selecting the text and clicking the Code button above the editor window. Also, click the Preview button to ensure that the formatting is correct and the XML text shows up before posting.


JBoss In Action
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

This is the content of the EAR file

META-INF/
META-INF/MANIFEST.MF
Site_Dev-ejb.jar
Site_Dev-payment.war
Site_Dev-war.war
META-INF/application.xml
META-INF/jboss-app.xml
commons-beanutils.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-digester.jar
commons-discovery-0.4.jar
commons-fileupload-1.0.jar
commons-fileupload-1.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-logging-1.1.1.jar
commons-logging.jar
commons-validator.jar
jakarta-oro.jar
jstl.jar

This is the application.xml file with the .sar modules commented



The jboss-app.xml. is almost empty.

<?xml version="1.0" encoding="UTF-8"?>
<jboss-app/>

There are two folders named ticket-queue and ticket-booking-queue in the src\conf folder of the EJB module. These folders contain jboss-service.xml. These are the contents of the two xml files respectively



and

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Looks like your EAR no longer contains the SAR modules, so simply uncommenting them in application.xml will not work. Have you done a search in your file system to see if the SAR files are located somewhere? Is there another NetBeans project that builds them? (I'm a little lost here because I don't use NetBeans, so I cannot provide any NetBeans way to get you back to where you were.)
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Thanks peter for the help. I just need to know what the structure of the two .sar file should be according to the jboss-service.xml. Then for now I'll create the .sar files manually and look for a solution later on...
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

Did the .sar have any .class files? Or was it containing only the -service.xml files? If was containing just the -service.xml files, then you need not even create the .SAR.

Anyways - You can create the structure for the sar as follows:



[My Blog] [JavaRanch Journal]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Thanks jaikiran for the help. But I don't know the contents of the .sar files. I just got the code and I had to configure it. But I didn't know what to do with the .Sar modules so I just deleted them from Application.xml. Can you guess about the .sar modules by looking at the jboss-service.xml??
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

Ankit Garg wrote:Can you guess about the .sar modules by looking at the jboss-service.xml??


Yes Those are meant to configure JMS queues in your application and dont require any other application specific code. And that's what surprised me about the packaging You don't even need a .SAR to configure those - although its no harm creating those .SAR with just these files in META-INF.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Thanks Jaikiran for the help so far. Sorry that I didn't check it before but I found two MDBs in the source code. The code for the two MDBs looks like this



And this is the second one



Now what do I need to do to make this all work. Please can you help me with this.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

There are many ways you could package this. I don't know which is the packaging option your team is using. But if you just want to get it working, then you can create a jar file containing these MDB classes and place it in the EAR. Or you can copy those MDB classes to your already mapped Site_Dev-ejb.jar
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

OK Thanks Jaikiran. I'll do what you said and ask if I face any problems. Thank you very much again ...
 
GeeCON Prague 2014
 
subject: .SAR file problem