[JNDI/Naming/Network] - java.lang.NoSuchFieldError: TRACE :Log4jLoggerPlugin.java:8
by shankha
Hi I am facing a problem with accessing the JBOSS.
according to the exception it seems to me --- log related exception.
when I call the following code
Hashtable env = new Hashtable();
| env.put(Context.INITIAL_CONTEXT_FACTORY, initCtxFac);
| env.put(Context.PROVIDER_URL, providerUrl);
| try {
|
| ctx = new InitialContext(env);
| conFactory = (QueueConnectionFactory) ctx.lookup
| (queueConFacLookupName);
|
| -----
| -----
exception details
Exception in thread "main" java.lang.NoSuchFieldError: TRACE
| at org.jboss.logging.Log4jLoggerPlugin.isTraceEnabled(Log4jLoggerPlugin.java:85)
| at org.jboss.logging.Logger.isTraceEnabled(Logger.java:122)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:622)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at com.cognizant.util.ServiceHelper.initQueueService(ServiceHelper.java:153)
| at com.cognizant.main.StartUp.<init>(StartUp.java:28)
| at com.cognizant.main.StartUp.main(StartUp.java:46)
I use jboss-4.2.1.GA version with JDK jdk141_05 version.
I added jboss.jar,jbossall-client.jar,jboss-client.jar,jboss-system.jar,log4j-1.2.9.jar,log4j-boot.jar in my project library.
Strange thing is that I run this same code with all other 3/4 windows XP system. OK
But in another system with the same configuration I got the above mentioned exception.
Can any body help me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125395#4125395
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125395
16 years, 3 months
[JBoss Portal] - JBoss Portal and RMI
by smoothny
Hello!
I got a really important problem and i can't find a solution yet.
Is there a way to get a RMI service running inside a porlet?
Before initiating the rmi binding inside the portlet I started
an rmiregistry on port 1100.
This is the code inside the portlet
| public void init(PortletConfig portletConfig) throws PortletException {
| PlayableGamesContainer playableGamesContainer = new PlayableGamesContainer();
| portletConfig.getPortletContext().setAttribute("playableGamesContainer", playableGamesContainer);
| try {
| IPortalService bridge = new PortalServiceImpl(playableGamesContainer);
| Naming.rebind("rmi://127.0.0.1:1100/PortalService", bridge);
| } catch (Exception e) {
| throw new PortletException(e);
| }
| super.init(portletConfig);
| }
|
This is the client I'm trying to connect with
| public TestClient() throws MalformedURLException, RemoteException,
| NotBoundException {
| //UnicastRemoteObject.exportObject(this);
| System.setProperty("java.security.policy", "client.policy");
| System.setSecurityManager(new java.rmi.RMISecurityManager());
| IPortalService bridge = (IPortalService) Naming
| .lookup("rmi://127.0.0.1:1100/PortalService");
|
| IPortalContext game = bridge.registerGame(new GameConfigurationImpl());
|
| game.setMatchListener(this);
| }
|
What I get is an access denied error from the server. If I setup
a new SecurityManager inside the portlet I don't get this error,
but it seems the a new security manager overwrites a jboss internal
one. Cause I get lots of access denied errors for the jboss internal
methods in the console. Any suggestions? Is there a way to get
RMI working?
Kind regards
Sascha
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125393#4125393
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125393
16 years, 3 months
[JBoss AOP] - AOPC compiler seems to run successfully without Aspectizing
by mayureshk
I recently got introduced to JBOSS AOP and was able to try out the sample code.
Thanks to the development team for all their efforts.
My development environment is Windows XP, JDK build 1.6.0_03-b05 and JBoss-AOP_1.5.6.GA
I am facing a interesting issue while using the AOPC compiler. The compiler runs successfully and completes its execution in approx 200ms without actually aspectizing any code or reporting any errors.
My project directory structure is as follows:
ProjectDir
|- src
|- lib
|- bin
I am trying to Aspectize a class called DBSession.java in the package com.wills.db (i.e. com.wills.db.DBSession). This class provides an API called getConn() that returns a java.sql.Connection. To intercept the getConn() method I have written an Aspect called ConnDetectorAspect.java and provided binding in the jboss-aop.xml as follows
| <?xml version="1.0" encoding="UTF-8"?>
| <aop>
| <bind pointcut="execution(public java.sql.Connection com.wills.db.DBSession->getConn())">
| <interceptor class="my.aspects.ConnDetectorAspect"/>
| </bind>
| </aop>
|
After compiling the classes using javac (ANT task) the class file com.wills.db.DBSession.class and my.aspects.ConnDetectorAspect.class are generated in the bin directory.
Here are some snippets from my ANT build file
| <!-- Contains jar files required by AOPC compiler -->
| <path id="jboss.aop.classpath">
| <fileset dir="${jboss.aop.lib50}">
| <include name="*.jar"/>
| </fileset>
| </path>
|
| <!-- Contains jars required by aopc compiler to work (compilerclasspath or compilerclasspathref) -->
| <path id="classpath50">
| <path refid="jboss.aop.classpath" />
| <pathelement path="${bin.dir}" />
| </path>
|
| <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
|
| <target name="compile-aop" >
| <echo message="Source files in ${src.dir}" />
| <echo message="Files to be AOPed in ${bin.dir}" />
| <echo message="" />
|
| <pathconvert pathsep="${line.separator}`-- " property="echo.classpath50" refid="classpath50">
| </pathconvert>
| <echo message="$-- Class path used by AOP" />
| <echo message="| " />
| <echo message="`-- ${echo.classpath50}" />
| <echo message="" />
|
| <aopc compilerclasspathref="classpath50" classpathref="classpath50" verbose="true">
| <classpath path="${bin.dir}" />
| <src path="${src.dir}" />
| <aoppath path="${resource.jboss-aop.xml}" />
| </aopc>
| </target>
|
After running the compile-aop ANT task I get the following output indicating successful run of the compiler
| compile-aop:
| [echo] Source files in C:\ProjectDir\src
| [echo] Files to be AOPed in C:\ProjectDir\bin
| [echo]
| [echo] $-- Class path used by AOP
| [echo] |
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\concurrent.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\javassist.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\jboss-aop-jdk50-client.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\jboss-aop-jdk50.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\jboss-aspect-jdk50-client.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\jboss-aspect-library-jdk50.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\jboss-common.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\jrockit-pluggable-instrumentor.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\pluggable-instrumentor.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\qdox.jar
| [echo] `-- C:\Tools\jboss-aop_1.5.6.GA\lib-50\trove.jar
| [echo] `-- C:\ProjectDir\bin
| [echo]
| [aopc] [debug] Passed in instrumentor: null
| [aopc] [debug] Defaulting instrumentor to: org.jboss.aop.instrument.ClassicInstrumentor
| [aopc] [debug] jboss.aop.class.path is NULL
| [aopc] [debug] jboss.aop.search.classpath: 'null' true
| [aopc] [debug] jboss.aop.path: C:\ProjectDir\build\jboss-aop.xml
| [aopc] jboss.aop.path[0]: C:\ProjectDir\build\jboss-aop.xml
| [aopc] [deploying] file:/C:/ProjectDir/build/jboss-aop.xml
| [aopc] AspectXMLLoader using managerorg.jboss.aop.AspectManager@133f1d7
| [aopc] Build Successful: 187ms
|
As you can see the compiler did not Aspectize the DBSession class as anticipated and there are no errors.
I have verified that the correct jboss-aop.xml is getting picked up.
Am I missing something obvious. Any suggestion is appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125391#4125391
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125391
16 years, 3 months