Cow Yeung

Greenhorn
+ Follow
since Oct 07, 2008
Cow likes ...
Eclipse IDE Chrome Java
HKS
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Cow Yeung

I try to integrate jasper report into my current web application. The current web application config is as below:
JBoss 4.0.3, EJB 1.1, struts 1.1

As I can't upgrade the current web app's library, I can't integrate jasper report lib into the current library (commons-digester and common-beanutils can't support jasper report lib). Therefore, I need to add another web app for it. I used the the same structure of current web app and upgrade some libraries (commons-digester and common-beanutils). I tested in the following situation:

Case 1. deploy new web app only
Result => can generate report

Case 2. deploy both new and current web app
Result => After triggering report generation, it show the exception as below
java.lang.NoSuchFieldError: PRINTSCALING
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:466)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:362)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:163)
at com.qcom.qsm.ReportGeneratorBean.generate(ReportGeneratorBean.java:27)
at com.qcom.qsm.TestAction.perform(TestAction.java:56)
at org.apache.struts.action.Action.execute(Action.java:420)

Case 3. I try to use JBoss's isolated method adding jboss-app.xml into the ear file to isolate 2 web app.
It show the exception when deploying the new web app
org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NameNotFoundException: comp not bound)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:366)
at org.jboss.web.WebModule.startModule(WebModule.java:68)
at org.jboss.web.WebModule.startService(WebModule.java:46)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
at $Proxy0.start(Unknown Source)

Do brothers having any idea about the isolation problem and the jasper report generation exception?
7 years ago
Hi friends,

I am looking for some book which are talking about how do EJB/Spring work and their architecture. The book I found mostly talking about how we use them only, it didn't explain how they can do that. Can suggest some books for me?

Thanks,
Cow
8 years ago
Hi friends,

I am looking for some book which are talking about how do EJB/Spring work and their architecture. The book I found mostly talking about how we use them only, it didn't explain how they can do that. Can suggest some books for me?

Thanks,
Cow
O~~~~~
Thanks for your information
I think I will take SCBCD 5 first~
I am planning to get SCBCD and then SCEA. I am confusing that if I should wait until SCBCD 6 or just take the SCBCD 5.

Any suggestion of my situation?

Thanks
I would like to know where can I download the jar file of Maven plugin. Such as, maven-enforcer-plugin, maven-jar-plugin.
It is because I need the jar file for building a software.

Thz~
11 years ago
Maybe it is not so clear that what do I want.

I mean the Application software can generate some folder and some files after clicking a button in the application. The file generating process is as same as Maven. However, Maven is using command on command mode and my application is using some code to control the generation process. Or, maybe I would like to find a java library that using code instead of the command.

Thanks~~
11 years ago
I am building a software that need to use Maven for project management. The software can export a library out. Therefore, I need to use some project management library. If there is some libraries or plug-in of Maven that I can call function in java application instead of using command in DOS mode to build a project?
11 years ago
I am using ireport to make a report to generate pdf report. I set the textfield to Stertch with overflow, and Stretch Type: Relative to Band Height. It works when I do that in iReport.

However, it is not work in java application. Does any know what problem it is?
In fact, in my code, I pass value for the first subReport "Question" by questionDatasource which is a JRBeanCollectionDataSource. The key is from that qestionDatasource. How can I get value from the JRBeanCollectionDataSource? If not, I can't get the value of answer by the key.
If it is the code in the main report or question report?
Using the above example, I should do like the below?

// Generate the pdf of Paper + Question subReport

InputStream mainInStream = getClass().getResourceAsStream("../paper.jasper");
InputStream questionInStream = getClass().getResourceAsStream("../question.jasper");


JasperReport jRpt = (JasperReport) JRLoader.loadObject(mainInStream);
JasperReport question= (JasperReport)JRLoader.loadObject(questionInStream);

JRBeanCollectionDataSource questionDS = new JRBeanCollectionDataSource(this.paperBean.paperQuestions);

Map answerMap = new HashMap();
for (Question question:this.paperBean.paperQuestions){
answer.put(question.id, new JRBeanCollectionDataSource(question.Answers));
}


Map<String, Object> main = new HashMap();
main.put("name", this.paper.name);
main.put("subReport", question);
main.put("questionDatasource", questionDS);
main.put("answerMap", answerMap );


JasperPrint jPrint = JasperFillManager.fillReport(jRpt, main, new JREmptyDataSource());
JasperExportManager.exportReportToPdfFile(jPrint, "D:/test.pdf");


Moreover, how can I get the datasource of answer from map in the Report?
Ok Thz~

However, I am not so sure that how can it get datasource from map by the id.
Sorry, I am not so understand about it.

Do you mean that I pass the map of JRBeanCollectionDatasource of answer to the main report?
However, I don't know how to do that. Because of the list of answer is inside the list of question. The structure just like the following code:

// Paper
public class Paper{

public String name;

public List<Question> questions;

}

// Question
public class Question{

public String question;

public List<Answer> answers;

}

// Answer
public class Answer{

public String answer;
}

// Generate the pdf of Paper + Question subReport

InputStream mainInStream = getClass().getResourceAsStream("../paper.jasper");
InputStream questionInStream = getClass().getResourceAsStream("../question.jasper");


JasperReport jRpt = (JasperReport) JRLoader.loadObject(mainInStream);
JasperReport question= (JasperReport)JRLoader.loadObject(questionInStream);

JRBeanCollectionDataSource questionDS = new JRBeanCollectionDataSource(this.paperBean.paperQuestions);

Map<String, Object> main = new HashMap();
main.put("name", this.paper.name);
main.put("subReport", question);
main.put("questionDatasource", questionDS);

JasperPrint jPrint = JasperFillManager.fillReport(jRpt, main, new JREmptyDataSource());
JasperExportManager.exportReportToPdfFile(jPrint, "D:/test.pdf");

So I don't know how to put the list of answer to be the datasource inside the datasource of questionDS.