[JBoss Seam] - I have a problem with selectOneMenu
by bebon3
this is my situation
pubic Class A {
private int id;
private B b;
@ManyToOne
public B getB() {
return b;
}
public void setB(B newB) {
this.b = newB;
}
}
public Class B {
private String name;
private int id;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public int getId() {
return id;
}
public void setId(int newId) {
this.id = newId;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
I use JBoos4.2, seam, java 1.6, jsf1.2
Now is my problem:
when i try to persist class A with subobject B with my jsf page:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
Register New Class A
<f:view>
<h:form>
<s:validateAll>
<h:panelGrid columns="2">
Username: <h:inputText value="#{A.username}" required="true"/>
Real Name: <h:inputText value="#{A.name}" required="true"/>
Password: <h:inputSecret value="#{A.password}" required="true"/>
country: <h:selectOneMenu value="#{A.b.id}">
<f:selectItems value="#{register.BList}" />
</h:selectOneMenu>
</h:panelGrid>
</s:validateAll>
<h:messages/>
<h:commandButton value="Register" action="#{register.register}"/>
</h:form>
</f:view>
where "register" is my menagedBean (with seam annotation)
when i submit my page result is terrible
javax.servlet.ServletException: /register.xhtml @23,72 value="#{A.b.id}": Target Unreachable, 'b' returned null on 'org.jboss.seam.example.registration.A'
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
why seam dont create object "b" in object "a" automaticaly? When I use new operator on class b everything is ok?
please help me
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106147#4106147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106147
18 years, 8 months
[JBoss Tools (users)] - "Error copying file" during publish (RHDS CR1, JBAS 4.2.2, S
by gcomnz
I'm getting the following error for each of the publishable files in an EAR-style project set when I publish:
| eclipse.buildId=unknown
| java.version=1.6.0_03
| java.vendor=Sun Microsystems Inc.
| BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
| Command-line arguments: -os win32 -ws win32 -arch x86
|
| Error
| Mon Nov 19 11:59:58 MST 2007
| Error copying file: C:\jboss-4.2.2.GA\server\default\deploy\spades-ear.ear\spades-ejb.jar\META-INF\ejb-jar.xml to META-INF\ejb-jar.xml
|
| java.io.IOException: The system cannot find the path specified
| at java.io.WinNTFileSystem.createFileExclusively(Native Method)
| at java.io.File.checkAndCreate(Unknown Source)
| at java.io.File.createTempFile(Unknown Source)
| at org.jboss.ide.eclipse.as.core.server.xpl.PublishUtil.copyFile(PublishUtil.java:98)
| at org.jboss.ide.eclipse.as.core.server.xpl.PublishUtil.copyFile(PublishUtil.java:450)
| at org.jboss.ide.eclipse.as.core.server.xpl.PublishUtil.copy(PublishUtil.java:505)
| at org.jboss.ide.eclipse.as.core.server.xpl.PublishUtil.publishFull(PublishUtil.java:481)
| at org.jboss.ide.eclipse.as.core.server.xpl.PublishUtil.copy(PublishUtil.java:496)
| at org.jboss.ide.eclipse.as.core.server.xpl.PublishUtil.publishFull(PublishUtil.java:481)
| at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.fullPublish(JstPublisher.java:129)
| at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.publishModule(JstPublisher.java:111)
| at org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishModule(DeployableServerBehavior.java:130)
| at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:749)
| at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:835)
| at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:669)
| at org.eclipse.wst.server.core.internal.Server.doPublish(Server.java:887)
| at org.eclipse.wst.server.core.internal.Server.publish(Server.java:874)
| at org.eclipse.wst.server.core.internal.PublishServerJob.run(PublishServerJob.java:72)
| at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
|
|
Besides that error for each file, Eclipse doesn't seem to report any other errors.
I'm using the Red Hat Developer Studio CR1 install. The project is vanilla, create by the Seam tool within Eclipse. I have plenty of disk space.
The projects deployed properly at first, I then imported them into a fresh Eclipse workspace directory, and as near as I can tell that was when this started. I don't have the old workspace around to try moving them back.
I have now tried creating a fresh project and am getting exactly the same result. I can't think of any other change of any significance that I have made to my system.
Any ideas will be greatly appreciated?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106146#4106146
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106146
18 years, 8 months