- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: ****CAUSE IDENTIFIED AND FIX PROPOSED**** Change of behaviour between Scala2.[7-8] and 2.9 when using Java Agents
Sat, 2011-07-16, 09:44
Hi All,
I have worked out what is going wrong and can correct it for Scala
running on my system, however this does create problems for the
distribution of my work, so I would like to raise it with you and get
back your thoughts and plans.
Basically, the scala command has changed from using "-cp" to
"-Xbootclasspath/a" to load the Scala jar files. The effect of this
appears to be that it changes the way the programs are validated such
that the rewritten codes are not seen by the validator and this results
in the missing field and method errors. This makes sense from a security
point of view when you are handling the jar files that are used for
security etc you do not want them rewritten by everyday components such
as Java Agents. However, I suspect in this case it has been used simply
to avoid collision with the user -cp arguments. Could you confirm if
this is the case?
So having identified the problem, the fix for me is simply to change the
scala command back to using cp for all the jars. The BIG remaining
problem is I would like to distribute my work and and I can ask people
to change to my custom script instead of using the standard one, but
this seems very unsatisfactory. So I wonder if you would consider
removing the use of -Xbootclasspath/a in the next minor update? I would
like to add that the use of the singleton pattern for classes such as
Unit mean that I cannot simply modify the Java Agent to address this issue.
Many thanks
Daniel
Sat, 2011-07-16, 10:37
#2
Re: ****CAUSE IDENTIFIED AND FIX PROPOSED**** Change of behavio
On 16/07/2011 9:49, Jason Zaugg wrote:
> On Sat, Jul 16, 2011 at 10:44 AM, Daniel Goodman wrote:
>
>> However, I suspect in this case it has been used simply to avoid collision
>> with the user -cp arguments. Could you confirm if this is the case?
> I believe that the change was motivated by entirely by performance:
> the startup time of the compiler was cut in half by avoiding bytecode
> verification.
Thanks. So am I correct then in understanding that, give you say this is
for the compiler, the reason this is also in the runtime and not just
the compiler is because of the runtime can work as an interpreter?
Daniel
>
> You can use `scala -nobootcp` to disable this.
>
> -jason
On Sat, Jul 16, 2011 at 10:44 AM, Daniel Goodman wrote:
> However, I suspect in this case it has been used simply to avoid collision
> with the user -cp arguments. Could you confirm if this is the case?
I believe that the change was motivated by entirely by performance:
the startup time of the compiler was cut in half by avoiding bytecode
verification.
You can use `scala -nobootcp` to disable this.
-jason