CacheableFactory
, JavaFactory
, ModuleControl
public class BCJava extends java.lang.Object implements JavaFactory, CacheableFactory, ModuleControl
Debugging problems with generated classes
When the code has been generated incorrectly, all sorts of odd things can go wrong. This is one recommended approach to finding the problem.
First, turn on ByteCodeGenInstr and DumpClassFile. Look for missing files (right now they are consecutively numbered by the activation class builder; later on they won't be, but BytCodeGenInstr dumps messages about the classes it has). Look at the log to make sure that all "GEN starting class/method" messages are paired with a "GEN ending class/method" message. If a file is missing or the pairing is missing, then something went wrong when the system tried to generate the bytecodes. Resort to your favorite debugging tool to step through the faulty statement.
If you get class files but the system crashes on you (I had an OS segmentation fault once) or you get funny messages like JDBC Excpetion: ac5 where ac5 is just the name of a generated class, then one of the following is likely:
JavaFactory
Modifier and Type | Field | Description |
---|---|---|
private CacheManager |
vmTypeIdCache |
JAVA_FACTORY_PROPERTY
Constructor | Description |
---|---|
BCJava() |
Modifier and Type | Method | Description |
---|---|---|
void |
boot(boolean create,
java.util.Properties properties) |
Start this module.
|
Cacheable |
newCacheable(CacheManager cm) |
|
ClassBuilder |
newClassBuilder(ClassFactory cf,
java.lang.String packageName,
int modifiers,
java.lang.String className,
java.lang.String superClass) |
a class.
|
private static java.lang.Object |
startSystemModule(java.lang.String factoryInterface) |
Privileged startup.
|
void |
stop() |
Stop this module.
|
(package private) Type |
type(java.lang.String javaType) |
Get the VM Type ID that corresponds with the given java type name.
|
(package private) java.lang.String |
vmType(BCMethodDescriptor md) |
|
(package private) static short |
vmTypeId(java.lang.String vmTypeS) |
Map vm types as strings to vm types as the VM
handles, with int ids.
|
private CacheManager vmTypeIdCache
public void boot(boolean create, java.util.Properties properties) throws StandardException
boot
in interface ModuleControl
StandardException
- standard Derby policyMonitor
,
ModuleFactory
public void stop()
stop
in interface ModuleControl
Monitor
,
ModuleFactory
public ClassBuilder newClassBuilder(ClassFactory cf, java.lang.String packageName, int modifiers, java.lang.String className, java.lang.String superClass)
newClassBuilder
in interface JavaFactory
packageName
- the name of the package the class is in.
null if it is in the default package.modifiers
- the | of the Modifiers
constants representing the visibility and control of this
method.className
- the name of the class or interfacesuperClass
- the name of the superclass or superinterfacecf
- ClassFactory to be used for class resolution (debug only)
and loading of the generated class.Modifier
public Cacheable newCacheable(CacheManager cm)
newCacheable
in interface CacheableFactory
Type type(java.lang.String javaType)
javaType
- The java type name to translate to a java VM type idjava.lang.String vmType(BCMethodDescriptor md)
static short vmTypeId(java.lang.String vmTypeS)
private static java.lang.Object startSystemModule(java.lang.String factoryInterface) throws StandardException
StandardException
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.