Sun Studio 11 "Warning (Anachronism)"

Hello,
Compiling a C++ program using Sun Studio 11 compiler on Solaris, I get warnings like this:
Warning (Anachronism): Using blabla(*)(<params>) to initialize extern "C" blabla(*)(<params>).
For example, this happens passing a callback of type jvmtiHeapObjectCallback to IterateOverHeap (both defined in Sun's jvmti.h):
typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
(jlong class_tag, jlong size, jlong* tag_ptr, void* user_data);
jvmtiError (JNICALL IterateOverHeap) (jvmtiEnv env,
jvmtiHeapObjectFilter object_filter,
jvmtiHeapObjectCallback heap_object_callback,
const void* user_data);
What does this warning mean?
I checked that JNICALL is defined in Solaris jni_md.h as empty string, so it seems strange for me that the compiler wants extern "C" here.
The same code compiles with no problems on Solaris with gcc, as well as with Visual Studio on Windows and with gcc on Linux and Mac.
Best regards,
Anton

Thank you for your prompt reply.
In the guide, it is said:
"The Sun implementation of C and C++ function linkage is binary-compatible. That is not the case with every C++ implementation, although it is reasonably common".
I believe that for all other platforms that we support - Linux, Mac OS X, Windows - the only difference in C and C++ linkage is C++ name mangling.
I'm not 100% sure (just curious, do you know any implementations where C and C++ functions are not linkage compatible?), but there never were runtime problems with such C/C++ function mixing in our code.
Actually, the mixing happens in our code because we declare class with single static function (callback implemetation) right in the function where function requiring callback parameter is used. This is similar to Java anonymous classes, and helps to write simpler code (especially when callback code is short, and there are many different callbacks in different places of the code):
void qqq() {
struct Tmp {
static void myCallback() { ... }
foo(&Tmp::myCallback);
So, unfortunately, the offered solutions (wrapping) will not work in our case, unless we simply rewrite our callbacks as regular C functions.
Is there a compiler option (or a pragma) to suppress this warning?

Similar Messages

  • No Sun Studio 12 warning message for bitfield sizes?

    Hi,
    Does Sun Studio 12 support GCC bitfield sizes?
    The FAQ for version 11 (http://www.genunix.org/wiki/index.php/Sun_and_GCC_Compiler_Portability) specifially says Sun Studio does not support it. But I do not get any warning message, with any version I have tested (10 & 12). Am I missing some compiler flag or is the C compiler just silently ignoring those?
    Thanks!

    ok I have just found that the -Xc option gives me the following warning:
    warning: nonportable bit-field type
    Does that mean that the compiler is understanding this, but just warning me that this is not portable across different platforms? This would be acceptable in my case...
    Thanks!

  • Sun Studio 11 Warning raised after new compiler upgrade

    Hi All,
    I have an issue regarding the warning raised by new complier upgrade.
    Sun Studio 11 is the product and OS is Solaris 8.The following are the warning messages after successful compilation
    1. Warning: declarator required in declaration
    2. Warning: Last line in file "../inc/bibbnote.h" is not terminated with a newline
    Please advise me on the above issue wheather the above warnings can be ignored.
    Regards
    Vinoth
    Message was edited by:
    vinothsankar

    Those lines are not valid C++, since no typedef name is provided. Sun C++ accepts them as an extension, but issues a warning because the code is not valid.
    Examples:
    typedef int Int;
    Int is declared to be a synonym for int.
    typedef int;
    Invalid: no name is provided as a synonym for int.
    enum Foo { a, b, c};
    Foo is declared to be an enumerated type with enumerators a, b, c.
    Typedef Foo Bar;
    Bar is declared to be a synonym for Foo
    typedef enum { d, e, f } E1;
    E1 is a synonym for the unnamed enumerated type with enumerators d, e, and f. This is a C style declaration, which serves no useful purpose in C++.
    typedef enum E2 { g, h, i } E3;
    E2 is declared to be an enumerated type with enumerators g, h, i, and a synonym E3.
    typedef enum E4 { j, k, l };
    Invalid declaration. No name is provided as a synonym for E4. Remove the "typedef" and you have a valid declaration of E4 as an enumerated t ype.
    References: C++ Standard, sections
    7.1.3 The typedef specifier
    7.2 Enumeration declarations

  • Installed Sun studio 12.2. ran 'discover' command on C++ code.Gives warning

    Hi,
    I installed Sun studio 12.2. I compiled C++ code with C++ 5.11 compiler, and ran discover command as shown below:
    > #CC -g -O2 test.cpp
    > #discover -w - a.out
    > discover (warning): a.out will be analyzed in lite mode because it has no annotations. See discover documentation for compiler flag/OS recommendations
    I get the discover warning. After runnig discover command, I executed ./a.out. On cosole, only memory leaks will be displayed and no other error.
    Any reason why discover gives warning??????????????????
    Edited by: Archit on Apr 5, 2011 11:09 PM
    Edited by: Archit on Apr 5, 2011 11:10 PM
    Edited by: Archit on Apr 5, 2011 11:10 PM
    Edited by: Archit on Apr 5, 2011 11:13 PM

    Hi,
    What a woderful fix you have provided !!!!!!!!!!
    It really works.
    I tried running on Solaris 10 update 8. discover tool runs properly. Where as , the tool runs in lite mode on Solaris update 4.
    If possible , can you pint me to some links where I can this kind of info.?
    Thank you very much.

  • Sun Studio 11 do not parse make output and create link to file?

    Hi,
    Running Sun Studio 11 and can only get file links in the output window when I run a make command that uses CC -g (debug option). We have integrated other tools into our make system (flexlint, cppUnit..) and even though we make sure that the syntax is exactly the same as the compiler output and matches regular expression under tools->options->building->make settings->error expression, it doesn't work. Why do you have to debug compile to get sun studio to create a file link in the output window? Doesn't sun studio just parse the text from the make command?
    example of flexlint output for which no link is created:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/fmaaulib/src/FMA_List.cc", line 440: Error 84: sizeof object is zero or object is undefined'�
    example of make debug output for which we do get a link:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/SunOS5.10/inc/FMA_alarm_record.hh", line 1310: Warning (Anachronism):Info "static" is not allowed and is being ignored.
    Regards,
    Ola

    I'd second Maxim's suggestion: try NetBeans 5.5 with C/C++ Development Pack. The official release of NetBeans C/C++ Development Pack 5.5 has happened a few days ago. You can download it from
    http://www.netbeans.info/downloads/all.php?b_id=2284
    Some of the changes between the beta3 build and FCS are:
    * Significant performance improvements in the code parser resulting in faster results in the Class View and Code Completion
    * Programs now run in an external terminal (system dependent) by default. This allows better input control
    * Significant performance improvement in the debugging module
    * Significant functionality improvement in the debugging module
    * New project type "C/C++ Project From Existing Code" which simplifies creating a project from existing code
    * Macro support in code completion
    * Hyperlink navigation for macro usages and #include directives
    * Reformat code
    * Code folding
    * Code completion
    All these features will appear in next Sun Studio release, so you can
    consider NetBeans C/C++ Development Pack 5.5 as a preview of new
    Sun Studio IDE.

  • Sun Studio 11 Installation Problem on Solaris 9

    Hi
    I am installing Sun Studio11 on Solaris 9 SPARC Platform using -nodisplay option. The command line output is showing as installation is success.
    But when I see the install log file I am seeing the following errors.
    Begin------------------------------------------------------------------------------------------
    Installing Package: SPROcpl
    Processing package instance <SPROcpl> from </mcc/app/ds/Compiler/CD1/kits/ide/packages>
    Sun Studio 11 C++ Compiler
    (sparc) 11.0,REV=2005.10.13
    Using </mcc/app/ds/sunstudio11> as the package base directory.
    ## Processing package information.
    ## Processing system information.
    ## Verifying package dependencies.
    ## Verifying disk space requirements.
    Installing Sun Studio 11 C++ Compiler as <SPROcpl>
    ## Installing part 1 of 1.
    WARNING: /mcc/app/ds/sunstudio11/SUNWspro/inventory/v15n1/SPROcpl <not present on Read Only file system>
    WARNING: /mcc/app/ds/sunstudio11/SUNWspro/prod/bin/CC <not present on Read Only file system>
    WARNING: /mcc/app/ds/sunstudio11/SUNWspro/prod/bin/CCadmin <not present on Read Only file system>
    WARNING: /mcc/app/ds/sunstudio11/SUNWspro/prod/bin/CClink <not present on Read Only file system>
    WARNING: /mcc/app/ds/sunstudio11/SUNWspro/prod/bin/c++filt <not present on Read Only file system>
    WARNING: /mcc/app/ds/sunstudio11/SUNWspro/prod/bin/ccfe <not present on Read Only file system>
    End ------------------------------------------------------------------------------------------
    The above errors are coming for almost all the packages / components.
    Also I am not seeing any files created in <installdir>/SUNWspro/prod/bin folder.
    Thanks in advance

    Give this a whizz:
    for a in `pkginfo | nawk '/SPRO/{print $2}'` ; do pkgchk $a ; doneDoes it report anything? If it doesn't, I wouldn't lose too much sleep over the warnings.
    Paul

  • Sun Studio Debugging problem

    Hello
    I need help configuring the Sun studio debugger to work in fedora 8. The project is loaded from a make file, compiles fine, and runs fine. However, I can not place break points, and when I start the visual debugger, it gives a message box titled progress, and hangs on saying: starting debugger: /lib/libc.so.6
    Running from the command line gives me:
    $dbx <my program>
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc
    Reading <my program>
    Reading ld-linux.so.2
    Reading libm.so.6
    Reading libmpich.so.1.1
    Reading libpthread.so.0
    Reading librt.so.1
    Reading libc.so.6
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: panic: "ThreadAgent::setup_helper"(): Assertion (ta_td_agent) failed - "thread.cc":2674
    I have another problem in debugging an mpi problem in another installation of Sun Studio on Solaris 10 on a Sun machine. The visual debugger is working fine there, however, I need to debug with mpirun
    to decide the number of processors, because by default it loads the application on one processor. Iwill need to do this as well later on the linux machine I am using now, which doesn't even start the debugger on a sequential code so far.
    I appreciate your help a lot.
    Thank you very much in advance.
    Manal

    mhelal wrote:
    Hi
    Thank you for your reply. you said 2 problems,Yes, basically I meant these two:
    1. dbx: warning: unknown location expression code (0xe0)
    2. dbx: panic: "ThreadAgent::setup_helper"(): Assertion (ta_td_agent) failed - "thread.cc":2674
    First one should be fixed in dbx itself, but the second looks like an incompatibility between Fedora's libc and dbx; unless distros in "supported" list upgrade to the same version of libc, dbx can't be changed to match it.
    In other words, I'm sorry to say that you will probably not succeed in using dbx on Fedora 8 for the time being.

  • Building NCAR Graphics 5.2.1 on Solaris 10 x86u9 under Sun Studio 10 (2005)

    Hello,
    I've got the following error when compiling ncar program with Sun
    cc and f90 and /usr/ccs/bin/ld.
    cc -ansi -O -I/usr/openwin/include -I/usr/include/X11 -DSYSV -
    D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -Di386 -DNeedFuncProto -
    c cl.c
    cc: Warning: illegal option -nsi
    cc: -a conflicts with -dy.
    *** Error code 1
    make: Fatal error: Command failed for target `cl.o'
    After that i've changed the config/SolarisPC file and tried a build with gcc 3.4.3 and f90 but I got
    ld fatal: library -lc not found.
    I have an old box from 2001 which was under HCL of Solaris 8 x86.
    The people at NCAR did not update their configuration files for Solaris 10 x86. The SolarisPC file is old and is using by default g77 as the fortran compiler. Could I mix gcc with f90 ? Which linker should I use in that case?
    /usr/ccs/bin/ld or /usr/ucb/ld?

    Please refer to the C Users Guide for details of cc command line options. All manuals for Sun Studio 12u1 are listed here:
    http://download.oracle.com/docs/cd/E19205-01/index.html
    There is no -ansi option in Sun/Oracle C, nor has there ever been. The compiler attempts to interpret it as -a followed by some other letters, which is why you get a complaint about -a. Remove the option.
    Depending on what you expect from the -ansi option, either the default compiler behavior or the -Xc option should work. I suggest trying the default behavior (no -X option). Refer to the manual for details.
    Always use the /usr/ccs/bin/ld linker, but you normally should not use the ld linker directly. If you mixing C and Fortran, use the f90 driver to do the linking; it knows what Fortran libraries need to be linked, depending on command line option. When linking a program using only C, use the cc driver to link. Some C command-line options require linking special system files; the cc and f90 drivers know the rules.
    To mix Fortran with C, refer to the Fortran Users Guide. I recommend using the Studio C compiler when mixing code, not gcc. The requirements of gcc are not known to the f90 driver, but it does know the requirements of Studio C.
    The schema for a mixed Fortran and C program is something like this:
    cc -c f1.c f2.c <other options>
    f90 -c f3.f90 f4.f90 <other options>
    f90 -o myprog f1.o f2.0 f3.0 f4.0 <other options>

  • Exception not always caught in Sun Studio 12

    Hi,
    We're using Sun Studio 12 (Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25) on a Solaris 10 SPARC machine. In our applications an exception thrown is sometimes not caught in the try/catch statement and the program continues at an outer catch statement (which usually leads to the program exiting). So far I've not been able to reduce the code down to a simple example and I don't yet know what conditions causes this behaviour.
    In general the code has a big try/catch statement in main. Somewhere deep in the code there is a second try/catch statement which protects against a piece of code which we know may throw an exception. This is usually a smart pointer being dereferenced. The act of dereferencing the smart pointer in turn causes an exception to be thrown which is caught internally in a third try/catch inside the dereference code. The exception is successfully caught and some clean up is done. Then the exception is re-thrown by either using a throw; statement or a new throw xmsg("...");. All our exceptions are always of type xmsg which simply takes a string argument.
    When the problem manifests itself the second try/catch is ignored and the re-thrown exception is instead caught in the outer catch statement in main which causes the program to log an error and exit.
    We have lots of code which is structured the same way and the same style of code works in many cases only to fail in some specific case. It's an elusive problem because the problem moves around and it also depends on how the program is compiled. It only seems to happen when compiled in debug mode. If I compile with -xO4 the problem seems to go away.
    The problem also goes away or moves to a different place if the code has changed somewhere between compiles, i.e. some other developer has modified some code, not necessarily in the same are where the problem originally happened.
    One thing we have is a function we call DoThrow (used to suppress a warning on an older compiler) defined like this:
    void DoThrow(const std::string& msg)
      throw xmsg(msg);
    }As an experiment I replaced the call to DoThrow with a straight throw xmsg(...) at a place where the first exception was thrown and the problem went away. I'm not sure if removing the call to DoThrow fixed the problem or if the minor restructuring of the code was enough to move the problem elsewhere.
    For production releases we still use WorkShop 6, update 2 which does not have any problems like this. We really would like to upgrade to Sun Studio 12 because it's a much better compiler over all. We can't upgrade until we feel confident we have a workaround.
    Does anyone have any thoughts on what might be wrong or any ideas on what I can do to narrow down the problem?
    Thanks,
    Krister

    Many thanks. You've given me a few areas to focus on and I'll bring my house in order.
    The only external C++ library we depend on is STLport 5.0.2 which we compile ourselves. It's currently compiled with 5.3 on Solaris 8 and I will recompile it with 5.9 on Solaris 10. All other external libraries are C libraries. Our own code is put in static libraries and linked statically. I've read that exceptions thrown in shared libraries can be problematic.
    Your comment about complex conditional expressions (a ? f() : g()) is interesting. We've been bitten before by compiler bugs affecting those types of expressions. Destructors called twice or destructors called for temporaries never created. We may still have some conditional expressions like that.
    The exception is of type xmsg, defined this way:
    class xmsg
      public:
        xmsg(const char* s) : _msg(s) {}
        xmsg(const std::string& s) : _msg(s) {}
        const std::string& why() const { return _msg; }
      private:
        const std::string _msg;
    };There are three catch blocks involved and all the try/catch statement look like this:
    try
    catch(const xmsg& msg)
    }Here is a stack trace from dbx at the point where the exception is thrown the first time.
      [1] __exdbg_notify_of_throw(0xffbf4ae8, 0xffbf4ad0, 0x959b292c, 0xffff0000, 0x0, 0xfc00), at 0xfb6549b4
      [2] _ex_debug_handshake1(0x0, 0x101cb84, 0x1, 0x14ffc, 0xfb66a67c, 0xfb66ad38), at 0xfb655728
      [3] _ex_throw_body(0xfb66af80, 0x80b2ac, 0xfb66a67c, 0x14d9c, 0x0, 0xfb66af80), at 0xfb655934
      [4] __Crun::ex_throw(0xfb66afd0, 0x1460bf8, 0x7ead20, 0x0, 0x16538, 0x1), at 0xfb6558bc
    =>[5] TransportSource<User>::Activate(this = 0x1624810, r = CLASS, _ARG3 = CLASS), line 39 in "TransportSource.H"
      [6] Source<User>::DoActivate(this = 0x162486c, r = CLASS, e = CLASS), line 272 in "Factory.H"
      [7] BaseFactory::Load(this = 0x16020a8, e = CLASS), line 2799 in "BaseFactory.C"
      [8] GPAuthorizationSource::Load(this = 0x15d2440), line 110 in "GPAuthorization.C"
      [9] ExchangeServer::ExchangeServer(this = 0xffbfa95c, argc = 8, argv = 0xffbfbaec), line 380 in "exchangeServer.C"
      [10] main(argc = 8, argv = 0xffbfbaec), line 1525 in "exchangeServer.C"Here is the code for the Activate function in stack frame 5. The exception thrown is the second one.
        virtual T& Activate(const Reference& r, Exemplar<T>&)
          _transport->In().Write(r);
          DemarshallStream out;
          _transport->Method(Process::Activate, out);
          if(!out.Data())
         throw xmsg("Failed to call Activate on server " + _transport->Name());
          if(!out.GetBool())
         throw xmsg("Server returned error: " + out.GetString());
          const ClassHandle& h = out.GetClassHandle(&_connection);
          // don't need to pass refresh flag here because a call to Activate
          // means the object is being loaded for the first time.
          BaseExemplar* x = _handle.GetFactory().Demarshall(h, out, false,
         &_connection, this);
          BaseTransportSource::DoActivate(out);
          if(!x)
         throw xmsg("Failed to activate ref: " + r.ExternalValue());
          return static_cast<T&>(*x->GetInstance());
        }The exception is caught (frame 7 in the stack trace above) and re-thrown in the below code, at the last throw statement.
    void BaseFactory::Load(BaseExemplar& e)
      SourceMap::iterator p = _sources.find(&e._key->Type());
      if(p == _sources.end())
        throw xmsg("Factory<" + _handle.Name() + ">::Load - no source for: "
          + e._key->ExternalValue());
      AutoPointer<BaseGuard> g(Guard());
      std::list<BaseSource*>::iterator i = p->second.begin();
      while(true)
        try
          (*i)->_currentExemplar = &e;
          BO& x = (*i)->DoActivate(*e._key, e);
          (*i)->_currentExemplar = 0;
          if(!e._instance)
         e._instance = &x;
         Activate(e, ActivatedOld, 0);
          return;
        catch(const xmsg& msg)
          (*i)->_currentExemplar = 0;
          ++i;
          if(i == p->second.end())
         throw;
    }There is a second try/catch one level up (stack frame 8, the call to GPAuthorizationSource::Load). Here's a snippet of that piece of code.
        try
          const Exemplar<User>& user = UserFactory::Instance().CreateExemplar(
         *new UserReference(authorizationTable._login.Value()));
          *user;
        catch(const xmsg& msg)
          Logger::Instance() << LogHeader << MsgClass(MsgClass::Error)
         << "Error PMAutorizationSource: " << msg.why() << EndMsg;
        // ...I put a break-point in the catch block in the above code but I never hit the break point and the exception is caught in an outer try/catch, an error is printed and the program exits.
      try
      catch(const xmsg& msg)
        std::cerr << "ERROR: " << msg.why() << std::endl;
      }I'm sorry I have not yet been able to produce a smaller example that can be compiled and tested in isolation. I know that's important in order to track down the problem. It seems like the smallest change in seemingly unrelated parts of the code makes the problem come or go.

  • Strange C++ error when using newer Sun Studio compiler

    My company has just set up a new build machine for our product. We have gone from
    this version: CC: Sun C++ 5.7 Patch 117830-11 2007/04/04
    to this one: CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
    we have also upgraded the OS (solaris/sparc). I think the new one has gcc but the old one doesn't (we don't use it).
    and now I am getting this error:
    "/opt/SUNWspro/prod/include/CC/./new", line 32: Error, badextlnk: operator new(unsigned) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 35: Error, badextlnk: operator delete(void*) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 37: Error, badextlnk: operator new[](unsigned) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 40: Error, badextlnk: operator delete[](void*) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 53: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/./new", line 54: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/./new", line 55: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/./new", line 56: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 106: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 169: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 185: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 198: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 202: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 206: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 217: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 225: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 239: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 249: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 264: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 275: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    I have no idea what could be causing this. I can find one link to it on this forum: http://forums.sun.com/thread.jspa?messageID=9488983 . But the only answer to that query says it is the same as another bug which appears entirely different, not to mention being very old (while talking about an imminent fix), and being related to a different OS and (I think) a different version of sun studio (express vs. normal?).
    Any ideas? Could it be related to having gcc/g++ on the machine?

    Hi,
    I am also facing the same error while upgrading the Sun compiler description as below
    when I am compiling the cxx file on the system with compiler version (CC: Sun C++ 5.9 SunOS_sparc 2007/05/03) , I am facing the following error:-
    /opt/SUNWspro/bin/CC -dy -misalign -xcode=abs64 -xarch=v9 -D__EXTENSIONS__ -Dsun4_R5=1 -I. -Isun4_R5_v -I/home/as185259/ash_iadraid/ash_get_10/IA/PORT/include -I/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v -I/app/oracle/product/10.2.0/client_1/sqllib/public -I/app/oracle/product/10.2.0/client_1/precomp/public -I/opt/informix/include -DSVR4 -O -g p -pta -c MContext.cxx -o sun4_R5_v/MContext.o || \
    (rm -f sun4_R5_v.d; false)CC: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 97: Error: Only one of a set of overloaded functions can be extern "C".
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 99: Error: Only one of a set of overloaded functions can be extern "C".
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 101: Error: Only one of a set of overloaded functions can be extern "C".
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 102: Error: Only one of a set of overloaded functions can be extern "C".
    4 Error(s) detected.
    The same file with the same compilation command is getting compiled with compiler version CC: Sun WorkShop 6 update 2 C+ 5.3 2001/05/15 .
    Can anyone suggest what should be the resolution:-
    The code for the ssmalloc.h file is as under:-
    #ifndef SSMALLOC_H
    #define SSMALLOCH
    #include <stddef.h>
    #if defined(__sparcv9)
    namespace ssmalloc {
    #endif
    #if defined(__cplusplus)
    extern "C" {
    #endif
    The type for the malloc routine depends on
    the compiler and library that you are using.
    #if defined(hpux) || defined(sun4_R5) || defined(__GNUC_) || defined(_OS2_)
    typedef void MALLOC_PTR;
    #else
    typedef char *MALLOC_PTR;
    #endif
    #if defined(_GNUG_)
    typedef size_t MALLOC_SIZE;
    #else
    typedef unsigned MALLOC_SIZE;
    #endif
    #if defined(sun4) && ! defined(_GNUG_)
    # define FREE_RETURNS int
    # define FREE_RETURN return 0
    #else
    # define FREE_RETURNS void
    # define FREE_RETURN return
    #endif
    // User-callable routines.
    // Note: memalign and valloc are broken in that they do not aling
    // memory on documented boundaries, and thus do not behave as described
    // on the "malloc" manual page. They simply call malloc.
    MALLOC_PTR malloc (MALLOC_SIZE size);
    FREE_RETURNS free (MALLOC_PTR data);
    MALLOC_PTR realloc (MALLOC_PTR data, MALLOC_SIZE size);
    MALLOC_PTR calloc (size_t nelem, size_t elsz);
    MALLOC_PTR valloc (unsigned size);
    MALLOC_PTR memalign (unsigned alignment, unsigned size);
    // This memory allocator supports memory allocation inside signal
    // handlers. For correct operation, the following functions must be
    // called upon entering and exiting signal handlers that allocate
    // memory.
    void ssmalloc_enter_signal_level();
    void ssmalloc_exit_signal_level();
    // Set this variable to not 0 (possibly in the debugger) if you want
    // to get malloc to check memory data structures very carefully as it
    // goes. This may be handy if you are trying to detect a memory
    // trasher.
    // It also causes ssmalloc to abort the program instead of returning
    // zero if memory runs out.
    extern int check_memory_very_carefully;
    #if defined(__cplusplus)
    #endif
    #if defined(__sparcv9)
    } // namespace ssmalloc {
    #endif
    #endif / SSMALLOCH */
    The Machine is
    root@ldg1-> uname -a
    SunOS ldg1 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Blade-T6320
    Thanks
    Vijay

  • Problem in compilation using Sun Studio 11

    Hello,
    We are migrating from a Solaris 8 to a Solaris 10 OS. At the same ttime we are also migrating from Ingres 2.6 to Ingres 2006. As a part of the creation of teh development environment, we are recompiling all the codes on teh new OS. WE have installed teh Sun Studio 11 compiler for this purpose. When compiling some C codes, we are getting the following error:
    "am_xxxxxxxx.c", line 2596: warning: statement not reached
    "am_xxxxxxxx.c", line 2778: undefined symbol: i8
    "am_xxxxxxxx.c", line 2778: syntax error before or at: )
    "am_xxxxxxxx.c", line 2858: undefined symbol: i8
    "am_xxxxxxxx.c", line 2858: syntax error before or at: )
    "am_xxxxxxxx.c", line 2889: warning: implicit function declaration: IIresnext
    "am_xxxxxxxx.c", line 2891: warning: statement not reached
    "am_xxxxxxxx.c", line 2920: warning: statement not reached
    "am_xxxxxxxx.c", line 2931: undefined label: IIfdF1
    "am_xxxxxxxx.c", line 2931: undefined label: IIosl9139
    "am_xxxxxxxx.c", line 2931: undefined label: IIfdE1
    "am_xxxxxxxx.c", line 2931: cannot recover from previous errors
    cc: acomp failed for am_xxxxxxxx.c
    The command used for compiling is :
    cc -xarch=generic64 am_xxxxxxxx.c
    We have exported teh following:
    LD_LIBRARY_PATH_64=/usr/sfw/lib/sparcv9:/usr/local/lib/sparcv9:/usr/lib/sparcv9:/usr/openwin/lib/sparcv9:/usr/dt/lib/sparcv9:/opt/SUNWspro/lib/v9:/opt/SUNWspro/lib/v9:/eu/ingad/ingres/lib:/opt/oracle/lib:/usr/lib:/usr/ucblib:/usr/openwin/lib:/opt/SUNWspro/lib/:/opt/lib/cobol/coblib
    LD_LIBRARY_PATH=/opt/SUNWspro/lib/v9:/eu/ingad/ingres/lib:/eu/ingad/ingres/lib:/opt/oracle/lib:/usr/lib:/usr/ucblib:/usr/openwin/lib:/opt/SUNWspro/lib/:/opt/lib/cobol/coblib
    CXXFLAGS=-fast -xarch=v9b
    CFLAGS=-fast -xarch=v9b
    LDFLAGS=-L/usr/sfw/lib/sparcv9 -L/usr/lib/sparcv9 -R/usr/sfw/lib/sparcv9 -R/usr/lib/sparcv9
    We are struggling with this issue for the last one week. Can someone please help me with this issue?
    Could this be because the 64 bit library files are not installed? Please help.
    Aneesha

    The LD_LIBRARY_PATH environment variables determine where the runtime loader looks for shared libraries when you run an application. It is unlikely to be the source of compile-time errors.
    I suspect that doing two major changes at the same time has resulted in undefined names and other problems, probably due to missing or incorrect header inclusion. If possible, make one change at a time, either compile the old code on the new OS, or the new code on the old OS, and get that to work first.
    Check the Ingress documentation to see if you need to make source code changes when upgrading, and follow any recommendations there. You might also need to take up this problem with Ingress tech support.
    Regarding LD_LIBRARY_PATH, the best advice is usually "don't set it at all". For more on this topic, see this article:
    http://blogs.sun.com/rie/entry/tt_ld_library_path_tt
    Just to eliminate this as a possible build problem, try removing LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 from your environment when building the program. Then modify the build process to set the executable runpath (-R option) to include the Ingress or Oracle libraries that need to be searched. You don't normally want to point into /usr/lib or into the compiler installation area.

  • How to change Makefile file name in sun studio for linux 11?

    Greetings,
    For historical reasons, our makefiles are called Make.bld
    Sun Studio refuses to accept these as makefiles.
    It'd be a big pain to modify our entire build system to take makefile as the name.
    Is there a way to instruct sun studio to accept a different filename for makefiles ?
    Thanks,
    Bill

    There is no supported way of getting the Sun Studio IDE (or NetBeans) to recognize
    Make.bld as a Makefile. However, the solution Nik pointed out with a .nbattrs file will
    work.
    Here is a complete file which, if copied to each directory containing a Make.bld file
    will work. However, if the directory already contains a .nbattrs file you should edit
    the existing one and add the <fileobject>...</fileobject> lines rather than overwriting
    the entire file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN"
    " http://www.netbeans.org/dtds/attributes-1_0.dtd">
    <attributes version="1.0">
    <fileobject name="Make.bld">
    <attr name="MAKEFILE_TYPE" stringvalue="foo"/>
    </fileobject>
    </attributes>
    Note: I split the DOCTYPE line myself. It should be a single line in the file (although
    its probably OK if split, I didn't verify that so I'll suggest a single line).
    I should warn you that the next release of the Sun Studio IDE will no longer use
    .nbattrs files and you'll need a different solution. A preliminary version of the next
    release is currently available by downloading Sun Studio Express 3. The IDE is
    significantly better than the current one! You also get a lot of the same features
    by downloading NetBeans 5.5 with the C/C++ Development Pack.
    Gordon

  • Sun studio not working in linux

    I installed sun studio 12 in suse 10 linux, and i created a simple pgm,
    when compiling it, it shows these below errors,
    Running "/root/Desktop/sunstudio12/bin/dmake -f Makefile CONF=Debug" in /root/SunStudioProjects/Add
    dmake: defaulting to parallel mode.
    See the man page dmake(1) for more information on setting up the .dmakerc file.
    linux-n3wz --> 1 job
    /root/Desktop/sunstudio12/bin/dmake -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
    linux-n3wz --> 1 job
    mkdir -p build/Debug/Sun12-Linux-x86
    cc -c -g -o build/Debug/Sun12-Linux-x86/newmain.o newmain.c
    linux-n3wz --> Job output
    mkdir -p build/Debug/Sun12-Linux-x86
    cc -c -g -o build/Debug/Sun12-Linux-x86/newmain.o newmain.c
    (/root/SunStudioProjects/Add)newmain.c:
    "/root/Desktop/sunstudio12/prod/include/cc/stdio.h", line 5: cannot find include file: <stdio.h>
    "/root/Desktop/sunstudio12/prod/include/cc/stdlib.h", line 6: cannot find include file: <stdlib.h>
    "newmain.c", line 17: warning: implicit function declaration: scanf
    "newmain.c", line 19: warning: implicit function declaration: printf
    "newmain.c", line 20: undefined symbol: EXIT_SUCCESS
    cc: acomp failed for newmain.c
    *** Error code 2
    dmake: Fatal error: Command failed for target `build/Debug/Sun12-Linux-x86/newmain.o'
    Current working directory /root/SunStudioProjects/Add
    *** Error code 1
    dmake: Fatal error: Command failed for target `.build-impl'
    Build failed. Exit value 1.
    CAN any body tell me whats the exact problem?
    this same pgm is currectly running in sunstudio 12 installed in solaris.

    satmatrix wrote:
    ok, shall i install ubuntu in my laptop?No, I'm just saying that I'm not familiar with SuSe enough to tell what package you need to install to have standard includes. But you already have an answer now...
    Solaris 10 is not installable in my laptop, it doesnt support graphics, also i had tried opensolaris, it works without errors and it supports graphics,
    but can i install Sun Studio 12 in that?Of course. You can do it using OpenSolaris package manager; no need to download, unpack, install - package manager will do it for you.

  • Sun Studio creator + jboss  jboss-4.2.2.GA

    Everything is runing well in jboss-4.0.3SP1 with Sun Studio Creator(JSF)
    but when Sun Studio Creator(JSF) deploying war to jboss-4.2.2.GA, I got the following Error
    please help me
    12:45:25,343 ERROR [[]] Exception sending context initialized event to listener instance
    of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
    java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor
    Impl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor
    AccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at com.sun.faces.config.rules.RenderKitRule.begin(RenderKitRule.java:79)
    at com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1273)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher
    .dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Sour
    ce)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at com.sun.org.apache.commons.digester.Digester.parse(Digester.java:1548)
    at com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1417)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.jav
    a:348)
    at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitializ
    ed(JBossJSFConfigureListener.java:69)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:385
    6)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeploye
    r.java:301)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:1
    04)
    at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
    at org.jboss.web.WebModule.startModule(WebModule.java:83)
    at org.jboss.web.WebModule.startService(WebModule.java:61)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.jav
    a:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport
    .java:245)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:9
    78)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy44.start(Unknown Source)
    at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:13
    3)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperat
    ionInterceptor.java:142)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMB
    eanSupport.java:238)
    at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.j
    ava:87)
    at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubD
    eployerInterceptorSupport.java:188)
    at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:
    95)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy45.start(Unknown Source)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:13
    3)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperat
    ionInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy9.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.j
    ava:421)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.jav
    a:634)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Abs
    tractDeploymentScanner.java:263)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(Abstr
    actDeploymentScanner.java:274)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(Abstra
    ctDeploymentScanner.java:225)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.loggin
    g.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid
    class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Lo
    g' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationEx
    ception: Invalid class loader hierarchy. You have more than one version of 'org.apache.co
    mmons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.L
    ogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid cl
    ass loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log'
    visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationExcep
    tion: Invalid class loader hierarchy. You have more than one version of 'org.apache.commo
    ns.logging.Log' visible, which is not allowed.))
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:
    543)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:
    235)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:
    209)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
    at com.sun.faces.config.beans.RenderKitBean.<clinit>(RenderKitBean.java:26)
    ... 111 more
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.loggin
    g.LogConfigurationException: Invalid class loader hierarchy. You have more than one versi
    on of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apach
    e.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have mor
    e than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl
    .java:397)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:
    529)
    ... 115 more
    Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hier
    archy. You have more than one version of 'org.apache.commons.logging.Log' visible, which
    is not allowed.
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl
    .java:385)
    ... 116 more
    12:45:25,484 ERROR [StandardContext] Error listenerStart
    12:45:25,484 ERROR [StandardContext] Context [] startup failed due to previous errors
    12:45:25,640 WARN [ServiceController] Problem starting service jboss.web.deployment:war=M
    angalyam.war,id=950888772
    org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/jboss-4.2.2.GA/server
    /default/tmp/deploy/tmp3295Mangalyam-exp.war/ deployment failed
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeploye
    r.java:379)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:1
    04)
    at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
    at org.jboss.web.WebModule.startModule(WebModule.java:83)
    at org.jboss.web.WebModule.startService(WebModule.java:61)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.jav
    a:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport
    .java:245)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:9
    78)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy44.start(Unknown Source)
    at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:13
    3)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperat
    ionInterceptor.java:142)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMB
    eanSupport.java:238)
    at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.j
    ava:87)
    at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubD
    eployerInterceptorSupport.java:188)
    at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:
    95)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy45.start(Unknown Source)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:13
    3)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperat
    ionInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy9.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.j
    ava:421)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.jav
    a:634)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Abs
    tractDeploymentScanner.java:263)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(Abstr
    actDeploymentScanner.java:274)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(Abstra
    ctDeploymentScanner.java:225)
    12:45:25,703 ERROR [MainDeployer] Could not start deployment: file:/C:/Program Files/jboss
    -4.2.2.GA/server/default/deploy/Mangalyam.war
    org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/jboss-4.2.2.GA/server
    /default/tmp/deploy/tmp3295Mangalyam-exp.war/ deployment failed
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeploye
    r.java:379)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:1
    04)
    at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
    at org.jboss.web.WebModule.startModule(WebModule.java:83)
    at org.jboss.web.WebModule.startService(WebModule.java:61)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.jav
    a:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport
    .java:245)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:9
    78)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy44.start(Unknown Source)
    at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:13
    3)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperat
    ionInterceptor.java:142)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMB
    eanSupport.java:238)
    at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.j
    ava:87)
    at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubD
    eployerInterceptorSupport.java:188)
    at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:
    95)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy45.start(Unknown Source)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
    va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15
    5)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:13
    3)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperat
    ionInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy9.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.j
    ava:421)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.jav
    a:634)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Abs
    tractDeploymentScanner.java:263)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(Abstr
    actDeploymentScanner.java:274)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(Abstra
    ctDeploymentScanner.java:225)

    I figured it out by looking at the application server logs on the admin console. The problem was a permissions issue. I'm working with some plug-ins from ESRI (the gis software company) for ArcGIS Server 9.2. I forgot that you have to add some lines to the server.policy file (located at:
    /<install directory>/SunAppServer8/domains/creator/config/
    The text you have to add is
    grant {
    permission java.util.logging.LoggingPermission "control","";
    permission java.lang.RuntimePermission "*","read";
    permission java.util.PropertyPermission "PEOBJEDITHOME","read,write";
    permission java.util.PropertyPermission "ARCGIS_RELEASEALL_SHUTDOWN_HOOK","read,write";
    permission java.util.PropertyPermission "ARCGIS_IUNKNOWN_VARIENT_OBJECTS","read,write";
    So there you go.

  • Can't use profiler (Performance Analyzer) in Sun Studio 12, please help!!

    Hi,
    I've mandriva 2008 (linux), and I've installed Sun Studio 12.
    At the first start of Sun Studio a message appear:
    Warning - could not install some modules:
         ATD Sun Studio Core - The module named com.sun.tools.swdev.toolscommon was needed and not found.
         dbx Debugger UI - The module named com.sun.tools.swdev.toolscommon was needed and not found.
         ATD Performance Analyzer Actions - The module named com.sun.forte.st.mpmt/1 was needed and not found.
         ATD Performance Analyzer Actions - The module named com.sun.tools.swdev.toolscommon was needed and not found.
    All other modules works correctly, but unfortunately I need the profiler (performance analyzer) because I want to speed up my C++ code. What can I do???
    Please help!
    NOTE:
    I've added to my .bash_profile this lines:
    PATH=/opt/sun/sunstudio12/bin:$PATH
    export PATH
    PATH=/opt/sun/sunstudio12/man/:$PATH
    export PATH
    LD_LIBRARY_PATH=/opt/sun/sunstudio12/prod/lib
    export LD_LIBRARY_PATH
    but unfortunately this don't solve the problem....
    Edited by: MLX82 on Feb 1, 2008 11:24 PM

    If I type `uname -p` this message appear:
    [mlx@localhost ~]$ `uname -p`
    bash: Intel(R): command not foundIf I type: --userdir won't work as you can see:
    sunstudio --userdir /home/mlx/.sunstudio/12.0-Linux-Intel\(R\)\ Pentium\(R\)\ M\ processor\ 1.73GHz/I get an 426 line error (but this is the correct location, as man of sunstudio say), while if I type for example:
    sunstudio --userdir /home/mlx/error 426 disappears, but I get anyway the error on the module:
    Warning - could not install some modules:
         ATD Performance Analyzer Actions - The module named com.sun.forte.st.mpmt/1 was needed and not found.
         ATD Performance Analyzer Actions - The module named com.sun.tools.swdev.toolscommon was needed and not found.
         dbx Debugger UI - The module named com.sun.tools.swdev.toolscommon was needed and not found.
         ATD Sun Studio Core - The module named com.sun.tools.swdev.toolscommon was needed and not found.On the other hand I've searched the "id" exe and it is in /bin:
    [mlx@localhost ~]$ id
    uid=500(mlx) gid=500(mlx) gruppi=500(mlx)so I've created a sym link:
    cd /usr/bin
    ln -s /bin/id ./idbut when I start Sun Studio 12 I get again the error on the module.
    So I've tryed to reinstall everything (yes, also OS) but it (partially) solves only the problem installing with batch_installer. Infact now I can use batch_installer but at the end of installation it say:
    [root@localhost tmp]# ./batch_installer --accept-sla
    Installation failed: cleanup successful.Anyway SunStudio 12 still works, but the main problem about the module of performance analyzer is still here...
    how can I solve this? Please help!
    Edited by: MLX82 on Feb 4, 2008 3:19 PM

Maybe you are looking for