Discussion:
[Middlegen-user] [Weblogic] Jar file
Joao Miguel Garcia
2002-06-18 06:51:03 UTC
Permalink
It's working with a) option!

Thanks a lot!
João Miguel Garcia
IT Billing
OniWay
Av. Almirantes Reis, 65 - Edifício D
1150-011 Lisboa
Mobile: 96 849 37 10


-----Original Message-----
From: Aslak Hellesøy [mailto:***@netcom.no]
Sent: terça-feira, 11 de Junho de 2002 18:09
To: Joao Miguel Garcia; middlegen-***@lists.sourceforge.net
Subject: RE: [Middlegen-user] [Weblogic] Jar file


I take it you're not working on the sample, but that you have this problem
in your own project.

Middlegen provides two optional ways to obtain a connection to a database so
it can read the metadata:
a) Via standard JDBC using a database URL
b) Via JNDI, in which case it will perform a JNDI lookup from some app
server

The recommended way is to use a) because it's generally faster, but it seems
you're using b). This means that the class you specify for
initialContextFactory has to be on the classpath you use in the <taskdef>
you use to define the middlegen task. I have added a check for this, and
will commit it to CVS ASAP. It will give you a more verbose error message.

If you want to stick with b), you need to add ${weblogic.jar.file} to the
classpath you're passing to middlegen's taskdef.

If you want to use a) you have to specify databaseurl and driver in your
middlegen task.

The ant.html files will help you understand this better.

HTH,

Aslak
-----Original Message-----
Miguel Garcia
Sent: 11. juni 2002 17:39
Subject: [Middlegen-user] [Weblogic] Jar file
Hello there,
I 'm stucked in this error!
When I check the weblogic it work fine!!!
I have placed that property "weblogic.jar.file" in the build.xml...
C:\java\middlegen\middlegen(11-06-2002)\BRTM>ant check-weblogic-jar
Buildfile: build.xml
BUILD SUCCESSFUL
Total time: 2 seconds
C:\java\middlegen\middlegen(11-06-2002)\BRTM>ant
Buildfile: build.xml
[middlegen] javax.naming.NoInitialContextException: Cannot
instantiate class: we
blogic.jndi.WLInitialContextFactory. Root exception is
java.lang.ClassNotFoundE
xception: weblogic.jndi.WLInitialContextFactory
[middlegen] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[middlegen] at
java.security.AccessController.doPrivileged(Native Method)
[middlegen] at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[middlegen] at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
[middlegen] at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
[middlegen] at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
[middlegen] at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
[middlegen] at java.lang.Class.forName0(Native Method)
[middlegen] at java.lang.Class.forName(Class.java:195)
[middlegen] at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelp
er12.java:45)
[middlegen] at
javax.naming.spi.NamingManager.getInitialContext(NamingManage
r.java:652)
[middlegen] at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.
java:246)
[middlegen] at
javax.naming.InitialContext.init(InitialContext.java:222)
[middlegen] at
javax.naming.InitialContext.<init>(InitialContext.java:198)
[middlegen] at
middlegen.JNDIDatabase.getConnection(JNDIDatabase.java:109)
[middlegen] at
middlegen.MiddlegenPopulator.<init>(MiddlegenPopulator.java:1
17)
[middlegen] at middlegen.MiddlegenTask.execute(MiddlegenTask.java:349)
[middlegen] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va)
[middlegen] at org.apache.tools.ant.Task.perform(Task.java)
[middlegen] at org.apache.tools.ant.Target.execute(Target.java)
[middlegen] at org.apache.tools.ant.Target.performTasks(Target.java)
[middlegen] at
org.apache.tools.ant.Project.executeTarget(Project.java)
[middlegen] at
org.apache.tools.ant.Project.executeTargets(Project.java)
[middlegen] at org.apache.tools.ant.Main.runBuild(Main.java)
[middlegen] at org.apache.tools.ant.Main.start(Main.java)
[middlegen] at org.apache.tools.ant.Main.main(Main.java)
BUILD FAILED
middlegen.MiddlegenE
xception: Couldn't look up database using JNDI:Cannot instantiate
class: weblogi
c.jndi.WLInitialContextFactory
Total time: 3 seconds
Can you help me?
Thanks,
João Miguel Garcia
IT Billing
OniWay
Av. Almirantes Reis, 65 - Edifício D
1150-011 Lisboa
Mobile: 96 849 37 10
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=dntextlink

Loading...