Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:59:45+00:00 2026-06-11T13:59:45+00:00

The root of my problem is that I’m trying to use the SizeOf sourceforge

  • 0

The root of my problem is that I’m trying to use the SizeOf sourceforge project from a web application deployed on JBoss AS7 and getting a ClassNotFoundException for net.sourceforge.sizeof.SizeOf. I added -javaagent:/path_to_jar/SizeOf.jar to the server’s JAVA_OPTS and see the System.out.println from the premain method on server startup (JAVAGENT: call premain instrumentation for class SizeOf). However, when I try to call SizeOf.sizeOf(obj) from my servlet’s doGet method, the application fails with the aforementioned ClassNotFoundException.

If anyone can tell me how to get this working with JBoss AS7, that would be helpful (I have it working in an Eclipse run configuration — the equivalent of running from the command line). What I would really like to do, above and beyond that, is to understand how classloading works for Java Agents. The best documentation I’ve been able to find is in the offical JVM docs, and that’s pretty sparse. All it says about classloading is that the Premain-Class will be loaded by the system classloader. I saw a blog post that suggested that the jar didn’t need to be placed on the classpath, since the -javaagent JVM argument would take care of that, so it would appear that I shouldn’t have to add the SizeOf jar as a AS7 module. Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:59:46+00:00Added an answer on June 11, 2026 at 1:59 pm

    Need to do the following:

    • Create a module for agent: create folder modules/net/sourceforge/sizeof/main and add sizeof.jar and a module.xml
    • Add module to boot config: add JBOSS_MODULES_SYSTEM_PKGS=”net.sourceforge.sizeof” to bin/standalone.conf
    • Also in bin/standalone.conf, append -javaageent:../modules/net/sourceforge/sizeof/main/sizeof.jar to JAVA_OPTS
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single .war file with my web-application. The root of the problem
My root problem is that when using calls Dispose on a StreamWriter , it
The root of the problem for me is that Java does not allow references.
I have a problem that comes from me following tutorials without really understanding what
I'm working to finish a math problem that approximates the square root of a
I have a problem that I have been trying to solve since days! I
I have this problem that I cannot fix. From my @Controller , i can
The problem that I am having is that I am trying to embed an
I need to solve this problem. I started my project from the wrong concept
I have an unusual problem that I managed to find the root of. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.