[JBoss Seam] - Re: JBoss 4.0.5.GA: java.lang.NullPointerException: serialF
by jarkko@jab.fi
Huh,
I managed to make the system "work" by doing very uglyt hacking in SeamStateManager.java
|
| public void writeState(FacesContext ctx, SerializedView sv)
| throws IOException {
|
| {
|
| ExternalContext extCtx = ctx.getExternalContext();
| Object serialFactoryObj = extCtx.getApplicationMap().get(
| StateUtils.SERIAL_FACTORY);
|
| if (serialFactoryObj == null) {
| SerialFactory serialFactory;
| serialFactory = new DefaultSerialFactory();
| extCtx.getApplicationMap().put(StateUtils.SERIAL_FACTORY,
| serialFactory);
| }
|
| }
| stateManager.writeState(ctx, sv);
| }
|
That is, NO org.apache.myfaces.webapp.StartupServletContextListener configured in web.xml.
Maybe this is MyFaces bug, because in org.apache.myfaces.portlet.MyFacesGenericPortlet has a lot of methods for all kind of initaliazation (like init() and initMyFaces()). Especially interesting is the initMyFaces() which looks like replacement of StartupServletContextListener.initFaces(), but for portal/portlets. Somehow however, i couldn't get the SERIAL_FACTORY hack work from initMyFaces() due to FacesContext being null.
I hope i'm not missing anything else (critical) from StartupServletContextListener initalization if the MyFacesGenericPortlet is not working correclty.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980183#3980183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980183
19 years, 6 months
[EJB/JBoss] - Problem accessing ear services from war
by feric
Hello,
I am trying to migrate from Jboss4.0.2 to 4.0.5GA but am having jndi problems.
My application is deployed with three files in the $jboss/server/default/deploy:
- application.ear
- application.war
- application-ds.xml
The war contains all the client jars it needs to access the ear file which has its datasource defined in the *-ds.xml file.
When I run a TestCase which tries to access the ear services, I have no problems. i.e:
| Object objRef = new InitialContext().lookup(LocalizationSessionFacadeHome.JNDI_NAME);
| LocalizationSessionFacadeHome sessionHome = (LocalizationSessionFacadeHome) PortableRemo
| teObject.narrow(objRef, LocalizationSessionFacadeHome.class);
|
| return sessionHome.create();
|
but when the web application (war) tries to access my ear services, I get the following error:
anonymous wrote : 16:05:51,406 ERROR [STDERR] Caused by: java.lang.ClassCastException
| 16:05:51,406 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
| :229)
| 16:05:51,406 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
| 16:05:51,406 ERROR [STDERR] at org.mdarad.global.ServiceLocatorBase.getLocalizationFacade(ServiceLocatorBase.java:33
| 77)
| 16:05:51,406 ERROR [STDERR] ... 27 more
| 16:05:51,406 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy566
| 16:05:51,406 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
| :212)
| 16:05:51,406 ERROR [STDERR] ... 29 more
|
|
It has to be some sort of configuration I need to set up in order to get this to work but I can't figure out which one.
Any help would be greatly appreciated.
Thanks,
François
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980180#3980180
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980180
19 years, 6 months
[EJB 3.0] - Problems accessing jndi from war (not embedded in ear)
by feric
Hello,
I am trying to migrate from Jboss4.0.2 to 4.0.5GA but am having jndi problems.
My application is deployed with three files in the $jboss/server/default/deploy:
- application.ear
- application.war
- application-ds.xml
The war contains all the client jars it needs to access the ear file which has its datasource defined in the *-ds.xml file.
When I run a TestCase which tries to access the ear services, I have no problems. i.e:
Object objRef = new InitialContext().lookup(LocalizationSessionFacadeHome.JNDI_NAME);
| LocalizationSessionFacadeHome sessionHome = (LocalizationSessionFacadeHome) PortableRemoteObject.narrow(objRef, LocalizationSessionFacadeHome.class);
|
| return sessionHome.create();
|
but when the web application (war) tries to access my ear services, I get the following error:
anonymous wrote : 16:05:51,406 ERROR [STDERR] Caused by: java.lang.ClassCastException
| 16:05:51,406 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
| :229)
| 16:05:51,406 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
| 16:05:51,406 ERROR [STDERR] at org.mdarad.global.ServiceLocatorBase.getLocalizationFacade(ServiceLocatorBase.java:33
| 77)
| 16:05:51,406 ERROR [STDERR] ... 27 more
| 16:05:51,406 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy566
| 16:05:51,406 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
| :212)
| 16:05:51,406 ERROR [STDERR] ... 29 more
|
It has to be some sort of configuration I need to set up in order to get this to work but I can't figure out which one.
Any help would be greatly appreciated.
Thanks,
François
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980177#3980177
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980177
19 years, 6 months
[Management, JMX/JBoss] - Re: Embedding MySQL as an MBean with Connector/MXJ
by danliang
These changes are made in MysqldResource.java:
To allow a defaults file
Line 514 was changed to:
| String[] constructArgs(Map mysqldArgs)
| {
| List strs = new ArrayList();
| strs.add(utils.files().getPath(getMysqldFilePointer()));
|
| //This line was previously "no-defaults" or something to this effect
| //The defaults file "my.ini" now is expected to be in the "datadir"
| //NOTE: This can be changed to any directory, but is hardcoded
| //so it is not very portable.
| strs.add("--defaults-file=\".\\my.ini\"");
|
| if (isWindows()) {
| strs.add("--console");
| }
|
Code changes to use specified data and base dirs:
Line 414:
| /** called from option parser as well */
| synchronized Shell exec(String threadName, Map mysqldArgs,
| PrintStream outStream, PrintStream errStream, boolean withListeners) {
|
| //Change the order these calls were made so that the files will be
| //created prior to making sure the files exist.
| makeMysqld();
| ensureEssentialFilesExist();
| adjustParameterMap(mysqldArgs);
| //end changes made
|
|
| String[] args = constructArgs(mysqldArgs);
| outStream.println(new ListToString().toString(args));
|
Line 441:
|
| private void adjustParameterMap(Map mysqldArgs) {
| /*
| //Commented out the ensureDir, this is one major cause of the problem.
| //since it checks the base and data dir against the defaults.
| //It appeared there were other constructors to allow for the data and
| //base dir to be specified but these can not be called through JBoss.
|
| ensureDir(mysqldArgs, baseDir, MysqldResourceI.BASEDIR);
| ensureDir(mysqldArgs, dataDir, MysqldResourceI.DATADIR);
| */
| mysqldArgs.put(MysqldResourceI.PID_FILE, utils.files().getPath(
| pidFile()));
| ensureSocket(mysqldArgs);
| }
|
As far as I remember these were all the changes that had to be made, it has been a while so I may be wrong.
I remember recompiling the source was a real PITA, as there were alot of dependencies on other files.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980176#3980176
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980176
19 years, 6 months