• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

java.lang.NoSuchMethodError: net.sf.jasperreports.engine.util. JRLoader.loadObjectFromFile(Ljava/lan

 
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
trying to create a report using jasperstudio I created an new servlet, but my problem still the same. I have find this servlet in Youtube site but I'm getting an erro.

Above my Servlet:


And the error:


Thanks in advanced.

Cezar Apulchro.
 
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Jasper are you using?
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,
thanks by reply. JasperSoft Studio 6.6.0.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry I'm using maven.
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of the jar files are deployed?

This looks like a version mismatch between what you used to compile with and what is deployed on the server.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand, how I find out version, I downloaded jasperreports-6.6.0
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is this being run?

Since it's a servlet I would expect there to be a container running the web app (something like Tomcat).
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't use Tomcat, I'm using Netbeans with Glassfish.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Netbeans 8.2, Glassfish-4.1.1
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so where is the app deployed?
There should be a webapp directory (or something along those lines) where your Glassfish is, containing your application.

Inside there will be a WEB-INF folder, and inside that will be a lib folder containing the jar files your application uses.

I will say, though, that trawling through old Jasper versions I can't actually find one that that method does not exist, so this could be a red herring.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When creating new project in Netbeans I choice Maven>WEB Application.
My tree project is:  
 .Project Name
   .Web pages
      .WEB-INF
         .Package of reports
               - Jasper
               - JRXML  
      .jsp pages(into WEB-INF)
   .Remote Files
   .Package of code
     .Package generated by project with maven option(com.itc.)
       .Servlet, DAO, Bean and others java class
 .(other files generated when created new project)
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But where is it deployed to?
There is (somewhere) a web server that will be running your app.

This is not about your project, but about the app as it is running on the web app server (Glassfish in your case).
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if I understand you,  my app is deployed in glassfish-server 4.1.1
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so look in your server and find your application.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Into: File Programs/glassfish-4.1.1/glassfish/domains/domain1/applications/_internal/(my project name).
But the directory of my project are empty.
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hm.
Not too sure how glassfish lays out its stuff.

How do you deploy it?

ETA: By "it" I mean your application.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply right click in my jsp and execute file. Are there another way.
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, a web app ought to be deployed to a server.
What you are relying on with your JSP is for Netbeans to do the work for you, possibly in a way that is not correct for your app.

I might be being a bit of a Luddite, but I've never had much fun with the built in debug/servers in IDEs.  They always seem to have something set up incorrectly.
It's also really hard to find out what has actually been deployed, and that side of things is (in my experience) 90% of the issues you encounter where an app hasn't started correctly.

I would suggest building a WAR file and dropping that into the Glassfish autodeploy directory (it looks like).
I think (not used Glassfish, so I'm guessing here) that explodes into a directory when Glassfish is running.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm studying how to generate .war with maven in netbeans. You have some tutorial to indicate to me?
 
Dave Tolls
Rancher
Posts: 4117
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid not.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have solved my problem with JasperReports.
Above my solution.
1 - the servlet:

2 - the dependences of my project:


Thanks for all.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!